Have a personal or library account? Click to login
Edge-based intelligent and smart health monitoring on PYNQ-Z2 using lightweight protocol and integration of machine learning models Cover

Edge-based intelligent and smart health monitoring on PYNQ-Z2 using lightweight protocol and integration of machine learning models

Open Access
|Dec 2025

Full Article

I.
Introduction

In the current era, the growing global population and inadequate healthcare infrastructure have led to an increased reliance on self-healthcare systems. Escalating healthcare costs and unhealthy lifestyles have contributed to a surge in chronic diseases such as diabetes, hypertension, stroke, and cardiovascular disorders. Continuous patient monitoring and early detection of chronic conditions are vital to mitigating their fatal consequences. The Internet of Things (IoT) has emerged as a transformative technology for remote patient monitoring [1, 2]. Personal health devices (PHDs) leveraging IoT capabilities can collect critical patient data, such as temperature, blood oxygen saturation (SpO2) level, and heart rate (HR), and facilitate real-time communication with healthcare providers [18,19,20]. By enabling healthcare services over long distances, IoT reduces hospital stays, travel costs, and associated healthcare expenses [14]. The message queuing telemetry transport (MQTT) protocol plays a pivotal role in enabling efficient Machine-to-Machine (M2M) communication [15]. MQTT, a lightweight messaging protocol based on a publish-subscribe pattern, ensures efficient message transmission between devices [34]. Its key feature is the ability to buffer unsent messages during a broker disconnection and deliver them upon reconnection, ensuring reliable communication in constrained network environments.

The objective of this study is to develop a portable self-health monitoring system that can operate conveniently at home or in rural and remote areas. The system facilitates remote communication using an IoT platform, providing access to medical expertise irrespective of geographical constraints. By integrating machine learning (ML) algorithms, the system offers advanced predictive capabilities, enabling early detection and management of chronic diseases. The proposed intelligent health monitoring system measures critical physiological parameters such as HR, SpO2, and body temperature. Additionally, it integrates the MQTT protocol and IoT platform to enable disease diagnosis and facilitate timely interventions by healthcare professionals. In emergency scenarios, the system alerts doctors and caregivers. Even in cases of unavailability of remote doctor access, the system employs ML algorithms to intelligently predict patient conditions based on recorded data, ensuring uninterrupted monitoring and proactive management.

This paper is structured as follows: Section II provides a literature survey, while Section III details the proposed system architecture. Section IV elaborates data collection and communication. Section V describes the health prediction model utilizing ML classifiers. The working principle of the proposed system is elaborated in Section VI. Section VII discusses the experimental setup, results, and hardware testing. Finally, Section VIII concludes the paper.

II.
Literature Survey

IoT refers to a networked ecosystem where various devices, including portable, wearable, and household devices, are interconnected and integrated with software and hardware, enabling seamless communication across networks. In healthcare, IoT facilitates real-time monitoring, offering flexibility and enabling vital health functions to be observed remotely at any time and place. This capability ensures timely data transmission and patient status monitoring, significantly improving healthcare outcomes [1,2,3,4].

IoT-based pervasive monitoring systems consist of two primary components: data collection and data transmission. These systems typically follow a three-layer architecture: the sensing layer, the transport layer, and the application layer [8]. Numerous researches have focused on real-time health monitoring, enabling remote medical services and patient care based on IoT and ML [29,30,31]. Tonello et al. [5] introduced a sensing platform tailored for remote healthcare applications targeting elderly people. Sharma et al. [6] proposed a novel concept called the Schizophrenia Detection Cap (SczCap), an easy-to-wear cap that integrates both hardware and software to acquire EEG signals from the scalp for precise schizophrenia detection. Zhang et al. [7] presented a novel portable wearable cardiorespiratory sensor integrated with a smartphone, offering a compact and efficient solution for comprehensive cardiorespiratory monitoring, which enables precise measurement of respiratory rate (RR), HR, and heart rate variability (HRV). Wang et al. [28] introduced an outdoor monitoring system for elderly individuals, capable of transmitting physiological signals and fall event data to a healthcare center anytime, from any location. Gupta et al. [32] proposed a system using the Intel Galileo 2nd board for temperature and HR monitoring, though it lacked ECG integration, a critical feature for elderly care.

