2. Materials and Methods
In the 21st century, European countries are experiencing population aging, which is exacerbated by the crisis in their health systems. Most countries face a lack of personnel and a decrease in birth rates. The long-term effects of these two problems have led to a shortage of personnel to provide palliative care for the elderly. This paper proposes a comprehensive solution that integrates embedded technology with modern systems for analyzing and providing real-time alerts on the health status of elderly individuals who do not have serious health issues. The bracelet device uses a heart rate sensor mounted on an M5Stack (produced by M5Stack Technology Co., Ltd., Shenzhen, China) to capture the average heart rate. The system also integrates a preventive component that monitors other parameters whose values could indicate precursor events of an imminent incident. For this identification, the prototype bracelet monitors average heart rate (AR), minimum heart rate (mR), maximum heart rate (MR), number of steps taken (S), deep sleep time (DST), and superficial sleep time (SST). The integrated system uses Azure cloud infrastructure for automatic alert generation and critical event management. In this way, medical staff can intervene to save the lives of those in need.
This section provides an overview of the proposed system’s technical specifications before detailing individual components to ensure a clear and structured approach.
The proposed system comprises a wearable bracelet equipped with a MAX30100 heart rate sensor (manufactured by Analog Devices Holdings Co., Ltd., Shanghai, China) and an MPU-6050 accelerometer (produced by TDK InvenSense, Shenzhen, China) for tracking steps and sleep. Data is continuously transmitted to an Azure-based cloud platform via secure Wi-Fi communication. The cloud infrastructure preprocesses the data, applies anomaly detection algorithms, and triggers alerts when necessary.
HADA is designed to analyze six key physiological parameters: AR, mR, MR, S, DST, and SST. The algorithm utilizes PCA to identify deviations from expected trends, enabling personalized health assessments based on individual baseline data. The system periodically retrains HADA to account for changes in patient conditions, ensuring adaptive and accurate monitoring.
Once processed, data is securely stored in an Azure SQL Database. Alerts are generated and transmitted via Azure Communication Services, including SMS notifications to caregivers if an anomaly is detected. This ensures rapid medical intervention in critical situations.
2.1. Monitored Parameters and Analyzed Dataset
The identification of health status and prevention of incidents in elderly individuals is achieved through real-time processing of the following parameters:
AR represents the average pulse value calculated at predefined time intervals. Through this parameter, a general overview of cardiovascular activity is identified. In this way, trends that may indicate a suboptimal health condition are detected.
mR is the minimum recorded pulse value and is monitored to detect any episodes of bradycardia. Such an incident requires prompt medical intervention and is a zero-level alert.
MR records the maximum pulse values, abnormal values being associated with tachycardia situations. These fluctuations can signal cardiovascular stress or other acute cardiac issues, also constituting zero-level alerts.
S monitors the number of daily steps taken. This parameter serves as an indicator of physical activity level. This parameter contributes to assessing mobility and overall health status, not being one that generates a major alert.
DST indicates the time spent in the deep sleep phase. This parameter identifies the body’s recovery capacity and physical resource restoration.
SST monitors the time spent in the superficial sleep phase. This parameter helps evaluate overall sleep quality, providing clues about disturbances or imbalances in rest cycles.
The first three parameters are quantified in BPM, S is measured in the number of steps, and the last two in minutes, as shown in
Figure 1, which presents the feature diagram for the dataset built for a single patient. If an anomaly is identified, the output of the employee’s anomaly analyzer algorithm is 1. In this case, an alert is released. Otherwise, the output is 0.
The dataset is built using the six parameters presented in
Figure 1. These enable the monitoring of the health status of elderly patients. The analysis must be personalized because each patient has unique traits, depending on the medication, their specific body configuration, lifestyle, and activity levels. Thus, thresholds for parameters can vary significantly from one patient to another.
It is important to note that these parameters were selected based on their correlation with early warning signs. They encompass cardiovascular health, physical activity, and sleep patterns, collectively providing a holistic health assessment. Moreover, the variability of threshold values among individuals is addressed through personalized baseline adjustments. The threshold values for each patient can be customized by the treating doctor, who is familiar with the patient’s medical history. By analyzing the collected data, the doctor can establish personalized thresholds that accurately reflect the patient’s health status and specific medical needs.
Based on these considerations, a unique analysis is required for each monitored person. This unique model enables precise alerts tailored to personalized statistics for each individual. Therefore, the dataset is built for a single patient because individualized monitoring enables obtaining a detailed and accurate profile of vital parameters without the interference caused by inter-individual variability. The analyzed dataset spans a two-year period, from 1 January 2023 to 31 December 2024. The frequency of activity data for life-threatening parameters (AR, mR, and MR) is 725,338 records, while the general state parameter S contains 9455 records, and the rest (DST and SST) contain 680. The output of the anomaly analyzer is referred to as a label.
2.2. Proposed Embedded System
The hardware prototype features the M5Stack module as its central element. This represents a modular embedded solution that integrates processing, wireless communication, and energy management functionalities. This energy management method, which utilizes deep sleep and wake-up mechanisms triggered by events, is superior to all other solutions proposed in the literature to date. This embedded solution enables the connection of multiple sensors, whose values are read at predetermined time intervals or when an event occurs, with minimal energy consumption. Furthermore, the real-time handling of data transmitted to the cloud infrastructure for detailed analysis and alert generation makes the M5Stack a top choice for elderly monitoring solutions. Additionally, when the battery level drops below the 5% threshold, the person responsible for monitoring the elderly individual is notified to intervene and resolve the issue. This situation must be addressed when the elderly person neglects to recharge the bracelet.
A heart rate bit sensor, MAX30100, is used for heart rate monitoring. This sensor emits light pulses, while the photodetector measures the variations in the intensity of light reflected by blood flow.
For step counting (S), the prototype integrates an MPU-6050 module, which combines an accelerometer and a gyroscope. The accelerometer detects the characteristic movements of walking, and data processing algorithms convert this information into the number of steps. By correlating this data with heart rate data, the algorithms estimate energy consumption.
Sleep quality is assessed based on the DST and SS. The values of these two parameters are determined through actigraphic analysis of the accelerometer data. Detecting periods of minimal movement enables differentiation between deep sleep phases and superficial sleep phases.
Figure 2 presents the simplified logical schema of the embedded device. Each device has a unique identification code (ID). This code establishes the correlation between the monitored patient, the device, and the evolution of the six monitored parameters over time for that specific patient. The embedded device’s algorithm initializes serial communication and Wi-Fi connection to transmit data to the central server. Subsequently, the two sensors are initialized and read the battery level. Heart rate measurements are collected over a defined interval in a continuous loop to determine the maximum, minimum, and average values. Afterward, the six monitored parameters are calculated. The M5Stack receives and preprocesses data from all sensors. It forms a JSON payload with all necessary values, including the battery level information. Using the integrated Wi-Fi module, the M5Stack sends the data via an HTTP POST to the ASP.NET API server, which collects the information for anomaly analysis. The system disables data reading until the condition is met again. During the entire period of system deactivation, it remains in power-saving mode. Exiting this mode occurs when a new reading is required or the battery is fully depleted.
Figure 2 presents a simplified schema, as each parameter has different time conditions in reality. For example, heart rate monitoring is performed more frequently than sleep monitoring.
The prototype proposed in this paper uses a Wi-Fi connection in this configuration to transmit data to the Azure infrastructure. For situations where the system is in a scenario where the Wi-Fi network is unavailable, the M5Stack module has the option to use the cellular communication module with a Subscriber Identity Module (SIM) card. This technology is compatible with Long-Term Evolution (LTE) for Machines (LTE-M) or Narrowband IoT (NB-IoT). In this way, the collected data is transmitted to the cloud platform via the mobile network, eliminating the need for a local network. Future versions will consider integrating the automatic communication mechanism between Wi-Fi and the mobile connection, depending on network availability. In this way, the continuity of real-time monitoring and the resilience of the system in diverse environments will be ensured.
The pseudocode for calculating AR, mR, and MR involves initializing a list of successive heart rate readings from the heart rate bit sensor, followed by the standard initialization of the total number of readings and the minimum and maximum values that need to be calculated. Subsequently, the list of readings is built, and the average, maximum, and minimum values are updated accordingly (Heart_Rate.txt file from the
Supplementary Material).
The prototype used in this study employs the M5Stack module, which integrates the ESP32 microcontroller, enabling operation in five modes that optimize energy consumption. In the standard version, it operates in active mode, with all peripherals functioning. The Modem Sleep variant keeps the processor active while deactivating the communication modules. For light sleep, the Central Processing Unit (CPU) is turned off, whereas the random-access memory (RAM) and peripherals are retained. It can be reactivated via General Purpose Input/Output (GPIO) or a timer. Regarding the deep sleep mode, it minimizes energy consumption by keeping only the Real-Time Clock (RTC) and wake-up sensors active, which is the operating mode chosen for the proposed prototype. The Hibernation option has even lower power consumption than deep sleep, but all data associated with RAM is lost. For these reasons, the deep sleep operating mode was considered the most suitable for the proposed variant in this work, and this operating mode is exclusively available in the architecture that includes the M5Stack hardware ecosystem with the ESP32 board.
The pseudocode in the Steps.txt file from the
Supplementary Material calculates the parameter S, which reads the values of the coordinates ax, ay, and az from the MPU 6070 accelerometer. Subsequently, it calculates the magnitude of acceleration for each reading. A step is considered if the difference between the current reading and the previous one exceeds a predefined threshold (STEP_THRESHOLD).
The pseudocode in the Sleep_Phases.txt file from the
Supplementary Material calculates the DST and SST parameters. For the determination of DST and SST parameters, the authors propose that the system use data obtained from the MPU-6050 accelerometer. In the proposed algorithm, variations in the magnitude of acceleration on the three axes lead to a value that must be below a preset threshold (DEEP_SLEEP_THRESHOLD). The respective period is classified as deep sleep. If the calculated value falls between two predefined thresholds, it is considered shallow sleep (DEEP_SLEEP_THRESHOLD < acceleration < SHALLOW_SLEEP_THRESHOLD). The intervals are accumulated over a monitoring period, and the total time of each sleep phase is calculated in minutes. Threshold values can be studied in new research to be customized according to each user’s sleep quality.
The analog pin reads the battery voltage to calculate the battery level. This value is converted into an actual voltage relative to the analog-to-digital converter (ADC) reference. Subsequently, the measured voltage is mapped between the values of MIN_BATTERY_VOLTAGE (e.g., 3.0 V for a discharged battery) and MAX_BATTERY_VOLTAGE (e.g., 4.2 V for a fully charged battery). If the percentage exceeds 100%, it is set to 100%. If the value is below 0% (error or heavily discharged battery), the value is set to 0% (Battery_Level.txt file from the
Supplementary Material).
The analysis of threshold values is presented in the Results section, where the final values established in the algorithm and the method of their determination will be detailed.
2.3. Proposed Health Anomaly Detector Algorithm
Focusing on a single dataset facilitates the identification of trends specific to each individual. This approach reduces the complexity of analysis, allowing HADA to focus on human organism specificity for prompt medical interventions. This analysis must be personalized because each patient has different physiological characteristics and lifestyles, requiring the adjustment of alert thresholds based on individual reference values. Thus, a correct interpretation of the data is ensured, optimizing treatments and preventing complications through interventions tailored to the specific needs of each individual.
The authors chose this option due to its compatibility with Microsoft technologies. This choice was based on the native compatibility with the development environment used for the back-end, namely Visual Studio C#. A second reason stems from the ability to quickly implement anomaly detection models by accessing data from the Microsoft Azure infrastructure.
The steps of processing and training of HADA are schematically illustrated in
Figure 3 and described as follows:
The data is acquired from M5Stack and transmitted to Microsoft Azure via an API request. Subsequently, through an Azure Function, the data is preprocessed, centralized, and organized into a suitable format for model training.
The feature variables (AR, mR, MR, S, DST, and SST) are identified.
Unlike the data used in classification and clustering models, which is scaled and normalized to eliminate any potential disproportionalities that could negatively impact model training, the data is not altered in this case. This is a particularly important remark! It must be emphasized that the authors did not remove or modify the acquired data to avoid altering potential alerts.
The authors started the investigation by simultaneously examining all input parameters. Later, they also analyzed models with one input at a time. Additionally, various anomaly detection hyperparameters were evaluated for the Randomized PCA method. For each algorithm, hyperparameters were adjusted to identify the scenario with the best performance. Performance was determined based on standard AI model evaluation metrics. The algorithm with the best performance was selected for integration into HADA’s software pipeline.
After establishing the final HADA configuration, the model is integrated into a .NET application that runs on a local server in collaboration with Azure functionalities.
Implement the alert emission component to ensure the system responds with the lowest possible latency.
During the development of HADA, mechanisms for monitoring the model’s performance were implemented. It is noted that the model is periodically retrained for each individual separately, as physiological changes can occur in every person’s life due to aging, changes in medication, or other factors that cause alterations in the organism’s usual behavior. A concrete example in this regard is a scenario where an elderly person experiences a hip fracture. Their physical activity will not be the same for an extended period. Therefore, it is periodically adjusted to maintain an accurate record of the model’s performance in various usage scenarios.
2.4. Data Flow Architecture and Communication System
The data flow is designed such that, as soon as the M5Stack collects and preprocesses the data, it is transmitted via a secure Wi-Fi connection to Azure SQL Database through an ASP.NET API, as depicted in
Figure 4. Once received, the data is routed to a dedicated Azure Function, which retrieves the values, further preprocesses them, and passes them to the HADA model for evaluation. If the model identifies an anomaly, Azure Functions immediately triggers a set of automated actions:
Sending a notification to the alert system configured in Azure Notification Hubs;
Generating a Short Message Service (SMS) alert through Azure Communication Services;
Saving the incident in the database;
After the incident is evaluated, the person responsible for monitoring the patient deactivates the alert, intervenes, and generates an intervention report so it is precisely known whether it was an actual incident or a false alarm (as the patient may have disconnected the bracelet), but also to identify the employee who intervened in case of a medical error.
The UML diagram presented in
Figure 4 includes the patient level, corresponding to the system’s end user. He receives medical help in the event of anomalies and is subject to medical interventions when necessary. The wearable device collects vital data and transmits this data to the cloud infrastructure in real-time. As mentioned, this device features energy-saving capabilities, including a deep sleep mode. The cloud infrastructure ensures data transmission security through its mechanisms, preprocesses the data, transfers it to HADA, and generates alerts for patients or caregivers. HADA analyzes vital parameters using PCA, detects anomalies, and periodically updates the model to adapt to changes in patient conditions.
These conceptual steps are schematically presented in
Figure 5. For building the software pipeline, the Azure platform was chosen due to its multitude of features, which are necessary for managing a distributed monitoring system. Azure allows everything from data storage and processing to the automatic generation of alerts and workflow management. To achieve HADA integration, the following components were used:
Azure ASP.NET API for collecting data from M5Stack devices;
Azure Functions for serverless code execution, enabling rapid processing of received data and real-time generation of alerts;
Azure Notification Hubs and Azure Communication Services for distributing notifications to operators, supervisors, and the monitored person’s relatives based on the results of anomaly detection;
Azure SQL Database for storing the patient’s data history for subsequent system performance analysis.
To ensure the integrity and confidentiality of the data, communication between M5Stack and Azure is carried out through encrypted protocols (TLS/SSL). Additionally, access to Azure resources is protected by multi-factor authentication and strict access rights management. The system is designed to comply with the General Data Protection Regulation (GDPR), ensuring the anonymization of personal data and implementing rigorous backup and recovery policies in the event of incidents.
3. Results
This section disseminates the results obtained following the implementation and testing of the HADA system for monitoring elderly individuals. The data was collected over two years, and the analysis focused on anomaly detection and alert generation based on the monitored parameters: AR, mR, MR, S, DST, and SST.
3.1. HADA Proposed Prototype
M5Stack is a module that uses the ESP32 microcontroller (dual-core, 240 MHz). It features a two-inch LCD with a resolution of 320 × 240 pixels for real-time data visualization, and connectivity is achieved via Wi-Fi and Bluetooth for data transmission. The internal battery is a 1400 mAh Li-ion. Within this project, M5Stack is configured to collect data from an accelerometer and a pulse sensor, ensuring detailed monitoring of the elderly person.
Figure 6 presents the prototype in an extended form for demonstration purposes. The display was also used for presentation purposes. Since the display is a significant battery consumer, it is usually disabled.
The MPU-6050 Accelerometer and Gyroscope record acceleration and rotation on the three axes, Ox, Oy, and Oz;
The MAX30100 Pulse Sensor is an optical sensor that measures heart rate and blood oxygen levels. It is useful for measuring the user’s physiological parameters.
The architecture diagram presented in
Figure 7 illustrates the data flow of the IoT and cloud-based elderly health monitoring system. The IoT bracelet collects sensor data and transmits it to Azure IoT Hub. Next, the data is processed by Azure Functions and analyzed by the HADA. The results are stored in Azure SQL Database. Azure Notification Hubs and Azure Communication Services notify the caregivers in the event of an alert. This architecture ensures continuous monitoring. Using this architecture, the monitoring system alerts the caregivers.
Connecting the sensors directly to the M5Stack’s dedicated ports achieves their physical integration. The M5Stack device was programmed using the Arduino IDE development environment, with C/C++ as the primary language. The source code includes the implementation of the functions described earlier.
Several tests were conducted to evaluate battery life based on the measurement frequency and display activity. The obtained results are as follows:
When the measurement frequency is 1 s and the display is active, the battery life is approximately 1 h.
When the display was turned off, but the measurement frequency remained at 1 s, the battery life increased to approximately 4 h.
When the measurement frequency was reduced to 1 h, and display output was eliminated, the battery life increased to approximately 12 h;
The implementation of the energy-saving mode, using the esp_sleep_enable_timer_wakeup function to allow the ESP32 microcontroller to enter deep sleep mode between measurements, significantly impacted battery life. This increased battery life to 22 h, as the microcontroller consumed much less energy during inactive periods.
These results suggest that optimizing the measurement frequency and employing energy-saving techniques, such as deep sleep, can significantly extend battery life in a portable system.
3.2. HADA Development Dataset
The HADA was integrated using the C# programming language with the ML.NET tool. It was built for a single elderly person who wore a continuous monitoring bracelet for two years (between 1 January 2023 and 31 December 2024). The bracelet was worn almost constantly during this period, except when the user had to charge it or when it was not in use, such as during baths. Thus, monitoring was performed continuously for two years, resulting in 676 recordings.
The elderly individual was born on 24 October 1954 and was 68 years old at the start of the monitoring. From a medical history perspective, the individual underwent surgery in 2000 for a left frontoparietal meningioma, and the postoperative recovery was complete without sequelae. This information is important to understand the user’s health context throughout the monitoring period.
The SQL Server database contains three tables: the table for monitoring the parameters AR, mR, and MR, the table for monitoring the parameters DST and SST, and the table for monitoring the parameter S.
Figure 8 presents the frequency measurements: heart rate, DST, SST; and parameter S per day of the monitored patient.
For calculating the statistics used in building the model, the values for each day were summarized into a single value by calculating the minimum, maximum, and average for heartbeats, summing the number of steps, and directly taking the unprocessed values of DST and SST.
3.3. HADA Integrated into the Developed Model
Using HADA for the inputs AR, mR, MR, S, DST, and SST, the analysis examines the relationships among these variables, generating a model that is inaccessible to mathematicians or statisticians. The model analyzes values with different representation domains simultaneously. This is almost impossible for a human, who typically performs analyses only on individual values and, at most, can combine them afterward. For example, a specific behavior may be expected in one context (for one parameter) but be abnormal in another context (for another parameter). For instance, MR may be normal in sports but abnormal when accompanied by a low DST. Therefore, analysis in a multidimensional space (with multiple features) helps establish a dependency between parameters, also considering the specificities of the context for which the training is performed.
If each parameter were analyzed individually, then anomalies generated by correlations might be missed. For example, if SST is too low, AR is too high, and S is very elevated simultaneously, this behavior may indicate an anomaly that is not visible in the case of individual analysis. To address these situations, HADA uses a multidimensional anomaly model.
The algorithm for identifying anomalies is based on PCA. It is integrated into ML.NET under the name RandomizedPCA. The algorithm specializes in identifying the main directions of variation in a dataset. These directions are used to reduce the dimensionality of the data. Subsequently, those that determine the residual values are extracted. This determines a deviation from the principal component of the data. This is useful when you want to find observations that do not follow the general patterns of the data trend.
The HADA model was developed to identify anomalies in data collected from an elderly person using six features: AR, mR, MR, DST, SST, and S. In the case of PCA, there is no direct correlation with the number of neurons and layers, as PCA is a dimensionality reduction method rather than a neural network-based model.
The purpose of HADA is to detect anomalies in the monitoring data of elderly individuals, triggering alerts for caregivers to enable rapid intervention. Usually, the number of detected anomalies should be as low as possible. However, detecting many anomalies may indicate that the model is too sensitive, generating excessive false alerts, i.e., alerts that are not caused by real health issues. Conversely, this situation is still preferable. In the opposite case, detecting a few anomalies could mean that the model is not sensitive enough to identify real health problems or hazardous behaviors, putting the elderly person’s life at risk. For this reason, in the study of hyperparameter configuration, it is desirable to identify a larger number of anomalies, even if they are false.
For ensureZeroMean = TRUE,
Figure 9 shows that many of the combinations with rank = 1 identified a large number of anomalies (18). This could be useful in scenarios where we want to identify any sign of anomalies, but it might lead to too many alerts and false positives.
For ensureZeroMean = FALSE,
Figure 10 shows combinations with rank = 1 and rank = 2, detecting only 0 or 1 anomalies. This may indicate less sensitive performance and could reduce false alerts. However, it might also lead to missing important signs of health problems.
The seed q can influence decisions about when to trigger an alert. It helps balance the model’s sensitivity with alert precision. For example, a q that produces many false alerts could cause the model to generate constant warnings, which might be disruptive. On the other hand, a q that produces too few anomalies might result in real health problems of the elderly being overlooked.
A moderate number of anomalies is ideal in elderly monitoring. Most values for q (1–10) with rank = 1 and ensureZeroMean = TRUE led to detecting 18 anomalies, suggesting high sensitivity in anomaly detection. This behavior remains stable and consistent in the context of alert generation, and this hyperparameter configuration was subsequently used.
Regarding the final model hyperparameters, we chose a dimensionality reduction with a rank set to 6, meaning that the model retained all parameters in the analysis without discrimination. The model reports each parameter as a principal component for describing the data. This choice simplifies the model and helps prevent overfitting, but it could reduce the ability to capture the complex variability of the data. The parameter en-sureZeroMean was set to true, ensuring each feature has a mean of 0 before applying PCA. This way, we avoided distortions caused by scale differences between features. Additionally, we used a seed value of 1, ensuring the reproducibility of results to obtain the same results each time the model runs. This validates and enables comparison of the model’s performance on similar datasets. The parameter exampleWeightColumnName was set to null, considering all observations were treated equally without applying additional weights. The combination of these hyperparameters makes HADA a model capable of identifying anomalies specific to variations in AR, mR, MR, DST, SST, and S.
After processing the data, 18 anomalies were identified over the 2-year monitoring period. Of these anomalies, nine were false, meaning they were records that, although flagged as anomalies by HADA, did not represent a major health issue. The other nine anomalies were not major alerts but rather minor physiological changes that were easily explainable, such as the process of eliminating kidney stones. These changes did not require immediate medical intervention, but the user underwent surgery in 2025 to remove them. This suggests that HADA acts as a predictive component, with alerts indicating subtle changes in the monitored patient’s condition.
Figure 11,
Figure 12 and
Figure 13 mark the days HADA generated alerts (highlighted by the red vertical line).
Figure 11 presents the evolution of AR, mR, and MR regarding the detected anomalies, providing a clear visualization of the moments when the values of these indicators exceeded normal limits and were flagged as anomalies. Thus, HADA identifies changes by analyzing correlations between these parameters, enabling early detection of potential health issues. This visualization underscores the system’s capacity to monitor complex relationships among heart rate metrics, offering actionable insights for prompt medical interventions.
Figure 12 depicts the distribution of DST and SST associated with anomalies. This graph shows whether the anomalies were associated with changes in sleep behavior. These parameters are crucial for assessing overall sleep quality, as they reflect different stages of sleep. By monitoring these trends over time, the system can detect irregularities that might not be apparent when analyzing individual parameters alone. The results show that DST and SST exhibit fluctuations throughout the monitoring period, with occasional spikes or drops that trigger anomaly alerts. This underscores the importance of continuous monitoring to capture subtle changes in sleep behavior, which could indicate underlying physiological conditions or stressors affecting the elderly’s health.
Figure 13 presents the correlation between S and anomaly detection. This graph demonstrates fluctuations in daily physical activity levels, with some days showing significantly higher or lower step counts compared to others. These variations are likely influenced by factors such as routine activities, health conditions, or environmental changes. Notably, anomalies are detected during periods of unusually high or low step counts, highlighting HADA’s ability to identify deviations that may signal potential health issues or behavioral changes. By analyzing these trends, the system provides insights into the elderly individual’s mobility and overall physical activity, enabling timely interventions if necessary. This underlines the importance of continuous monitoring and anomaly detection in maintaining the health and safety of the elderly.
HADA was evaluated based on the specific metrics of AI models. Out of a total of 676 recordings, 9 anomalies were real (TP = 9), 9 anomalies were false (FP = 9), and 658 were classified as usual (TN = 658). Given the fact that only one person was monitored, who did not require emergency assistance, there were no undiagnosed real anomalies (FN = 0). Precision was identified with a value of 50%, recall was 100%, F1-Score was 33%, and accuracy was 98.5%. Although HADA has low precision, this does not mean that the system cannot be used in practice. It does, however, represent a starting point for exploring future research directions in automating the remote patient monitoring process at home.
In a network with a response time (ping) of 149 ms, a download speed of 138.31 Mbps, and an upload speed of 48.45 Mbps, the alert signaling occurred in 11 s and 46 milliseconds. This time provides a relative picture of the response speed offered by the Azure infrastructure, influenced by factors such as the patient’s internet speed and the speed at which the SMS is sent by the mobile phone operator, among others. This fast response time demonstrates the efficiency of the Microsoft Azure communication infrastructure, which can transmit information in a short interval, ensuring a prompt response for real-time monitoring. The SMS notification includes the patient’s phone number and address. The operator calls the patient so that the individual can confirm their health status. In the meantime, if the patient does not respond, a team is dispatched to the patient.
The tests presented in this results chapter have shown the efficiency of the Microsoft Azure infrastructure. These evaluations highlight how Azure’s capabilities ensure real-time intervention applications for patient monitoring. The low response times and consistent data transmission demonstrate Azure’s infrastructure reliability.
4. Discussion
The main results of the study indicate that the proposed IoT system, which combines a wearable bracelet equipped with an M5Stack module, MAX30100 and MPU-6050 sensors, and an anomaly detection algorithm based on PCA, demonstrated a sensitivity of 100% and an accuracy of 98.5% in the continuous monitoring of vital parameters for a patient over two years. The device utilizes a dual-core ESP32 microcontroller operating at a frequency of 240 MHz, a two-inch LCD screen with a resolution of 320 × 240 pixels, and a 1400 mAh battery. The energy consumption tests have highlighted that the best performance is achieved when the M5Stack module operates in deep sleep mode, resulting in a battery life of 22 h. This system transmits the data acquired from the sensors to the Azure cloud infrastructure, where it is stored in a Microsoft SQL Server database, preprocessed, and evaluated in real-time for the generation of automatic alerts.
The obtained results can be explained by the fact that the multidimensional analysis of the data (including heart rate, step count, and sleep quality) enables the identification of complex correlations between parameters, making it possible to detect even the most subtle physiological changes. Implementing energy-saving techniques, such as deep sleep mode, extended the device’s operational life, enhancing the system’s practical utility.
The research presented in this study represents a conceptual prototype for monitoring the health of elderly individuals through continuous data collection, anomaly detection, and real-time alert generation. While the system’s performance has been evaluated based on a single patient, the results provide valuable insights into the feasibility of such a system in a real-world production context. It is important to note that this study does not provide an exhaustive comparison with other AI methods or existing commercial wearable devices. Instead, it serves as a starting point for future research and development aimed at mass production.
The research demonstrates that the proposed solution is feasible and can offer practical benefits, such as real-time health monitoring and prompt caregiver alerts. While limited in scope, the current prototype has shown promising results in detecting anomalies in the monitored parameters. The precision and recall rates indicate that the system is sensitive to potential health issues, albeit at the cost of generating false positives. This trade-off is important when dealing with elderly individuals, as it prioritizes safety by erring on the side of caution.
These contributions are highly significant in elderly health monitoring, offering an innovative, non-invasive, personalized solution for early anomaly detection. Through the rapid interventions triggered by the alert system, serious medical complications can be prevented, thus contributing to improved quality of life and reduced pressure on healthcare systems.
Although PCA is not compared with other AI techniques like LSTMs, Random Forest, or Isolation Forest, it is worth noting that the choice of PCA was made based on its simplicity, ease of implementation, and suitability for anomaly detection in this particular use case. However, the future development of this system could include testing alternative AI models to further optimize its performance.
Similarly, the absence of comparisons with commercial wearable health devices such as Fitbit, Apple Watch, or Garmin should not detract from the significance of this research. These devices primarily focus on specific health metrics, such as heart rate and step count, but do not offer the same integrated anomaly detection and real-time alerting features tailored for elderly care as the HADA prototype. The proposed system aims to surpass conventional wearables by offering continuous, comprehensive monitoring of multiple physiological parameters and alerting caregivers to potentially critical changes in health conditions.
The authors acknowledge that the proposed prototype requires extensive testing, validation, and refinement for production deployment. The current work presents an initial concept rather than a fully developed production-ready system. The primary objective of this research is to introduce an IoT-based approach and highlight the feasibility of integrating AI, IoT, and cloud technologies for elderly health monitoring.
The proposed solution is a conceptual framework demonstrating how these technologies can be leveraged for continuous health assessment. While the current prototype provides a foundation for further development, future work should focus on extensive clinical trials and ensuring compliance with medical standards.
By presenting this model, the authors emphasize the potential of intelligent health monitoring systems in addressing the challenges of elderly care. The integration of AI enables personalized analysis, IoT devices facilitate real-time data collection, and cloud computing ensures scalability and accessibility.
In this research, the Azure platform was chosen due to its native integration capabilities with the development tools used, namely ASP.NET and ML.NET. Moreover, the platform offers the necessary advantages for the proposed application type, which aims to process data in real-time and generate automatic alerts. It is important to mention that the Azure platform is a proprietary platform, which involves a series of monthly costs, making it inaccessible to user categories with a limited budget. However, the platform demonstrates the proposed prototype’s ability to achieve its objectives. Alternative solutions to this platform include Amazon Web Services (AWS) Free Tier, which is a commercial solution with a free plan but limited in certain features, and Google Cloud Platform (GCP), which is also available for free but with limited features, ThingsBoard, which is free, or developing solutions locally.
In
Table 1, the alternative solutions are summarized along with a series of advantages and disadvantages. Most existing solutions are currently available in a commercial version, but there is also an open-source version, such as ThingsBoard, which implies no costs but requires advanced programming skills, resulting in similar overall solution costs.
Table 2 presents a cost simulation for the scenario of monitoring approximately 23 patients on the Azure platform. Thus, the monthly amount is approximately 18.62 USD per month, which a subscription can cover for the monitored patients.
Integrating cloud technologies with innovative data analysis methods represents an advancement in elderly health monitoring. Cloud-based solutions enable continuous data collection, real-time processing, and remote accessibility, allowing healthcare professionals to monitor patient status in real-time. This facilitates the early detection of health anomalies and reduces the need for emergency interventions.
Recent studies have demonstrated that cloud-integrated health monitoring systems contribute to improved patient outcomes by enabling predictive analytics and personalized healthcare plans. ML algorithms deployed in the cloud analyze vast datasets, recognizing trends and deviations indicative of potential health risks. This proactive approach enhances preventive care and supports timely medical decisions.
Moreover, cloud-based architectures provide scalability and flexibility, allowing integration with IoT-enabled sensors and wearable devices [
64]. This interconnected system ensures that elderly individuals receive tailored healthcare interventions based on real-time physiological data. Additionally, cloud platforms enhance data security and interoperability, addressing concerns related to patient privacy and compliance with medical standards.
Our proposed approach aligns with modern digital health initiatives by leveraging cloud technologies. This advancement underscores the potential of cloud-based health monitoring to revolutionize elderly care.
Integrating cloud computing with health monitoring opens new research directions in digital health. This study provides a framework for future research in personalized healthcare. The proposed methodology optimizes algorithms for real-time health assessment and anomaly detection. It also emphasizes the need for interdisciplinary collaboration between computer science, medicine, and data analytics to enhance predictive healthcare models.
From a practical perspective, our findings offer valuable insights for healthcare providers, policymakers, and technology developers. The proposed system enables remote and continuous patient monitoring, reducing the burden on healthcare facilities while ensuring timely medical interventions. This is particularly relevant for elderly care, where early detection of health deterioration can improve patient outcomes. The scalability of cloud-based solutions allows easy integration with wearable technologies and IoT devices, ensuring accessibility in various healthcare settings.
The study presents some methodological constraints associated with the evaluation conducted on a single subject, which limits the generalization of the results to larger populations. Therefore, the authors acknowledge that the model’s generalization has not been assessed. Although representative over the two years, the number of recordings may not cover all possible clinical variations. During the tests, the total number of aggregated daily records was 676. The number of raw records for the parameters AR, mR, and MR was 725,338, the number of records for the parameter S was 9455, and the number of records for the parameters DST and SST was 680. The patient’s age at the beginning of the monitoring was 69 years, as they were born in 1954.
The performance of the anomaly detection algorithm identified 18 anomalies. Of these, nine were real anomalies, and nine were false anomalies. Based on these values, the standard metrics were identified with the following scores: precision: 50%, recall: 100%, F1-Score: 33%, and accuracy: 98.5%.
The final model hyperparameters include Randomized PCA. Tests showed that detecting non-urgent anomalies is preferred to avoiding missing critical ones. The final hyperparameter configuration after tests is rank = 6, ensureZeroMean = true, seed = 1. Tests confirmed that detecting non-urgent anomalies is preferable to missing urgent events, ensuring robust patient monitoring.
The study’s focus on a single patient was intentional to keep the scope manageable and ensure a more controlled, detailed analysis. While it is true that results based on a single individual may not fully account for inter-individual variability, the findings serve as a proof of concept. Future iterations of the system can include larger datasets that encompass more diverse patients with varying age ranges, pre-existing conditions, and medications.
The detection of anomalies in physiological data is a widely studied topic. Traditional methods such as Isolation Forest and One-Class SVM have been used to identify deviations in vital signs. However, these methods are often sensitive to noise in real-time collected data. In this paper, PCA was investigated to analyze variations in data. The HADA uses Randomized PCA to demonstrate detection efficiency by integrating into an IoT-cloud infrastructure.
Table 3 presents the comparative analysis between the state-of-the-art and the HADA as a proof of concept. In
Table 3, NS indicates that the value is not specified.
In this research, the PCA method was integrated into the HADA to study the necessity of dimensionality reduction correlated with the identification of monitored physiological parameters, which contribute to the main objective of the study. By analyzing each parameter in isolation, it was demonstrated that subtle anomalies resulting from unitary monitoring cannot be detected. Tests conducted without using PCA resulted in an accuracy of less than 90%. In comparison, the use of PCA within the HADA model resulted in an accuracy of 98.5%. This value demonstrates that the simultaneous and contextual analysis of all variables improves anomaly detection.
HADA balances accuracy and response time compared to existing methods. Although the model presented by Ebadinezhad and Mobolade [
56] achieves 100% accuracy, it requires 16.3 s of processing time and an exclusively cloud-based infrastructure, which limits its use in IoT systems. In contrast, HADA offers 98.5% accuracy with a processing time of 3.5 s. This makes the PCA model more suitable for applications that require a quick response.
Compared to RNN-based methods (Autoencoder and LSTM-CNN), HADA offers competitive performance without requiring high computational resources. Although Autoencoder is extremely fast (3 ms), it requires Edge Computing infrastructure, which is challenging to implement in standard IoT solutions. In contrast, the algorithm integrated into HADA can run on an IoT and cloud architecture, reducing response time without affecting anomaly detection.
Lastly, the concern regarding the system’s precision and the possibility of false alarms is valid. However, it is important to understand that the system’s high recall rate and sensitivity ensure that no health issues are left undetected. As we continue to refine the system, future work could focus on improving the precision, potentially through more advanced anomaly detection techniques and by incorporating real-world testing with larger populations.
The authors chose to generalize the HADA using modern techniques represented by synthetic data. This is justified by the need to continuously monitor a large number of elderly people over a long period, at least one year. This would also require their declaration regarding consent for data use, as was performed with the real dataset presented earlier. Moreover, the present research does not represent a clinical study but rather a hardware–software prototype that can be developed for production with specific implications for medical protocols. Any medicated device must undergo a series of standard stages before it can be used and is not the subject of the present research.
As mentioned, synthetic data was added to the tests to generalize the model. Thus, six datasets were introduced for six elderly individuals. The synthetic data were generated according to the values in the specialized literature. For elderly individuals without specific heart conditions, the normal heart rate range is between 60 and 100 beats per minute (bpm). This value is influenced by factors such as medication, hypertension, heart disease, or other stress factors [
65]. Additionally, elderly individuals experience changes in sleep architecture, according to the study conducted by Hwang et al. [
66]. Thus, elderly people spend 10–15% of the total 7–8 h in deep sleep. Superficial sleep corresponds to a more extended period and is associated with the first two stages of sleep. Therefore, out of the total 7–8 h of sleep, an elderly person spends, on average, 1–2 h in deep sleep and 4–5 h in shallow sleep [
67,
68].
Regarding regular physical activities, the general recommendation for the elderly is at least 150 min of moderate to intense aerobic activity per week. This corresponds to 7000–8000 daily steps for a healthy older adult [
69].
Considering these observations, the six experimental datasets were generated according to the standard values. Each dataset contains 1000 synthetic data points. Of the 1000 data points, 30% contain intentionally generated anomalies to simulate an emergency. According to the literature, the anomalies correspond to exceedances of the values considered normal. These observations generated six experimental datasets based on typical values. Each dataset contains 1000 synthetic data points. Of the 1000 data points, 1% contain intentionally generated anomalies to simulate an emergency. According to the literature, the anomaly corresponds to exceedances of the values considered normal. The methodology used for generating synthetic data is as follows:
For each of the six datasets, 99% of records were generated to comply with the standard limits for all parameters:
AR has values between 60 and 100 bpm;
mR has a lower value than AR but above 60 bpm;
MR has a value greater than AR but less than 100 bpm;
S—between 6000 and 9000;
DST—between 20 and 120 min;
SST—between 240 and 300 min.
To simulate atypical situations, 1% of records were generated with values that exceeded the normal limits in the literature. In each case, only one column was modified. In this way, a single anomaly is reflected by generating values outside the normal range. The standard and abnormal records were randomly mixed to prevent artificial grouping of the data. This ensures that the model learns a realistic distribution of the data. This approach also prevents the model from learning the positions of anomalies. Finally, the six datasets, each file containing 1000 rows, were saved in text format and used to validate the HADA.
Figure 14 presents the accuracy results obtained for executing the HADA using the six synthetic datasets. These results confirm that the model achieves an accuracy of over 98%. The values obtained through the generalization of tests confirm HADA’s capacity for early anomaly detection. This behavior helps prevent medical complications.
The results presented in
Figure 14 confirm that the HADA can be used in real-world scenarios. The authors state that the model cannot be validated for production using such a small number of cases. However, this research does not represent a clinical study but rather a demonstration of integrating an anomaly detection algorithm into a modern cloud infrastructure, represented by the Azure tool suite.
From the Results section, the answers to the RQs stated in the introduction are as follows:
RQ1. The study demonstrates that the Microsoft Azure infrastructure is compatible with implementing a continuous monitoring system for the vital parameters of elderly individuals. This solution uses an integrated data stream that connects IoT sensors to Azure cloud services via ASP.NET APIs. The data collected from the MAX30100 sensors (for heart rate monitoring) and MPU-6050 (for step count and sleep quality) is transmitted in real-time to Azure IoT Hub, where it is processed using Azure Functions. The HADA, implemented in C# using the ML.NET library, analyzes the data via the PCA method to identify anomalies. The results are stored in an Azure SQL Database, and alerts are automatically generated through Azure Communication Services, which sends SMS notifications to the medical staff. The tests conducted showed that the average alert time is approximately 11 s. These results demonstrate HADA’s ability to provide support to the elderly through the proposed hardware–software configuration.
RQ2. The implementation of the HADA demonstrates that PCA is an appropriate method for anomaly detection in vital parameter monitoring. The algorithm simultaneously analyzes six key parameters: average heart rate (AR), minimum heart rate (mR), maximum heart rate (MR), number of steps (S), time spent in deep sleep (DST), and time spent in light sleep (SST). HADA uses Randomized PCA from the ML.NET library to reduce the dimensionality of the data. This process allows for the detection of complex correlations between parameters, providing a multidimensional analysis that would not be possible through the individual examination of each parameter. The test results show that HADA achieves an accuracy of 98.5% in anomaly detection. For model validation, synthetic datasets were introduced to simulate generalized scenarios. These sets contain normal values and values that exceed the standard limits for vital parameters. Tests conducted on this synthetic data have confirmed that HADA maintains an accuracy of over 98%. These values demonstrate HADA’s ability to be applied in real-world scenarios.
RQ3. The wearable device highlighted the ability to detect subtle changes in health status. This aspect highlights the feasibility of these proof-of-concept systems for use in early interventions that can prevent medical complications. The proposed wearable device, based on the M5Stack module, integrates the MAX30100 and MPU-6050 sensors to collect vital data continuously. The device utilizes the ESP32 microcontroller, which operates at a frequency of 240 MHz and is programmed using the Arduino IDE environment and the C++ programming language. To optimize energy consumption, the M5Stack module is configured to enter deep sleep mode between measurements, thereby extending the battery life to 22 h. Tests conducted over two years have shown that the device can detect subtle changes in the patient’s health, such as abnormal increases in heart rate or significant decreases in sleep quality. These anomalies are identified using the HADA, which generates real-time alerts. The study reported a sensitivity of 100% and an accuracy of 98.5%. These values highlight the feasibility of this conceptual system for preventing medical complications.
Research of this nature requires ongoing funding, which becomes accessible after the proof of concept is published. Once the idea is publicly demonstrated and validated, attracting the necessary financial support for further development and scaling becomes easier.
The HADA system provides a strong foundation for further exploration into elderly care and health monitoring, demonstrating the viability of real-time, data-driven interventions, with the proposed infrastructure never investigated before in the literature. While this research does not claim to offer a fully mature commercial product, it provides a promising solution that can be further developed with appropriate funding and support. With additional testing, optimization, and comparisons to alternative methods, this system could be invaluable in enhancing the quality of care for elderly individuals. The authors believe that, with the right investment, this solution has the potential to make a significant impact in the field of remote health monitoring.