Pardeshi et al. [9] designed a health monitoring system that captured abnormalities in parameters, such as blood pressure, temperature, and ECG, using GSM or Wi-Fi for alerts. Divakaran et al. [10] created a multi-sensor system with live video feeds and parameter reporting to aid doctors in monitoring patient status remotely. Uddin et al. [11] focused on intensive care unit (ICU) monitoring, enabling specialists to track multiple patients in real time through cloud-connected sensors. Furthermore, various ML-based systems have emerged, integrating IoT frameworks for advanced health monitoring [33, 35, 47]. Bharadwaj et al. [29] introduced both a comprehensive compilation and a review of the state-of-the-art applications of ML algorithms currently being integrated with Healthcare Internet-of-Things (H-IoT) systems. Hussain et al. [24] presented accelerated K-nearest neighbors (KNN) classifiers on FPGA for ensemble classification, while Vieira et al. [25] proposed a flexible streaming KNN classifier for embedded FPGA-SoCs. Other studies, such as those by Samiee et al. [26] and Danopoulos et al. [27], aimed to enhance KNN classification through optimization techniques. Recent IoT systems, such as those by Basu et al. [18,19,20] and Jana et al. [21, 22], have focused on non-invasive health parameter monitoring and coronavirus disease-2019 (COVID-19) tracking, respectively. Chooruang and Mangkalakeeree [23] introduced an integrated MQTT protocol for lightweight communication in HR monitoring systems. By contrast, Bouslama et al. [12] adopted AWS for real-time alerts without data storage, and Stradolini et al. [13] introduced smartwatch-based monitoring for critical patient management. The summary of the literature survey in tabular format is shown in Table 1.

Table 1:

Literature survey summary

Study/authorsKey focus/contributionKey features/applicationsYear
IoT in Healthcare [1,2,3,4]Real-time health monitoring with IoT, enabling remote patientFlexible monitoring at any time and place2015, 2021, 2023, 2018
Tonello et al. [5]Sensing platform for remote healthcareTargeted at elderly care2024
Sharma et al. [6]Schizophrenia Detection Cap (SczCap)Wearable cap for EEG signal acquisition and precise schizophrenia detection2023
Zhang et al. [7]Portable wearable cardiorespiratory sensorIntegrated with a smartphone; measures RR and HR2024
Priya et al. [8]IoT-based pervasive monitoring systemsThree-layer architecture: sensing layer, transport layer, and application layer2019
Pardeshi et al. [9]Health monitoring system for detecting abnormalitiesCaptures blood pressure, temperature, and ECG data; uses GSM or Wi-Fi for alerts2017
Divakaran et al. [10]Multi-sensor system with live video feeds and parameter reporting for remote patient monitoringEnhanced doctor–patient communication2017
Uddin et al. [11]ICU monitoring with cloud-connected sensors for real-time trackingSupported simultaneous monitoring of multiple patients2017
Bouslama et al. [12]Adopted AWS for real-time alerts without dataReduced dependency on local storage resources2019
Stradolini et al. [13]Smartwatch-based monitoringCritical patient management2017
Basu et al. [18,19,20]Developed IoT systems for non-invasive health parameter monitoringAddressed healthcare needs in wearable systems. Focused on recent IoT systems2020
Jana et al. [2122]Focused on IoT-based COVID-19 trackingNon-invasive and effective tracking during the pandemic2021, 2022
Chooruang and Mangkalakeeree [23]Integrated MQTT protocol for lightweight communication in HR monitoring systemsSimplified communication and reduced latency2016
Hussain et al. [24]Accelerated KNN classifiers on FPGA for ensemble classificationEnhanced classification performance in IoT frameworks2012
Vieira et al. [25]Proposed flexible streaming KNN classifier for embedded FPGA-SoCsOptimized for IoT systems2019
Samiee et al. [26] and Danopoulos et al. [27]Focused on enhancing KNN classification through optimizationImproved classification accuracy and speed2018, 2019
Wang et al. [28]Outdoor monitoring system for elderly individualsTransmits physiological signals and fall events to healthcare centers2016
Bharadwaj et al [29]Review of ML algorithms in H-IoT systemsCompilation of state-of-the-art ML applications in IoT healthcare2021
Gupta et al. [32]System using Intel Galileo 2nd board for temperature and HR monitoringMonitors temperature and HR; lacks ECG integration2016

COVID-19, coronavirus disease-2019; H-IoT, healthcare Internet of things; HR, heart rate; ICU, intensive care unit; IoT, Internet of Things; KNN, K-nearest neighbors; ML, machine learning; MQTT, message queuing telemetry transport; RR, respiratory rate; SoC, system-on-chip.

III.
Proposed System Architecture

This study aims to develop an IoT-based healthcare system capable of collecting multiple physiological parameters from a patient, analyzing the data to detect abnormalities, and transmitting the information to a server for storage. The system also automatically notifies the physician via email about the patient’s health status and displays the measured parameters on a web interface. Additionally, the system employs ML algorithms to predict the patient’s health condition based on the collected data. This section outlines the essential components of the proposed system, including data collection and communication mechanisms, as well as the ML models utilized for health condition analysis.

a.
Necessary components
a.i
HR and pulse oximeter sensor (MAX30100)

The MAX30100 is an integrated sensor that combines pulse oximetry and HR monitoring capabilities [16]. It features two LEDs, a photodetector, and low-noise analog signal processing. The sensor operates on the principle of remote photo plethysmography (rPPG), which measures HR and SpO2 levels by analyzing the varying absorption of red and infrared lights through oxygenated and deoxygenated blood. For accurate results, measurements are typically taken from the fingertip, where capillaries are near the surface. The sensor’s optical reflection method is ideal for wearable applications, making it a reliable choice for this system.

a.ii
Body temperature sensor (DS18B20)

The DS18B20 digital temperature sensor provides temperature readings with a resolution ranging from 9 bits to 12 bits in Celsius [37]. Its design allows for measurements from various locations such as the underarm, oral cavity, or ear canal. The sensor communicates using a single data line, making it efficient and easy to interface with the microcontroller.

a.iii
ESP32 microcontroller

The ESP32 is a powerful dual-core 32-bit microcontroller with built-in Wi-Fi and Bluetooth modules [36]. Its low-cost, energy-efficient design includes features such as 4 MB flash memory, 520 KB SRAM, multiple I2C, SPI, and UART interfaces, and 12-bit ADCs. This makes it ideal for sensor integration, data processing, and communication tasks.

a.iv
Raspberry Pi (RPI)

The RPI is a compact microcomputer with Linux-based Raspbian OS [17]. It serves as a cost-effective platform for interfacing with IoT devices. The RPI 3 Model B used in this system includes a quad-core processor, 1 GB RAM, built-in Wi-Fi, Bluetooth low energy (BLE), and a variety of input/output ports. It acts as an MQTT broker, facilitating data transfer and storage.

IV.
Data Collection and Communication

The proposed system comprises three primary subsystems: data collection, data acquisition, and communication. Each subsystem is outlined below.

a.
Data collection

This subsystem gathers multiple medical parameters such as HR, body temperature, SpO2, and vital signs using sensors. Analog data from the sensors are processed and converted to a digital format for storage and transmission. Table 2 presents and summarizes the dataset for the proposed system.

  • (1)

    HR and blood oxygen monitoring: The MAX30100 sensor measures HR and SpO2 levels through optical reflection. It uses the I2C communication protocol via SDA and SCL pins to interface with the ESP32 microcontroller.

  • (2)

    Body temperature measurement: The DS18B20 sensor measures body temperature using methods such as oral, axillary, or tympanic. It communicates with the ESP32 via the SPI protocol for configuration and data transfer.

Table 2:

Dataset for the proposed system

IndexSubjectSessionAge groupDayHR (bpm)SpO2Temp (°F)
0S1Morning (rest)ADay 17998103
1S1Morning (rest)ADay 2769798
2S1Morning (rest)ADay 374979 0
3S1Morning (rest)ADay 47598100
4S1Morning (rest)ADay 5729692
895S10Evening (normal)CDay 68198110
896S10Evening (normal)CDay 77996108
897S10Evening (normal)CDay 8869690
898S10Evening (normal)CDay 9918195
899S10Evening (normal)CDay 10879697

HR, heart rate; SpO2, blood oxygen saturation.

b.
Data acquisition

The ESP32 microcontroller is used for data acquisition, processing, and transmission. It supports low-power operations and is programmable using Arduino IDE or Micro-Python. Equipped with multiple communication interfaces (I2C, SPI, and UART), it processes sensor data and performs initial analysis to detect abnormalities.

c.
Communication

The communication subsystem is designed for fast, low-cost, and reliable data transfer. The ESP32 handles data transmission using the MQTT protocol, while the RPI serves as the MQTT broker for data storage and management.

  • (1)

    ESP32 with MQTT: The ESP32 connects to a Wi-Fi network and acts as an MQTT client to publish sensor data to specific topics (e.g., esp32/pulse, esp32/temperature, and esp32/SpO2). The MQTT broker, running on RPI, receives and manages these messages.

  • (2)

    RPI as MQTT broker: The RPI, running Raspbian OS, hosts the MQTT broker (Mosquitto) to facilitate data exchange between devices. It stores patient data, provides historical information, and acts as a web server for remote monitoring. The MQTT protocol ensures reliable message delivery and supports thousands of clients, making it ideal for scalable healthcare applications.

The system’s MQTT architecture employs a publish/subscribe model for efficient data exchange. Users can access the monitoring system remotely by entering the server’s IP address. Based on login credentials, the system provides specific functionalities for administrators, doctors, and patients. For instance, doctors can monitor patient health, search records, and manage patient lists via a dedicated web interface.

V.
Design of Health Prediction Unit Using ML Classifiers

The intelligent health prediction unit leverages ML techniques to assess a patient’s heart health, SpO2 levels, and body temperature based on health parameters, gender, and age. The system is trained using real-time data collected from the DS18B20 and MAX30100 sensors. For this implementation, a support vector machine (SVM), KNN, and decision tree (DT) algorithms are employed for training and testing. The training dataset comprises real-time data acquired through the proposed system and incorporates classifications aligned with the American Heart Association (AHA) standards for cardiac health. This prediction unit provides critical insights into a patient’s condition, especially in the absence of immediate medical advice. It also facilitates efficient preliminary diagnoses, thereby reducing the workload of healthcare professionals and enabling rapid, accessible health assessments.

a.
Overview of different classifiers

The system employs various ML classifiers, including KNN, SVM, and DT. A brief overview of these classifiers is presented below [41]:

  • (1)

    KNN algorithm: KNN [38] is a nonparametric supervised learning algorithm that classifies new data points based on their similarity to the K-nearest training data points. The algorithm calculates the distance between the new data point and all training data points and assigns the majority class label among the KNN.

      Mathematical representation
    • (a)

      Let k be the number of neighbors considered for classification.

    • (b)

      D (xi, xj): A distance function between data points xi and xj.

    • (c)

      For a new instance x, the algorithm identifies its KNN and assigns it the majority class label.

  • (2)

    SVM algorithm: SVM [39] constructs a hyperplane to separate data points into distinct classes. The algorithm seeks the hyperplane that maximizes the margin, defined as the distance between the hyperplane and the nearest data points from either class. A linear kernel is used in this system to simplify computation.

      Mathematical representation
    • (a)

      Let X represent the training data points and Y the class labels.

    • (b)

      The hyperplane is defined as w · x + b = 0, where w is the weight vector and b the bias.

    • (c)

      The SVM maximizes the margin while ensuring data points on the same side of the hyperplane are in the same class.

  • (3)

    DT algorithm: The DT [40] algorithm uses a tree-like structure to classify data points. Each internal node represents a feature, branches denote decisions based on feature values, and leaf nodes represent the final class labels. The tree is constructed by recursively splitting the data based on the most significant feature.

      Mathematical representation
    • (a)

      Let X be the training data points and Y the class labels.

    • (b)

      At each node, split X into subsets Xl and Xr based on a feature f and threshold θ:

      • Xl = {xX | x[f] < θ}

      • Xr = {xX | x[f] ≥ θ}

    • (c)

      Recursively, the trees are built until each leaf node contains data points of the same class.

b.
Detailed steps of ML algorithms

The health monitoring system employs the following key steps for ML-based prediction:

  • (1)

    Data collection and preparation: Data were collected from the proposed hardware system, which measured various health parameters. This dataset, comprising more than 900 complete patient records, was used to train and validate the model. Data collection timing varied, ensuring a diverse range of samples. Key criteria for data selection included:

    • Inclusion of critical health parameters such as HR, SpO2, and temperature.

    • Consistent formatting and completeness of data records.

  • (2)

    Feature extraction and classification: The collected data were processed to extract relevant features for classification. These features included:

    • Vital signs (HR, SpO2, and body temperature)

    • Demographic information (gender and age)

    The extracted features were fed into the ML classifiers (KNN, SVM, and DT) to train the prediction model. Once trained, the system classified patient health status and identified potential abnormalities.

  • (3)

    Evaluation metrics: To evaluate the reliability of the ML algorithms trained on the dataset, we used four key metrics: accuracy, precision, recall, and the F1 score. These metrics [42] provide a comprehensive view of the predictive model’s performance in identifying safe or unsafe healthcare data based on various analytical techniques. The models were both trained and tested on the collected dataset.

    • Accuracy

      Accuracy measures the proportion of correct predictions made by the model relative to the total number of predictions. It is calculated using the formula: Accuracy=NumberofCorrectPredictionsTotalNumberofPredictions {\rm{Accuracy}} = {{{\rm{Number}}\;{\rm{of}}\;{\rm{Correct}}\;{\rm{Predictions}}} \over {{\rm{Total}}\;{\rm{Number}}\;{\rm{of}}\;{\rm{Predictions}}}}

      The accuracy score is determined by comparing the true labels (actual values of data points) with the predicted labels (values predicted by the model). High accuracy indicates that the model is effective across the dataset.

    • Precision

      Precision evaluates the model’s ability to correctly identify positive predictions. It is calculated as the ratio of true positives to the total number of positive predictions (true positives + false positives): Precision=TimePositiveTruePositive+FalsePositive {\rm{Precision}} = {{{\rm{TimePositive}}} \over {{\rm{True}}\;{\rm{Positive }} + {\rm{False}}\;{\rm{Positive}}}}

      A high precision value indicates that the model minimizes false positives and is effective in identifying positive cases.

    • F1 Score

      The F1 score provides a balanced measure of a model’s precision and recall by calculating their harmonic mean. It is particularly useful when there is an imbalance between classes in the dataset. The F1 score is given by: F1=2PrecisionRecallPrecisionRecall {\rm{F}}1 = 2 \cdot {{{\rm{Precision}} \cdot {\rm{Recall}}} \over {{\rm{Precision}} + {\rm{Recall}}}}

      The F1 score ranges from 0 to 1, with a higher value indicating better performance.

    • Recall

      It measures the proportion of true positive predictions out of all actual positive instances. High recall indicates few false negatives. Recall=TruePositivesTruePositives+FalseNegatives {\rm{Recall}} = {{{\rm{True}}\;{\rm{Positives}}} \over {{\rm{True}}\;{\rm{Positives}} + {\rm{False}}\;{\rm{Negatives}}}}

    • Evaluation approach

      Using the selected combination of features for this study, we assessed the predictive performance of the ML models. Three ML models are evaluated and compared based on the defined metrics. A comparative analysis was conducted to identify the model that best fits each data column for prediction.

VI.
Overall Working Principle of the Proposed MQTT and ML-Based Health Monitoring

This section explains the fundamental operating principle of the proposed system. Figure 1 illustrates the architecture of the MQTT and ML-based health monitoring system. The proposed health monitoring system integrates a microcontroller with three primary biomedical sensors, including a body temperature sensor module, pulse oximeter, and HR sensor. The body temperature sensor, DS18B20, is attached to the left arm, while the MAX30100 sensor is positioned on the right index finger. These sensors are connected to the microcontroller through programed operations, enabling seamless data collection.

Figure 1:

Proposed MQTT and ML-based health monitoring system. ML, machine learning; MQTT, message queuing telemetry transport.

The system utilizes Mosquitto, an open-source MQTT broker, with RPI 3 acting as the MQTT broker. When a patient’s vital signs exceed predefined threshold values, an alert message is sent to multiple users (doctors or nurses) via the MQTT Dashboard Application on their mobile devices. Sensor data are transmitted to a local or cloud server through both wired and wireless connections. For wired connectivity, an Ethernet port links the microcontroller to the network gateway, enabling data transmission to the server.

The sensors collect data at 2 ms intervals, measuring parameters such as SpO2 level and pulse rate. The gathered data are displayed locally and stored in a cloud database. Both patients and doctors can access these data via a secure portal. Doctors can remotely monitor patients and provide guidance. If critical health indicators suggest a serious condition, a notification prompts the medical team to act, including a pop-up option to call for an ambulance.

The system measures essential physiological parameters, such as HR, SpO2, and body temperature—and makes the data accessible via an IoT platform. In addition, the system employs ML algorithms to predict a patient’s condition even in the absence of remote doctors or internet access. This health indicator unit ensures timely and intelligent health status predictions.

a.
Flowchart of classification using ML
  • Import dataset: Load the dataset into the system.

  • Preprocess data: Clean the dataset by removing null values.

  • Optimize data: Transform data columns into a 1D array for classification. Convert string datatypes into integer values using NumPy for compatibility.

  • Select kernel: Choose a kernel for the classification algorithm (e.g., linear kernel for SVM).

  • Classification: Apply three different classifiers (KNN, SVM, and DT) to classify columns, such as HR, SpO2, and temperature. Measure the model’s precision and accuracy.

  • Train model: Train the classifiers using the dataset.

  • Test system: Test the trained system by predicting cardiac conditions for input test data. Repeat the process for other classifiers.

  • Comparison: Graphically compare precision, recall, F1 score, and accuracy across classifiers.

By analyzing HR, body temperature, and SpO2 levels, this system provides personalized care for chronic conditions. It leverages IoT and cloud technologies for continuous monitoring, with data being processed and analyzed by three classifiers. Comparative analysis identifies the most effective classifier, and the data are sent directly to the medical cloud server.

b.
Flowchart of the overall working principle
  • A. Power ON the system

  • B. Initialize the ESP32 microcontroller

  • C. Set up the MQTT protocol

  • D. Select the health parameter to measure

    • Press push-button 1 to measure HR and SpO2

    • Press push-button 2 to measure body temperature

  • E. Display the measured parameters on the LCD screen

  • F. Evaluate the data

    • If within threshold values, a green LED blinks

    • If outside threshold values, a red LED blinks, and a buzzer sounds

  • G. Data upload

    • If internet connectivity is available, upload measured data to the cloud server for access by remote doctors.

    • In emergencies, doctors receive an immediate email notification.

  • H. Offline operation:

    • If the internet is unavailable, the system uses its ML model to predict the patient’s condition based on measured data and personal details like age and gender.

    • Predicted results are stored in the cloud for later access.

VII.
Experimental Setup, Results, and Performance of ML Algorithms and FPGA-Based Hardware Testing

This section provides an overview of the experimental setup for the proposed health monitoring system, its results, and the FPGA-based hardware testing of ML algorithms and a comparative study of this work with existing previous work.

a.
Experimental setup and results

The design and implementation of the proposed architecture are described in this section. Figures 2A–2D illustrate the hardware implementation of the health monitoring system. The system displays temperature readings on the LCD every 3 s, while HR and SpO2 values are updated every 15 s.

Figure 2:

Hardware implementation of the proposed MQTT and ML-based smart health monitoring system (A) SPO2-HR monitoring (B) body temperature monitoring (C, D) overall experimental set up. ML, machine learning; MQTT, message queuing telemetry transport.

Data can be optionally sent to the ThingSpeak cloud [43]. Table 3 presents vital health parameters as displayed on the LCD and ThingSpeak cloud server during different sessions. The ThingSpeak channel also provides a graphical visualization of the sensor data, making it accessible to doctors and physicians through external webpages. In case of abnormal health parameters, the system alerts the patient via a buzzer and LED. When internet connectivity is available, vital signs such as HR, SpO2, and body temperature are immediately uploaded to the ThingSpeak cloud server [43].

Table 3:

Vital health parameters displayed locally and on the cloud (ThingSpeak)

Vital parameterSessionDisplayed on LCDUploaded to ThingSpeak cloud
Body temperatureMorning96.35°F, 96.51°F96.35°F, 96.51°F
Afternoon98.24°F, 97.20°F98.24°F, 97.20°F
Evening98.57°F, 96.24°F,98.57°F, 96.24°F, 97.13°F
HRMorning78 bpm, 86 bpm78 bpm, 86 bpm
Afternoon74 bpm, 80 bpm, 7674 bpm, 80 bpm, 76 bpm
Evening68 bpm, 89 bpm, 9368 bpm, 89 bpm, 93 bpm
SpO2Morning98%, 97%98%, 97%
Afternoon96%, 81%96%, 81%
Evening95%, 96%95%, 96%

HR, heart rate; SpO2, blood oxygen saturation.

Figures 3A–3C demonstrate the uploaded data for a single patient and show the graphical representations of vital parameters such as SpO2 (%), HR (bpm), and temperature (°F) over time for a patient, respectively. Table 3 displays vital health parameters data, both for local visualization and cloud-based monitoring.

Figure 3:

Graphs showing monitoring (A) SpO2, (B) HR, and (C) body temperature of a patient. HR, heart rate; SpO2, blood oxygen saturation.

b.
Performance of ML algorithms and hardware testing using the PYNQ Z2 FPGA board

The performance analysis of three ML classifiers—KNN, DT, and SVM—is carried out by evaluating metrics such as accuracy, precision, recall, and F1-score. Results are summarized in Tables 4 and 5.

Table 4:

Comparison table of accuracy and precision for three different classifiers

Health parametersAccuracy (%)Precision

ClassifiersKNNDTSVMKNNDTSVM
HR98.8842.7848.330.970.350.18
SpO287.2251.6658.330.870.510.36
Body temperature90.5598.6795.060.910.970.96

DT, decision tree; HR, heart rate; KNN, K-nearest neighbors; SpO2, blood oxygen saturation; SVM, support vector machine.

Table 5:

Comparison table of F1 score and recall for three different classifiers

Health parametersF1 scoreRecall

ClassifiersKNNDTSVMKNNDTSVM
HR0.980.210.200.980.320.36
SpO20.900.390.400.920.500.56
Body temperature0.930.920.960.940.930.97

DT, decision tree; HR, heart rate; KNN, K-nearest neighbors; SpO2, blood oxygen saturation; SVM, support vector machine.

KNN demonstrates superior performance across all metrics, particularly in accuracy, precision, recall, and F1-score. By contrast, DT and SVM exhibit lower performance, especially for HR and SpO2. Figures 4–7 illustrate the graphical comparisons of accuracy, precision, F1-score, and recall among the classifiers.

Figure 4:

Graphical representation of accuracy for three different classifiers. DT, decision tree; SVM, support vector machine.

Figure 5:

Graphical representation of precision for three different classifiers. DT, decision tree; SVM, support vector machine.

Figure 6:

Graphical representation of F1 scores for three different classifiers. DT, decision tree; KNN, K-nearest neighbors.

Figure 7:

Graphical representation of recall for three different classifiers. DT, decision tree; SVM, support vector machine.

c.
Hardware testing of ML algorithms using PYNQ Z2 FPGA board

PYNQ (Python Productivity for ZYNQ) combines programmable logic (PL) and programmable system (PS) within the Xilinx ZYNQ FPGA system-on-chip (SoC) [44, 45]. The integration of Python and programing libraries simplifies FPGA-based embedded system development. Figure 8 shows the PYNQ Z2 FPGA board [44]. Using the Vivado Design Suite, we created and connected an AXI Stream interface IP to the PS part of the FPGA block design.

Figure 8:

PYNQ Z2 FPGA board.

The ML model, developed in Python, is deployed on PYNQ via Jupyter Notebook. The KNN hardware accelerator overlay design, illustrated in Figure 9, enhances the classifier’s performance by leveraging PL as a hardware accelerator [45, 46]. Figure 10 outlines the joint simulation system that links Python programs to FPGA hardware through an AXI interface. Figure 11 FPGA presents overall experimental set up for FPGA-based implementation.

Figure 9:

KNN accelerator data path diagram. KNN, K-nearest neighbors; PL, programmable logic; PS, programmable system.

Figure 10:

Joint simulation system. PL, programmable logic; PS, programmable system.

Figure 11:

Presents the experimental setup for the FPGA-based implementation.

Implementation results for KNN and SVM classifiers are shown in Table 6. Table 6 summarizes the hardware implementation results of KNN and SVM classifiers, detailing parameters such as accuracy, clock frequency, resource utilization, and power consumption. Among the classifiers, KNN is more efficient, occupying fewer hardware resources and consuming less power (0.228 W).

Table 6:

FPGA implementation results for KNN and SVM

Design parametersKNNSVM
Classification accuracy (overall in %)85.5562.22
Frequency (MHz)100.0732.28
BRAM45
DSP48E1010
FF3,4933,999
LUTs2,8263,022
Power consumption (W)0.2280.414

FF, flipflop; KNN, K-nearest neighbors; LUTs, look-up tables; SVM, support vector machine.

It achieves an overall classification accuracy of 85.55%, with faster processing times compared to SVM. The results demonstrate that deploying KNN on PYNQ Z2 FPGA accelerates the classification process while maintaining high accuracy and efficient resource utilization.

d.
Discussion on KNN’s superior performance

The experimental results clearly indicate that the KNN classifier outperforms SVM in terms of both classification accuracy (85.55% vs 62.22%) and hardware efficiency on the PYNQ-Z2 FPGA platform. This superior performance is primarily due to KNN’s simple, instance-based learning approach, which avoids complex training phases and extensive parameter tuning, making it particularly effective for the small and structured dataset used in this work. Additionally, KNN’s straightforward distance computation and voting mechanism map efficiently onto FPGA resources such as look-up tables (LUTs) and flip-flops, resulting in reduced hardware complexity and a higher operating frequency (100.07 MHz for KNN vs 32.28 MHz for SVM). The integration of lightweight communication protocols further complements KNN’s predictable and low-latency operations, leading to lower power consumption (0.228 W compared to 0.414 W for SVM) and higher throughput, which are crucial for real-time edge applications. Moreover, the sensor data features used for health monitoring are well-separated and linearly distinguishable, favoring distance-based methods like KNN. SVM’s performance may degrade in such scenarios unless a carefully selected kernel is employed, which was avoided to minimize hardware overhead.

e.
Comparative study of proposed work with existing similar works

We used a comparative analysis using tabular format that places our proposed PYNQ-Z2 FPGA implementations of KNN and SVM classifiers side by side with previous FPGA-based works, highlighting classification accuracy, power consumption, frequency, cost, and resource usage shown in Table 7.

Table 7:

Comparison of proposed FPGA implementation results for KNN and SVM with existing similar research work

Research work/hardware (FPGA) platformClassifiersAccuracy (%)Freq. (MHz)Power (W)BRAMDSP’sLUTFF’sCost
PYNQ-Z2 (proposed work)KNN85.551000.2284103,4932,826Low power/cost optimized
SVM62.2232.280.4145103,9993,022
Virtex-7 implement KNN Algorithm on FPGA [48]KNN-3.1365121223,89211,838High cost
ZYNQ-SOC Melanoma detection based on FPGA (2019) [49]SVM97.91.69----∼3% of FPGA resource usage and costly
Kintex-7 FPGA implementation on of breast Cancer (2023) [50]SVM91.084.57----High end FPGA. Costly.
PYNQ-Z2 Real-time breast cancer Classification (2025) [51]CNN89.871.4∼65% of BRAM usage∼72% of DSP usage∼68% of LUT usage-High resource usage and moderate cost

FF, flipflop; KNN, K-nearest neighbors; LUT, look-up table; SVM, support vector machine.

e.i.
Observations and comparative insights
  • In the proposed work, KNN design consumes significantly less power (∼0.228 W) compared to Fahad Muslim’s implementation of KNN on Virtex-7 (∼3.136 W) [48], Melanoma detection work on Zynq-SoC (∼1.69 W) [49], Laxmisagar and Hanumantharaju [50] work on Kintex-7 (∼4.57 W), and Mhaouch et al. [51] work on PYNQ-Z2 (∼1.4 W). Accuracy of KNN classifier is also moderately high 85.55% on proposed PYNQ-Z2 hardware platform shown in Table 7.

  • SVM has lower accuracy (62.2%) but also much lower power (∼0.414 W) consumes compared to previous works shown in Table 7.

  • Resource usage (BRAM, DSP, flipflop [FF], LUT) in the proposed model appears modest and efficient: BRAM 4–5, DSP48E 10, LUT ∼2,800 to 3,000, and FF ∼3,500 to 4,000.

  • The proposed working model implemented using KNN and SVM classifiers on PYNQ-Z2 hardware platform also offers the cost optimized solution with recent existing work shown in Table 7.

Our proposed design shows low power and low resource usage for both KNN and SVM on PYNQ-Z2 FPGA. It offers moderate accuracy (especially for KNN), but with much lower power consumption than many previous works. So, in summary, we can say that KNN stands out as a low-power (∼0.228 W) and moderate-accuracy (∼85.55%) inference engine—highly suitable for embedded/edge deployments.

VIII.
Conclusion and Future Scope

The proposed health monitoring system offers a versatile solution, suitable for installation at the user’s residence or workplace, enabling real-time patient data exchange with doctors through internet-connected smart devices. Designed to track critical health metrics, the system can also be adapted into a wearable device, showcasing a significant advancement in healthcare technology. By leveraging webhook applets for automated notifications to doctors, the system introduces an innovative approach to patient care. This study highlights the potential of IoT technologies in transforming healthcare by enabling continuous patient monitoring, early detection of abnormalities, and intelligent data analysis through ML algorithms. The system, built on the MQTT protocol, effectively monitors vital parameters, such as HR and body temperature, offering benefits, such as reduced hospital visits and improved accessibility, even in remote locations. Comprehensive testing of the prediction model was conducted using various ML classifiers, including SVM, KNN, and DT. Among these, the KNN classifier demonstrated superior performance and was successfully implemented using Python on the PYNQ-Z2 FPGA platform through Jupyter Notebook, with a KNN hardware accelerator designed to enhance its functionality. This study represents a step toward the development of intelligent, cost-effective, and efficient healthcare systems capable of improving patient outcomes and healthcare accessibility.

a.
Limitations in real-time performance of proposed method

Although the proposed KNN-based health monitoring system on the PYNQ-Z2 platform demonstrates superior classification accuracy and efficient hardware utilization, but there are several limitations affect its real-time performance. First, KNN is a lazy learner, meaning that during inference, the algorithm requires real-time computation of distances between the incoming data and all stored instances. As the dataset size grows, this can lead to increased latency and reduced throughput, particularly in continuous monitoring scenarios. Second, while FPGA resources, such as LUTs and BRAM, are utilized efficiently, the limited on-chip memory of PYNQ-Z2 restricts the ability to handle larger feature sets or high-frequency sensor data streams without external memory support. Additionally, the implemented lightweight protocols, while power-efficient, may introduce network latency when transmitting large volumes of sensor data for real-time analysis. Finally, the model lacks adaptive learning capabilities; any update to the dataset requires reloading or reconfiguring the stored instances, which could hinder dynamic performance in real-world deployments.

b.
Future scope

The proposed framework can be further enhanced by integrating wearable and IoT-enabled health devices to enable continuous real-time monitoring and personalized healthcare services. Incorporating advanced ML paradigms, including deep learning technique and ensemble-based hybrid ML models, will significantly improve predictive accuracy and adaptability to diverse health conditions. Moreover, hardware-aware optimizations, such as model pruning, quantization, and compression techniques, can minimize latency and power consumption for edge deployments. Memory optimization using external DDR memory or advanced memory management techniques to handle high-frequency sensor streams and large feature sets Finally, secure cloud-edge collaboration and privacy-preserving methods, such as federated learning or blockchain-based data sharing, can be explored to achieve scalable, reliable, and privacy-centric healthcare solutions.

Language: English
Submitted on: Jun 29, 2025
|
Published on: Dec 31, 2025
In partnership with: Paradigm Publishing Services
Publication frequency: 1 issue per year

© 2025 Samik Basu, Rajdeep Ray, Arkadip Maitra, Pritha Banerjee, Amlan Chakrabarti, published by Professor Subhas Chandra Mukhopadhyay
This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License.