Skip to Content
DiagnosticsDiagnostics
  • Article
  • Open Access

24 September 2026

27 Pages

Proactive Prediction of Alarms in Hemodialysis Machines: A Comparative Evaluation of AI Models for Clinical Prognostic Support

,
,
,
,
,
and
1
Dipartimento di Ingegneria, Università degli Studi di Palermo, Viale delle Scienze Ed. 6, 90128 Palermo, PA, Italy
2
Dipartimento di Ingegneria Elettrica, Elettronica e Informatica, Università di Catania, Via Santa Sofia 64, 95123 Catania, CA, Italy
3
Mozarc Medical®, Via Camurana 1, 41037 Mirandola, MO, Italy
*
Author to whom correspondence should be addressed.

Abstract

Background/Objectives: Hemodialysis is a treatment for patients with kidney disease, yet it remains risk-prone due to potential technical or physiological instabilities. Dialysis machines rely on reactive safety mechanisms that trigger alarms only when predefined thresholds are reached. This often alerts clinical staff only after a complication has already occurred, contributing to potential delays in interventions. This study aims to develop a proactive prognostic framework capable of anticipating system instabilities before they transform into clinical adverse events. Methods: This work proposes a predictive approach for the proactive detection of patient- or process-related alarm conditions using ten machine learning models and one deep learning architecture. A dataset consisting of over two million records sampled at 0.5 s intervals from 95 dialysis sessions was assembled by merging machine logs of sensor readings and the binary machine status (alarm/normal). Results: Among the models tested, Random Forest emerged as the most robust predictive tool, achieving an F1 score higher than 0.85 for predicting alarms up to one minute in advance, with precision (~0.83), recall (~0.87), specificity (~0.99), AUROC (~0.99), and AUPRC (~0.94) values indicating strong performance, and stable performance across validation and test sets. A progressive decrease in performance was observed for longer prediction time windows. Conclusions: These findings demonstrate the feasibility of predicting dialysis-machine-generated alarms in advance using machine learning and deep learning models. Providing advance warning could give clinicians the opportunity to anticipate impending alarm conditions and, where appropriate, implement timely corrective actions, potentially improving treatment management and the operational reliability of renal replacement therapies.

1. Introduction

One of the major health problems in modern society is renal insufficiency, a condition in which blood flow to the kidneys is reduced due to renal artery disease. This impairment in kidney function affects more than 7 million people worldwide [1], for whom the only life-saving treatments available are renal replacement therapies or kidney transplantation.
In this context, the present section provides the background and motivation for the study presented in this manuscript. Specifically, it first presents an overview of renal replacement therapies and their operating principles, then reviews recent research on the application of Artificial Intelligence (AI) in dialysis, and finally introduces the aims and scope of the work, emphasizing its novelty and expected impact within the broader context of predictive healthcare.

1.1. Renal Replacement Therapies: A General Overview

Renal replacement therapies represent the standard treatment modalities for patients with kidney failure and primarily include hemodialysis (HD), hemofiltration (HF), and hemodiafiltration (HDF).
HD is a therapy that uses a semipermeable membrane to separate two fluids: the patient’s blood, which contains toxins that the kidneys can no longer effectively remove, and a solution rich in electrolytes and glucose called dialysate. Through diffusion across the membrane, low-molecular-weight solutes (up to ~500 Da) such as urea and creatinine are eliminated, while essential components, including proteins and blood cells, are retained [2].
There are variants of hemodialysis, including HF and HDF, which differ in the mechanisms they use to remove waste products and excess fluids from the blood. HF relies solely on the convective removal of uremic toxins. Unlike standard hemodialysis, HF does not use dialysate; instead, it employs a pressure gradient to filter out excess fluids and solutes with medium to high molecular weights (in the range of 500 to 15,000 Da). To maintain stable blood volume and electrolyte balance, replacement fluids are introduced either before (pre-dilution) or after (post-dilution) the blood passes through the filtration unit. HDF combines the mechanisms of both hemodialysis and hemofiltration, allowing for the efficient removal of fluids and solutes across a broad range of molecular weights (larger than 15,000 Da). This dual approach more closely replicates the kidneys’ natural filtration function, making HDF the most widely used technique in renal care [3].
Despite the differences among the three above-mentioned membrane-based blood purification techniques, the term “hemodialysis” will be used throughout the paper to refer to all three treatments interchangeably.
The semipermeable membrane is housed inside hemodialyzers, cylindrical modules typically a few centimeters in diameter and about 20–30 cm in length [4]. The hemodialyzers work within dialysis machines, which are sophisticated systems managed by trained medical staff in a hospital setting. All dialysis machines share some essential features, including a wide range of sensors and pumps that precisely control and monitor the treatment process. Among the monitored variables, particular attention is given to key parameters such as blood pressure, protein retention, and urea clearance efficiency, the latter being a crucial indicator of dialysis performance [5].
Figure 1 reports a schematic of the dialysis circuit along with indications of the main sensors in the machine.
Figure 1. Schematic of the hemodialysis circuit, showing the main components of the extracorporeal blood and dialysate circuits. The numbered elements indicate: (1) blood leakage detector sensor; (2) ultrafiltrate pressure sensor; (3) pre-blood pressure sensor; (4) pre-blood pump; (5) substitution pumps (pre- and post-filter); (6) substitution pressure sensor; (7–8) dialysate pressure sensors (pre- and post-pump); (9) dialysate pump; (10) dialysate and substitution fluid heater; (11) return pressure sensor; (12) air removal chamber; (13) air pressure sensor in the blood line; (14) safety clamp on the return line; (15) access pressure sensor; (16) blood pump; (17) pre-filter pressure sensor; (18) anticoagulant syringe pump; (19) load cells for dialysate, substitution, and ultrafiltrate bags; (20) ultrafiltrate pump.
Nevertheless, dialysis treatment carries several risks, resulting from technical issues or sudden changes in the patient’s condition. To reduce these risks, modern dialysis systems are complex cyber-physical systems equipped with an array of sensors monitoring pressure, flow, and temperature to ensure the safety and efficacy of the treatment. Advanced control systems and alarm mechanisms notify medical personnel and can automatically interrupt the procedure if necessary [6,7]. Currently, safety in dialysis is managed through a reactive paradigm. Alarms are triggered by anomalies such as abnormal blood pressure, temperature fluctuations, irregular heart rate, blood leakage, or malfunctions in the machine’s ultrafiltration, degassing, or fluid delivery systems. However, one limitation of these safety systems is that, although they are designed with intervention margins to protect the patient, they are still triggered only once predefined physiological or systemic thresholds are reached. As a result, alarms often alert medical staff only after a complication has already begun to manifest. Furthermore, the high frequency of these threshold-based alerts contributes to “alarm fatigue” among clinical staff, potentially leading to delayed responses to critical events. These limitations highlight a significant gap in current medical diagnostics: the lack of proactive tools with prognostic capabilities for anticipating instabilities before they reach a critical threshold. The need for more advanced monitoring and predictive strategies capable of anticipating potential issues before they occur is a goal that recent developments in AI have increasingly aimed to address.

1.2. Artificial Intelligence in Hemodialysis

Since the last century, the use of AI techniques and its subfields, Machine Learning (ML) and Deep Learning (DL), has sparked a paradigm shift in biomedical engineering [8], by enabling the analysis of complex, non-linear datasets that characterize modern healthcare.
Within the broader field of renal medicine, AI-based approaches have been increasingly explored for different diagnostic and predictive applications. In this regard, Neha and Bansal [9] have recently proposed a radiology–radiomics fusion-based deep learning framework for the non-invasive classification of malignant renal cell carcinoma subtypes, combining radiomic and deep imaging features to support automated diagnostic discrimination. This study provided a representative example of the growing use of AI-based methods in kidney-related applications, achieving a validation accuracy of 96.70% and a test accuracy of 97.3% for the classification of three major renal cell carcinoma subtypes.
Focusing specifically on hemodialysis, recent research has predominantly focused on patient-centered prognostic models designed to predict acute intradialytic complications, with the aim of optimizing clinical outcomes, particularly in patients whose health is severely compromised. Among the most frequent challenges during dialysis sessions are hemodynamic instability, such as fluctuations in blood pressure and fluid volume, as well as adverse effects including muscle cramps and nausea. These complications can significantly impact both treatment efficacy and the patient’s overall health status, highlighting the need for proactive, data-driven strategies. In this context, Ren et al. [10] analyzed over 67,000 dialysis sessions using ten different ML algorithms for predicting intradialytic hypotension and intradialytic hypertension, achieving high predictive performance (Area Under the Curve, AUC, up to 0.89) for both conditions. With a more sophisticated approach, Li et al. [11] predicted the same parameters employing an explainable model, which is useful for interpreting the influence of clinical variables. Specifically, using 46,000 dialysis sessions of 193 patients, the authors achieved an overall accuracy exceeding 85% and determined that blood pressure before dialysis, age, and difference between the sodium levels in the blood and in the dialysis fluid were the most important risk factors. While these models achieve high predictive accuracy, they often rely on static clinical variables or low-frequency physiological data, which may fail to capture the rapid, transient fluctuations within the extracorporeal circuit that precede clinical instability.
Other applications have addressed specific dialysis-related diagnostic challenges, such as assessing vascular health [12] or fluid status [13].
For example, Zhang et al. [12] developed sophisticated deep neural networks to analyze the sounds produced by Arteriovenous Fistulas (AVFs) in hemodialysis patients with the goal of detecting stenosis, a narrowing of the blood vessel that can lead to serious complications. The model was trained on sound recordings from over 800 patients and used visual representations of these sounds to identify patterns linked to healthy or narrowed fistulas. Thanks to a combination of advanced techniques, the system identified cases of stenosis with 99% accuracy, outperforming previous similar approaches [14,15] and improving vascular access management.
Niel et al. [13] developed a multi-layer neural network to support dry weight assessment, a process that traditionally relies on clinical judgment and can be highly variable. Their model integrated multiple clinical indicators and outperformed experienced nephrologists in most cases.
Another use of AI algorithms in the dialysis field regards the prediction of the outcome of the therapy, days, months, or years later, with the aim of analyzing patients’ clinical conditions and anticipating possible future complications, up to death. For example, Motofelea et al. [16] conducted a systematic review comparing various ML models for predicting mortality in hemodialysis patients. The study evaluated models such as Logistic Regression (LR), Extreme Gradient Boosting (XGBoost), and Random Forest (RF), showing that AI-based approaches can closely approximate real-world mortality rates. Among these, the XGBoost model estimated a mortality rate of 9.93%, compared to an observed rate of 13.73%, highlighting the potential of AI models to support early identification of high-risk patients.
Furthermore, the prediction of distressing symptoms, such as emesis during hemodialysis, a complication that can lead to early termination of the session and reduced treatment efficacy, has been explored by Chen et al. [17]. Using data from 281 patients and applying a regression model, parameters such as sex, height, heart rate, lymphocyte count, and lactate dehydrogenase levels were identified as the most relevant predictors of this condition, potentially supporting the implementation of timely preventive strategies.
However, a common limitation in these studies is their focus on the biological outcome rather than the dialysis machine that mediates the treatment. By the time a patient-centered symptom (like vomiting or hypotension) is predicted or detected, the window for simple preventive adjustment may already be closing. A distinct branch of research focuses on system-oriented monitoring. In a recent paper, Xie et al. [18] proposed a neural network model for the visual recognition of alarm lights on dialysis machines. It offered a non-invasive method for real-time monitoring of machine status, indirectly contributing to the prevention of vascular complications by enabling early detection of operational anomalies. However, this study focuses on real-time alarm recognition, which differs from the predictive maintenance perspective explored, for example, by Rahman et al. [19]. After comparing several ML algorithms with a DL model, the ensemble classifier achieved the best performance in optimizing the utilization of critical medical devices and minimizing their downtime. The model analyzed data, collected by fifteen hospitals in Malaysia, from 8,294 medical devices including multiparametric monitors, ventilators, diagnostic imaging equipment, life support systems, and infusion pumps. The study evaluated mechanical, electronic, calibration, system, and power failures, predicting the probability of device failure within three years with an accuracy of up to 79.50%, a significant achievement considering the diversity and complexity of the devices and potential failure modes.
While innovative, these approaches remain reactive, as they merely automate the recognition of an alarm that has already been triggered. This highlights a critical gap in the literature: the lack of systems capable of leveraging high-frequency machine telemetry to anticipate these alarms before they reach a critical threshold.

1.3. Aim of the Work

Current dialysis safety mechanisms are hindered by threshold-based logic, which contributes to “alarm fatigue” and delayed intervention. The present study addresses this scientific gap in clinical alarm prediction in dialysis, by treating alarms as early indicators of patient- or process-related complications during treatment. By utilizing a dataset of over two million records sampled at a high resolution of 0.5 s, the proposed framework is conceived as a prognostic-support tool. It was designed to anticipate the possible onset of such events by exploring different model families and prediction time spans, with the aim of providing operators with earlier information that could support timely intervention and the safe continuation of therapy.
The proactive prediction of alarms remains underexplored [20]. This approach distinguishes itself from the existing literature by treating machine-generated alarms not as static events to be filtered or recognized, but as predictable states that can potentially be anticipated with a clinically meaningful lead time. This methodological approach may also be applicable to a wide range of clinical and industrial monitoring scenarios, such as intensive care monitoring, mechanical ventilation, cardiac arrhythmia detection, or extracorporeal support systems [21,22]. These perspectives highlight the potential broader relevance and versatility of the proposed framework beyond the specific application investigated, with the need for further prospective validation to demonstrate its actual clinical benefit.

2. Methods

This section describes the methodological framework adopted in this study. Specifically, it is structured into three main parts, including the description of the dataset, the pre-processing and feature selection procedures, and the implementation and evaluation of the AI models developed for the prediction task, from which the best-performing model was selected for further analysis.

2.1. Description of the Dataset

Data from chronic dialysis therapies performed with hemodialysis equipment were used. All treatments were delivered using five dialysis machines of the same model, manufactured by Mozarc Medical® (Modena, Italy) and used for extracorporeal renal replacement therapy in adult patients under routine clinical practice. Specifically, this equipment includes pressure transducers monitoring arterial, venous, pre-filter, and transmembrane pressures; flow and pump encoders that measure dialysate delivery, ultrafiltration, and blood-pump activity; conductivity and temperature sensors assessing dialysate composition and thermal balance; as well as safety sensors such as air and foam detectors and venous-clamp status indicators.
In a regular working day, considering the time between 8 a.m. and 8 p.m., each machine performs a maximum of two treatments per day generating for each session a set of ten files identified by a unique ID code. These files provide detailed information on the treatment parameters selected for the patient, the machine’s operating phases during the dialysis session, and the quantities measured by the sensors monitoring the process. They do not contain any patient-specific information, such as gender, age, medical history, or identifying details which, even if available, would not have been relevant for the aim of our study, which focuses on detecting deviations in machine-monitored parameters rather than optimizing individual treatments. In addition, as the files reflect only the chronological order of treatments performed, without distinguishing whether multiple sessions belong to the same patient, in this study data were grouped by the date of the treatment rather than by individual patient.
For the implementation and evaluation phase, four months of therapies were considered, all performed using the same dialysis machine model to ensure a consistent acquisition protocol across the treatments.
Python® 3.11 and its scientific libraries were used for data processing and model development. Namely, “NumPy” (version 1.26.4) and “pandas” (version 2.2.3) for representing the input data in vectorial form, “scikit-learn” (version 1.5.2) for the training phase, and “Matplotlib” (version 3.9.2) and “seaborn” (version 0.13.2) for analyzing the results. The models were implemented on a workstation equipped with an Intel® CoreTM i7-6700 CPU and 32 GB of DDR4 RAM (Intel Corporation, Santa Clara, CA, USA).
Training was performed on data recorded during each treatment by the same type of dialysis machine. The data were assembled into a file comprising records of 95 hemodialysis treatments which, although limited in number, cover a substantial temporal span and provide a detailed and representative description of the selected machine’s operating behavior.
In this unified dataset, each row contains measurements of the patient’s vital parameters, regular sampling of the machine’s internal parameters, records of the operator’s manual actions, and the binary machine status (alarm/normal) as recorded by the machine monitoring system. This study relies on an extended version of the dataset used in our earlier work [23], here expanded to 93 variables and 2,586,776 rows acquired every 0.5 s of treatment. Among these, the “type” and “code” columns are particularly important, as they reflect the progression of the therapy and indicate the presence or absence (“type”, binary variable) and the specific category (“code”) of any patient- or process-related issues, such as abnormal flow rates, deviations in body temperature or heart rate, blood loss, and other physiological or systemic abnormalities. Although our predictive model focuses exclusively on the prediction of the binary information provided by the “type” column, Table 1 reports the main alarm monitoring systems and the corresponding conditions that trigger an alarm.
Table 1. Patient- and process-related monitoring systems and the corresponding alarm conditions representing the positive class (“type” = alarm) in the dataset.
As a complementary and more detailed characterization of the binary alarm endpoint, Table S1 in Supplementary Materials reports the distribution and functional classification of all individual machine-generated alarm codes included in the dataset, providing context on the types of events considered.
In order to formalize the predictive problem, a discrete time variable t was introduced, defined as t = n × 0.5 s (with n ∈ N, where N denotes the set of natural numbers). In other words, each row in the dataset corresponds to a measurement taken every 0.5 s, so that n rows represent a time span of n/2 s. The dataset is therefore represented as a time series of 93 parameters sampled at these discrete intervals, with the last column y(t) denoting the machine’s operational status at time t. Consequently, each row is regarded as a complete observation of the system and is treated as a time sample of the machine parameters in the rest of the paper.
Figure 2 shows a simplified representation of a small portion of the dataset, highlighting in red the last column “type” with the binary output y(t).
Figure 2. Two portions of the 93 columns from the model training file. On the left, first columns of the training file: the red box surrounds the “dmstate” column, identifying the treatment phase. On the right, last columns of the training file: in the red box, the column “type” identifies the machine’s binary status (alarm/normal). Each row in the dataset corresponds to a measurement taken every 0.5 s.

2.2. Dataset Pre-Processing and Model Implementation

The dataset was filtered to include only the dialysis treatment phase (dmstate = 4), as the study focused specifically on the patient treatment process. Other operational stages of the machine, such as preparation, washing, and post-treatment cleaning, were excluded to ensure consistency and relevance for model development.
The p-value was calculated to assess the statistical significance of the relationships between the variables studied, whether they can be attributed to random variation [24]. The general formula that describes the p-value is defined as:
p - value = P ( o b s e r v a t i o n | H 0 t r u e )
where H 0 is the null hypothesis, o b s e r v a t i o n is the actual value from the data collected in the study to compare with the null hypothesis, and p - value is the probability of obtaining the observation assuming that the null hypothesis is true. If the p-value is low, it means that the observation is highly unlikely under the null hypothesis, which suggests that the null hypothesis can be rejected.
Therefore, low p-values (usually less than 0.05) indicate that the observed result is unlikely if the null hypothesis is true. This leads to the rejection of the null hypothesis. On the contrary, high p-values indicate that the observed data is compatible with the null hypothesis, so there is insufficient evidence to reject it. In this work, a p-value < 0.05 was found for all the features, indicating statistically significant associations between the variables under investigation.
After this preliminary analysis, ten machine learning models were tested and evaluated for predicting the selected output type. To optimize training and enhance performance, hyperparameter tuning was performed for each model using “RandomizedSearchCV” [25], a method provided by “scikit-learn” in Python® that evaluates multiple hyperparameter configurations by randomly sampling combinations from a predefined search space.
Each machine learning model underwent ten randomized hyperparameter trials on a development set comprising 70% of the treatment sessions, with each configuration evaluated using 5-fold cross-validation. Both the initial dataset partitioning and the cross-validation folds were defined at the treatment-session level, ensuring that all samples belonging to the same treatment were assigned exclusively to the same subset or fold. This strategy prevented information leakage between training, validation, and test data arising from the strong temporal correlation among consecutive measurements within the same treatment session [26]. In addition to these conventional models, a deep learning model was also tested using the same 5-fold cross-validation approach, adopting a setup commonly used in the literature [27] as a benchmark for comparison.
From the residual 30% of the dataset, 15% was held out as a validation set, used to independently evaluate the best configuration identified for each machine learning model and the selected deep learning model, and to assess their ability to generalize to unseen data. Finally, the remaining 15% was reserved as a final testing set and used exclusively to evaluate the selected best-performing model after model selection. The 70-15-15 split between training, validation, and testing sets was adopted as it is a commonly used strategy in machine learning, particularly for large datasets, as it provides a balanced trade-off between model optimization and unbiased performance evaluation [28].
For completeness, the robustness of the selected partition was further assessed by repeating the analysis using 60-20-20 and 80-10-10 training/validation/test splits. Although the overall performance remained of the same order across the different configurations, measurable differences were observed in the main performance metrics, with relative variations generally below 5% and reaching up to 10% in the least favorable cases. On this basis, the 70-15-15 partition was retained as the most appropriate compromise for the present analysis.
To further refine the dataset before training the model and reduce its dimensionality, a feature selection process was implemented, preserving the input variables that were most informative for predicting the target output. This step is aimed at enhancing model interpretability and generalization while minimizing the risk of overfitting, which is particularly important when dealing with large or high-dimensional datasets, such as the one used in this study [29].
The selection process began with a model-independent filter method called “SelectKBest”, a well-known feature selection technique from the “scikit-learn” library that selects the top k features based on univariate statistical tests [30]. In this case, the scoring function used was “mutual_info_classif” [31], a non-parametric measure which estimates the mutual information between each feature and the target variable for classification tasks. Being well-suited to capturing both linear and non-linear relationships, it has proven effective for mixed datasets containing both numerical and categorical variables, with the latter numerically encoded in this study using the pandas function “Categorical”. Specifically, “normal” and “alarm” in the “type” column were coded with “0” and “1”, respectively.
Mutual Information (MI) scores were computed for each pre-processed feature with respect to the binary target variable “type”, and the top 35 features with the highest MI scores were selected. The threshold of 35 was chosen because this subset explained approximately 95% of the total mutual information observed across all input variables, providing a strong balance between model simplicity and predictive power.
Table 2 reports these 35 variables, ranked in descending order of their MI score with respect to the target column (“type”), together with a brief description of their meaning and physical significance.
Table 2. List of the 35 features selected through the Mutual Information (MI)-based feature selection using the SelectKBest method. Variables are ranked according to their MI with respect to the target column (“type”), and each description summarizes their technical or physical meaning.
Following feature selection, an additional decorrelation step was performed to remove redundant features. Using Pearson’s, Spearman’s, and Kendall’s coefficients [32], the correlation between all variables, in groups of two denoted by subscript X and Y , was studied.
The Pearson coefficient ρ X Y relates the covariance and the standard deviation of the variables. It is defined as:
ρ X Y = σ X Y σ X σ Y
where σ X and σ Y are deviations relative to X and Y variables, respectively, and σ X Y their covariance.
The Spearman coefficient θ X Y is calculated by applying the Pearson formula to the ranked variables R ( X ) and R ( Y ) , according to the formula reported below:
θ X Y = σ R ( X ) R ( Y ) σ R ( X ) σ R ( Y )
where σ R ( X ) and σ R ( Y ) represent the standard deviation relative to the ranked variables R ( X ) and R ( Y ) , and σ R ( X ) R ( Y ) their covariance.
The Kendall coefficient τ X Y evaluates how similar the ordering of the data is between the two variables and is less sensitive to errors, but particularly effective for small sample sizes. Its formulation is given by:
τ X Y = 2 ( C − D ) n ( n − 1 )
where C is the number of concordant pairs (i.e., pairs where the order of X matches the order of Y ), D is the number of discordant pairs (i.e., pairs where the order of X and Y do not match), and n is the number of observations.
The above coefficients take values in the range between −1 (perfect negative correlation) and +1 (perfect positive correlation). The value “0” indicates an absence of correlation.
It is worth noting that the correlation analysis was conducted only on the numerical features, as correlation coefficients are not meaningful for variables represented through numerical category codes. A threshold of 0.90 was used to detect potential redundancy. In cases where any pair exceeded this threshold, the feature with the lower mutual information score was to be removed. However, the correlation analysis revealed that none of the selected features exhibited a correlation coefficient above 0.90 under any of the three metrics. Consequently, all 35 features originally selected based on mutual information and reported in Table 2 were retained.
Regarding the input data used for prediction, the vector x(t) was considered, whose components correspond to the 35 selected columns of the dataset, sampled at a specific time t. The machine status prediction type at a future time t + ns + Δt was then generated by analyzing a window of consecutive vectors ns, i.e., y(t + ns + Δt) = f([x(t), x(t + 1), … x(t + ns − 1)]), as schematically represented in Figure 3.
Figure 3. Graphical representation of the prediction model. The number of steps ns is the number of rows known at the time the model makes the prediction (ns = 2 rows in the figure). The predictive time window Δt is the number of rows between the current and future condition to be predicted (Δt = 3 rows in the figure). Each row in the dataset corresponds to a measurement taken every 0.5 s.

2.3. Models Tested and Performance Metrics

A detailed description of each model evaluated for outcome prediction, together with the main hyperparameters (configuration parameters defined before training) available for its tuning [33], is provided below.
Temporal Convolutional Network (TCN) is a deep learning architecture designed to model sequential dependencies in temporal data [27], replacing traditional recurrent connections with causal and dilated one-dimensional convolutions. This allows it to capture both short- and long-range temporal patterns efficiently without the vanishing gradient issues common in recurrent neural networks. Key hyperparameters include the number of convolutional layers (n_layers) and filters per layer (n_filters), which determine the network’s representational capacity; the kernel size (kernel_size), which controls the temporal receptive field; the dilation rate (dilation), which governs the spacing of convolutional filters for each network layer to extend the effective memory of the model; and the dropout rate (dropout), which regularizes the network and mitigates overfitting. Attention mechanism enables neural networks to dynamically highlight the most informative parts of their input by indicating how much “attention” the model should pay to each element. This improves both the network’s predictive performance and its interpretability.
k-Nearest Neighbors (kNN) is a non-parametric, instance-based learning algorithm that classifies samples based on the majority class among their k closest neighbors in the feature space [34]. Distance is typically computed using metrics such as Euclidean or Manhattan distance. The model’s simplicity and interpretability make it effective for small datasets and low-dimensional spaces, though its performance can degrade with high-dimensional or noisy data. Key hyperparameters include the number of neighbors (n_neighbors), which controls the size of the local neighborhood used for prediction and the step interval used for this selection; the weight function (weights), which determines whether all neighbors contribute equally or are weighted by distance; and the distance metric (metric), which defines how similarity between samples is measured.
Random Forest (RF) model is an ensemble method that aggregates the predictions of multiple decision trees, each trained on a random subset of the training data and features, a process known as bootstrap aggregation (bagging) [35]. This randomness reduces variance and improves generalization compared to a single decision tree, which is often prone to overfitting. Key hyperparameters include the number of trees (n_estimators), which controls ensemble size and stability; the maximum depth of trees (max_depth), which regulates model complexity; the minimum number of samples required to split a node (min_samples_split) and per leaf (min_samples_leaf), both of which influence tree granularity; and the number of features considered at each split (max_features), which balances randomness and predictive strength.
Extremely Randomized Trees (Extra Trees) algorithm follows a similar approach but chooses split thresholds at random rather than optimizing them, which increases diversity among trees [36]. This often leads to faster training and reduced overfitting, though sometimes at the cost of slightly higher bias. Key hyperparameters include the number of learners (n_estimators); their maximum depth (max_depth); the minimum number of samples required to split a node (min_samples_split) and per leaf (min_samples_leaf); and the number of features considered at each split (max_features).
Adaptive Boosting (AdaBoost) is a boosting algorithm that builds an ensemble of weak learners, typically shallow decision trees (stumps). Each learner is trained sequentially, with greater weight assigned to previously misclassified samples, forcing subsequent learners to focus on harder cases [37]. This process reduces bias but may increase variance. Its main hyperparameters are the number of weak learners (n_estimators); the learning rate (learning_rate), which scales the contribution of each learner; and the boosting algorithm (algorithm), which determines how weights are updated.
Histogram-based Gradient Boosting (HistGB) is an ensemble learning method that builds decision trees sequentially, where each new tree is trained to correct the errors (residuals) of the previous ensemble. It minimizes the gradient of a specified loss function, which makes it flexible and powerful for a variety of tasks. In this implementation, continuous features are discretized into histograms (bins), which reduces computational cost and memory usage while maintaining predictive accuracy [38]. Its main hyperparameters include the number of boosting iterations (max_iter), which defines the total number of trees added sequentially to the ensemble; the learning rate (learning_rate); the maximum depth of trees (max_depth); and an L2 regularization term (l2_regularization) that helps limit overfitting.
Extreme Gradient Boosting (XGBoost) is a powerful and regularized implementation of the gradient boosting framework, designed for high scalability [39]. It builds upon the same underlying approach as HistGB, but introduces additional features such as shrinkage, column subsampling, and regularization to combat overfitting. Key hyperparameters include the number of boosting rounds (n_estimators); the learning rate (learning_rate); the tree complexity (max_depth); and the subsampling ratio (subsample), which specifies the fraction of training data randomly sampled to grow each tree, helping to reduce overfitting and enhance generalization.
Light Gradient Boosting Machine (LightGBM) is another gradient boosting framework optimized for speed and memory [40]. It uses a leaf-wise growth strategy instead of level-wise, which allows capturing more complex interactions but increases risk of overfitting if not constrained. Main hyperparameters include the number of trees (n_estimators); the learning rate (learning_rate); the tree depth (max_depth); and the number of leaves (num_leaves), which directly controls tree complexity.
Logistic Regression (LR) is a simple model that estimates the probability of class membership using the sigmoid function [41]. It is interpretable, efficient, and robust for linearly separable data, but limited for non-linear relationships. Its hyperparameters include the regularization strength (C), which controls the trade-off between model complexity and overfitting; the penalty type (penalty), that helps limit overfitting; and the solver (solver), which defines the optimization strategy.
Ridge Classifier (RC) is a linear model that minimizes squared errors with an L2 penalty [42]. As main hyperparameters, it includes the solver (solver); and the regularization parameter (alpha), that tunes the penalty strength to prevent overfitting.
Multi-Layer Perceptron (MLP) is a feed-forward artificial neural network composed of an input layer, one or more hidden layers, and an output layer [43]. Each neuron computes a weighted sum of inputs followed by a non-linear activation function, allowing the model to approximate complex non-linear relationships. In terms of hyperparameters, its architecture is determined by the size of the hidden layers (hidden_layer_sizes), that specifies the number and size of hidden layers for each layer; the learning rate (learning_rate_init), that controls how weights are updated; and the choice of activation function (activation), that strongly influences learning capacity. Although flexible, MLPs may require large datasets and careful tuning to avoid overfitting.
Table 3 summarizes the tuned hyperparameters and the corresponding search ranges considered for each model [44,45], in accordance with the tuning procedure outlined in Section 2.2.
Table 3. Summary of the compared models, tuned hyperparameters, and corresponding search ranges. For each model, ten random configurations were evaluated from all possible combinations. Model acronyms are listed in the Abbreviations section.
In addition, to address the class imbalance between the two possible machine status outcomes (“normal” and “alarm”), the parameter class_weight = “balanced” was applied in all classification models. Specifically, the balancing is a procedure that automatically adjusts the weight of each class inversely proportional to its frequency in the training data, thereby mitigating bias toward the majority class. This ensures that misclassifications of the minority class are penalized more heavily during training, improving the model’s ability to detect alarm states without compromising overall performance.
The comparison among the models was based on the F1 score, which was adopted as the reference metric for the overall evaluation of model performance. Additional complementary metrics were also considered to provide a more comprehensive characterization of classifier behavior: recall (or sensitivity or True Positive Rate (TPR)) to assess the ability to correctly detect alarm events, specificity and False Alarms per treatment hour (FA/h) to quantify incorrect alarm generation under normal operating conditions, and the Area Under the Receiver Operating Characteristic Curve (AUROC) and the Area Under the Precision-Recall Curve (AUPRC) to evaluate the discriminative ability of the models across different classification thresholds.
Since several of the performance metrics considered in this study are derived from the classification outcomes, it is first useful to introduce the confusion matrix [46], which summarizes correctly and incorrectly classified samples according to their actual and predicted classes along the primary and the secondary diagonal, respectively. In particular, True Positives (TP) correspond to alarm-related samples correctly classified as positive, whereas True Negatives (TN) represent normal samples correctly classified as negative. Conversely, False Positives (FP) are normal samples incorrectly classified as alarms, while False Negatives (FN) are alarm-related samples incorrectly classified as normal.
Based on these quantities, F1 score is defined as:
F 1   score   = 2 · Precision · Recall Precision + Recall
where in turn Precision and Recall are defined, respectively, as:
Precision = True   positives True   positives + False   positives
Recall = True   positives True   positives + F alse   negatives
Specifically, F1 score is a useful performance metric when class imbalances are present in the dataset [47]. Its value varies between 0 and 1, indicating poor and excellent performance, respectively.
Precision expresses the fraction of samples predicted as alarms that are actually associated with an alarm event, whereas recall quantifies the fraction of actual alarm-related samples that are correctly detected by the classifier. The latter is particularly relevant in the present study, since alarm-related samples represent the minority class [46]. It ranges between 0 and 1, with higher values indicating a lower occurrence of false negatives.
In addition, specificity was considered to complement recall by evaluating the ability of the classifier to correctly recognize negative instances [46]. In the present context, it therefore measures the capability of the model to correctly identify operating conditions not associated with an impending alarm. Specificity ranges between 0 and 1, with higher values indicating fewer false-positive predictions, and is defined as:
Specificity = True   negatives True   negatives + F alse   positives
While F1 score, recall, precision, and specificity are computed for a given classification threshold, AUROC provides a threshold-independent measure of the ability of the classifier to discriminate between positive and negative instances, describing the relationship between the TPR and the False Positive Rate (FPR) [48], that is the complementary metric of specificity. AUROC ranges between 0 and 1, with a value of 0.5 corresponding to discrimination equivalent to random classification and values approaching 1 indicating increasingly effective discrimination.
The AUPRC instead summarizes the trade-off between precision and recall across different classification thresholds. This metric is particularly informative for imbalanced classification problems, as it focuses directly on the performance achieved on the positive class [48]. Higher AUPRC values indicate a greater ability of the classifier to detect positive instances while limiting false-positive predictions.
Finally, FA/h were considered as an application-oriented metric to quantify the practical burden associated with incorrect alarm predictions during treatment. Unlike sample-based metrics such as specificity, this metric accounts for distinct false-alarm episodes and normalizes their occurrence by the total treatment duration, providing a more intuitive indication of how frequently unnecessary alarms may be generated under real operating conditions [49]. A false-alarm episode was defined as a continuous sequence of consecutive false-positive predictions within the same treatment session, so that consecutive false-positive samples were counted as a single event. The metric was defined as:
F A / h   = Number   of   false   alarms   episodes Total   treatment   duration
where a value of zero false alarms per treatment hour represents the ideal condition of absence of erroneous alarm episodes during the treatment.
For each parameter and configuration, the standard deviation was also computed to account for variability across cross-validation folds, and based on the overall performance obtained from this comparative analysis, the best-performing model was then selected for further evaluation and analysis.

3. Results

This section presents the results obtained in this study. Specifically, it is organized into two main parts: the first compares the performance of all the tested models to identify the most accurate one; the second one analyzes the sensitivity of the selected model to variations in the main temporal parameters, providing a comprehensive evaluation of its predictive robustness.

3.1. Performance Comparison

Table 4 reports the hyperparameter settings of the best-performing configuration identified for each machine learning algorithm through 5-fold cross-validation, together with the fixed configuration adopted for the deep learning model.
Table 4. Hyperparameter values associated with the best configurations per model. Model acronyms are listed in the Abbreviations section.
Table 5 summarizes the predictive performance of each best configuration in terms of F1 score, precision, recall, specificity, AUROC, AUPRC, and FA/h, with each metric reported as mean ± standard deviation.
Table 5. Mean ± standard deviation (std) of 5-fold cross-validation performance for the best model configurations. Model acronyms are listed in the Abbreviations section.
Specifically, these results correspond to an initial setting with a time window of Δt = 20 rows and ns = 10 rows, adopted as a baseline configuration to be later expanded once the optimal model among the tested settings had been identified. The value ns = 10 rows was chosen as it represents the minimum sequence length required to capture sufficient historical context, across a diverse set of clinical and machine-derived inputs, and to provide the model with a coherent and informative representation of the patient–machine interaction prior to prediction. In parallel, the time window Δt = 20 rows represents a reasonable lower bound, as it ensures a minimal interval for effective intervention before the alarm is triggered. As a consequence, it was chosen as the critical threshold below which the opportunity to respond to early warning signs becomes limited. Tested on the 15% of the data held out as a hold-out validation set, the DL model and the best configuration for each ML model identified during hyperparameter tuning yielded the performance metrics reported in Table 6.
Table 6. Performance metrics achieved by the best configuration per model, as identified through hyperparameter tuning, evaluated on a hold-out set equal to 15% of the entire dataset. Model acronyms are listed in the Abbreviations section.
Here, the models achieved results consistent with those observed in cross-validation, reinforcing the robustness of the comparative analysis, with Random Forest emerging as the most reliable approach. It is worth noting that the Extremely Randomized Trees algorithm also achieved competitive results, both in 5-fold cross-validation (Table 5) and in the validation phase (Table 6). However, a limitation of the Extra Trees model emerged in terms of recall. Specifically, Extra Trees achieved an average recall of approximately 0.93 across the 5-fold cross-validation and ~0.92 in the validation phase, compared with ~0.97 and ~0.95, respectively, for Random Forest. A similar, although less pronounced, difference was observed in terms of precision, with Extra Trees reaching ~0.98 across the 5-fold cross-validation and ~0.97 in the validation phase, while Random Forest achieved values close to 0.99 and 0.98, respectively. Consequently, Extra Trees showed a larger imbalance between precision and recall, indicating a greater tendency to miss positive alarm samples despite maintaining a low number of false positive predictions.
This difference was also reflected in the overall classification performance. Random Forest achieved a higher F1 score (~0.98) than Extra Trees (~0.95), and although both approaches showed nearly perfect discrimination in terms of AUROC (~0.99 for Random Forest and ~0.98 for Extra Trees), Random Forest also provided a slightly higher AUPRC (~0.98 vs. ~0.96), which is particularly relevant given the marked class imbalance characterizing the dataset.
Importantly, the superiority of Random Forest was also evident from an operational perspective, with an average of 0.73 FA/h for Random Forest compared with 0.91 FA/h for Extra Trees. Specifically, lower FA/h indicates a reduced burden of unnecessary warnings during treatment, which is particularly relevant for the practical deployment of an alarm-prediction system.
Overall, Random Forest therefore provided the most favorable compromise between alarm recall, precision, class-imbalance-aware performance, and false-alarm burden. Given the importance of correctly anticipating true alarms while simultaneously limiting unnecessary warnings, it was adopted as the reference model for the subsequent analyses presented in the following section.

3.2. Parametric Sensitivity Assessment

The results reported in Table 5 and Table 6 show that the Random Forest classifier achieved the best performance, combining high predictive accuracy with consistent results across hyperparameter settings. Consequently, it was used to perform a parametric study aimed at assessing the sensitivity of its best-performing configuration to variations in key input Δt (and Δts, equal to Δt expressed in seconds) and ns.
The detailed values of all performance metrics derived from the sensitivity analysis of the Random Forest classifier, obtained using the remaining 15% of the dataset not used in any previous stage, are shown in Table 7.
Table 7. Performance metrics of the Random Forest (RF) classifier for different predictive time windows and sequence lengths, evaluated on the 15% test set. Δt is the number of rows between the current and predicted future condition; Δts represents the corresponding prediction horizon, expressed in seconds. ns indicates the number of consecutive rows available to the model at the time the prediction is made. Rows correspond to measurements acquired every 0.5 s. Metric acronyms are listed in the Abbreviations section.
Specifically, Table 7 shows the trend of F1 score, precision, recall, specificity, AUROC, AUPRC, and FA/h obtained by the model as a function of Δt (and Δts) for each ns considered. Values of ns equal to 10, 20, 30 and 40 rows, and Δt of 20, 50, 80, 120 and 150 rows (corresponding to Δts equal to 10, 25, 40, 60, and 75 s, respectively), were taken into account.
In terms of overall predictive performance, increasing the sequence length ns did not provide a consistent improvement across the evaluated classification metrics, although longer sequences generally resulted in a modest reduction in FA/h. A clearer trend was observed with increasing prediction horizon Δt, which was generally associated with a progressive deterioration in F1 score, precision, recall, and specificity, together with lower AUROC and AUPRC values. At the same time, FA/h consistently increased as the prediction horizon was extended, reflecting the greater difficulty of generating reliable warnings further in advance.
Based on these results, the configuration with a prediction horizon of Δt = 120 rows and a sequence length of ns = 10 rows was identified as providing the most favorable trade-off between prediction anticipation and classification performance. Specifically, this configuration allows alarms to be anticipated potentially up to one minute in advance while maintaining satisfactory predictive performance, with an F1 score of approximately 0.85, together with a specificity of ~0.99, an AUROC of ~0.99, and an AUPRC of ~0.94.
Although shorter prediction horizons yielded higher classification performance, the additional anticipation provided by the 60 s horizon was considered to outweigh the moderate loss in predictive accuracy. Furthermore, the relatively short sequence length (ns = 10) limits the computational burden, supporting the suitability of this configuration for real-time implementation.
For this specific scenario, the confusion matrix is represented in Figure 4.
Figure 4. Confusion matrix obtained with Δt = 120 rows (where Δt is the number of rows between the current and future condition to be predicted) and ns = 10 rows (where ns is the number of rows known at the time the model makes the prediction). The matrix refers to 15% of the total dataset used as the test set, and each row of the analysis corresponds to a measurement taken every 0.5 s.
For the test dataset, 15,607 true positives were identified out of 17,856 alarms, with 3173 false positives and 2249 false negatives.
Although direct comparisons should be interpreted with caution because of differences in alarm definitions, datasets, prediction targets, sampling frequencies, and evaluation protocols, these results can be contextualized with respect to related applications in hemodialysis. For instance, Wang and Xu [50], using a Random Forest model to predict hemodialysis alarm events, reported a recall of 72.30% and a precision of 68.90%, compared with the recall of ~87% and precision of ~83% obtained here for the 60 s prediction horizon. Similarly, Xie et al. [18] reported a precision of 89.20% and a recall of 81.30% for Convolutional Neural Network (CNN)-based recognition of dialysis-machine alarms, although their approach addressed alarm recognition rather than advance prediction.
In the related context of real-time prediction of intradialytic hypotension, Zhang et al. [51] reported that a false-positive rate of 10% was considered clinically and operationally acceptable by healthcare professionals, corresponding to a recall of 65% and a specificity of 90%. For comparison, the present model achieved a sample-level false-positive rate of 0.86% at the 60 s prediction horizon, corresponding to a relatively limited false-positive burden at the sample level.
However, since the dataset is sampled every 0.5 s, unlike the approximately 30 min intervals in Zhang et al. [51], sample-level metrics do not directly reflect distinct alarm occurrences. Indeed, an alarm episode may include multiple consecutive alarm-labeled samples, while consecutive false-positive predictions may correspond to a single false warning from an operational perspective. Therefore, to provide a more clinically and operationally meaningful assessment of the selected configuration (Δt = 120 rows and ns = 10 rows), an additional event-level analysis was performed. Specifically, the proportion of distinct alarm episodes successfully anticipated, and the distribution of prediction lead times were evaluated. The corresponding results are reported in Table S2 of the Supplementary Materials.

4. Discussion

In this section, the results presented previously are discussed in order to provide an interpretation and to analyze their main implications.
First, the comparative performance of the tested models presented in Section 3.1 is examined, with particular emphasis on advantages and disadvantages of each model. Subsequently, the effects of the main temporal parameters on predictive performance are analyzed, considering the configuration presented in Section 3.2.

4.1. Model Performance Analysis

As shown in Section 3.1, Table 5 and Table 6 report the performance of the best configuration for each model tested. Among the tree-based ensemble methods, Random Forest and Extremely Randomized Trees achieved the highest F1 score, but the greater importance of recall over precision for this task, together with the more favorable FA/h values, led to the selection of Random Forest as the best model. Specifically, although in medicine both false positives and false negatives are clinically relevant, as the former can lead to unnecessary actions and the latter may result in missed event, in binary classification studies, recall is typically prioritized over precision. A higher recall represents a more conservative approach that reduces the likelihood of missing positive cases, especially in real-world operation, where rare but critical adverse events must be detected reliably despite their low frequency.
Regarding neural models, approaches such as the Multi-Layer Perceptron and the Temporal Convolutional Network with Attention exhibited consistent yet inferior results. Specifically, although the TCN architecture is designed to capture temporal dependencies and the attention mechanisms to focus on relevant temporal patterns, their performance was likely constrained by the pronounced class imbalance and the limited number of alarm samples [52]. In such conditions, deep architectures tend to bias toward the majority class, which could explain the performance gap observed with respect to ensemble-based approaches. Moreover, the increased network complexity of the TCN and MLP models, characterized by a large number of trainable parameters, may have induced overfitting, preventing the networks from generalizing on unseen samples.
k-Nearest Neighbors and boosting-based models, such as Adaptive Boosting, Histogram-based Gradient Boosting, Extreme Gradient Boosting, and Light Gradient Boosting Machine showed solid but comparatively lower performance, which may be partly attributable to their more limited ability to handle highly imbalanced datasets [53]. Finally, models such as Logistic Regression and the Ridge Classifier achieved comparatively lower performance across the evaluated metrics, reflecting their limited capacity to model complex, non-linear relationships within the patient–machine interaction data [54].
However, when considered as a whole, the concordance observed among the independent dataset partitions suggests that the models did not overfit to specific folds but rather captured reproducible patterns. This stability across cross-validation folds represents a strong indicator of model consistency and further supports the robustness of the comparative analysis.

4.2. Effect of Temporal Parameters on Model Performance

The parametric study shown in Table 7 illustrates an overall decrease in performance as Δt increases, while increasing ns did not provide a consistent performance benefit.
At first sight, increasing the sequence length should allow the model to capture temporal dynamics of the machine status and thus enhance prediction. However, this effect is not observed, most likely because the most informative data lies in the most recent samples, while more distant observations contribute little to the prediction. Moreover, longer input sequences introduce a higher number of features, which increases the dimensionality of the problem and makes the classification task more complex. At the same time, extending the input window often incorporates redundant or noisy samples. This cumulative noise dilutes the relevant precursors of the alarm event, ultimately reducing or keeping constant the discriminative power of the model.
On the contrary, the decrease in model performance as Δt increases is intuitive since anticipating alarms further in advance introduces greater uncertainty, with the current system state becoming less directly connected to the future alarm. As a result, predictive patterns weaken, and both precision and recall decline.
Specifically, the reduction in most performance metrics appears to be gradual for shorter predictive horizons, but becomes much more pronounced beyond Δt = 120 rows, consistently across all values of ns investigated. This behavior suggests that, up to a certain horizon, the system state still retains a sufficient connection with the upcoming alarm, allowing the model to extract useful predictive cues. Once Δt exceeds this threshold, however, the temporal distance between input features and the alarm event becomes too large, and the predictive signal rapidly deteriorates. Consequently, the model’s discriminative ability drops sharply, leading to a steeper decline in performance observed beyond Δt = 120 rows.
Based on these considerations, the configuration having Δt = 120 rows and ns = 10 rows was identified as the most balanced, as shown by the parametric study presented in Section 3.2.

4.3. Limitations of the Work

Despite the promising results, this study presents some limitations that should be acknowledged.
First, the dataset was collected from a single type of hemodialysis machine and includes a limited number of treatment sessions. Although the dataset is large in terms of temporal resolution and covers a substantial monitoring period, this constraint may limit the generalizability of the findings to other devices, clinical settings, or patient populations.
Second, the predictive task focused exclusively on the binary detection of alarm occurrence, without distinguishing among different alarm types. While this choice simplifies the problem and is clinically relevant for early intervention, it does not exploit the full informational content of the available alarm codes, which could provide more targeted and actionable predictions.
Moreover, the strong class imbalance inherent to alarm prediction represents an intrinsic challenge. Although class weighting strategies were applied and recall-oriented evaluation criteria were adopted, rare alarm events remain difficult to model, particularly for longer prediction horizons. This limitation was reflected in the progressive performance degradation observed as Δt increased.
Finally, the selected Random Forest model treats past observations as independent feature vectors, without explicitly modeling temporal dependencies. While this approach proved effective for short- and medium-term prediction, it may limit performance for longer anticipation times, suggesting that more advanced architectures could further improve long-range predictive capability.

5. Conclusions

In this study, an AI-based predictive tool for early alarm detection in dialysis treatments was developed, with a focus on anticipating machine-generated alarms that may reflect patient- or process-related complications. By exploiting data collected from hemodialysis equipment and applying a Random Forest classifier, the proposed model achieved high predictive performance (F1 score of 0.85 for Δts = 60 s) and proved capable of providing clinicians with valuable anticipation time before alarms were triggered.
The results showed that short predictive windows combined with relatively small input sequences offered the most effective compromise between accuracy and robustness. In particular, a configuration with Δt = 120 rows and ns = 10 rows allowed the model to predict alarms up to one minute (Δts = 60 s) in advance, achieving good overall performance and showing promising potential for future clinical application, although prospective validation would be required to assess its impact on alarm burden and patient safety.
Nevertheless, the lack of a clear improvement in performance for larger ns values and the degradation for larger Δt values reflect, respectively, the time-independent nature of tree-based models and the progressive weakening of the correlation between inputs and outputs as the temporal gap increases.
Furthermore, the results demonstrated that conventional machine learning architectures remain, for the time being, more computationally efficient than deep learning architectures for well-defined classification tasks based on structured data. This advantage stems primarily from their ability to effectively capture interactions among variables, while requiring fewer data and computational resources than are generally needed to fully exploit the potential of deep neural networks.
However, future work will investigate more sophisticated and carefully optimized DL models beyond the TCN evaluated in this study, with the aim of determining whether they can outperform machine learning for this specific task, while extending the predictive horizon and maintaining high accuracy.
Additionally, efforts will be directed toward enabling the identification of the specific type of alarm, in addition to its occurrence, as this represents another variable (“code” column) available in the dataset.
Further studies should assess the scalability of the model across hardware and clinical settings, as well as its performance on larger, external, and multi-center datasets, to ensure robustness and practical applicability. In particular, although the computational burden appears compatible with the real-time deployment, the relatively limited number of treatment sessions and devices considered in the present study may not fully capture the variability associated with different dialysis machine models, patient populations, and clinical centers. Future validation should therefore involve larger and more heterogeneous datasets collected across multiple devices and institutions to evaluate the generalizability of the model under diverse operating and clinical conditions.
All together, these advances could drive the integration of the proposed system into existing clinical workflows and the evolution toward smarter dialysis systems, where AI-based predictive tools may support earlier identification of impending alarm conditions, reduce unplanned interruptions, and improve the overall reliability of treatment delivery.

Supplementary Materials

The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/diagnostics16193095/s1, Table S1. Distribution and functional classification of machine-generated alarm codes included in the binary alarm endpoint; Table S2. Alarm-type-specific event-level performance of the selected Random Forest (RF) configuration (Δt = 120 rows and ns = 10 rows). Reference [55] is cited in the Supplementary Materials.

Author Contributions

Conceptualization, A.N., N.C., M.P., F.S., I.T., M.S. and A.C.; methodology, A.N., N.C., M.S. and F.S.; software, A.N., I.T. and M.S.; validation, A.N., N.C., I.T. and M.S.; formal analysis, N.C., M.P., F.S. and A.C.; investigation, A.N., M.S. and N.C.; resources, A.C.; data curation, A.N., M.P. and F.S.; writing—original draft preparation, A.N.; writing—review and editing, N.C., M.P., F.S., I.T., M.S. and A.C.; visualization, A.N. and N.C.; supervision, M.P., I.T. and A.C.; project administration, A.C.; funding acquisition, A.C. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by a Ph.D. studentship funded by Mozarc Medical® company, Mirandola (MO), and the Piano Nazionale di Ripresa e Resilienza (38-033-20-DOT1420214-3771), DM 352 M4C2 I. 3.3—Assegnazione di nuovi dottorati triennali in programmi dedicati ai dottorati innovativi che rispondano ai bisogni di innovazione delle imprese.

Institutional Review Board Statement

Ethical approval was not required for this study as it does not involve human participants, clinical records or biological materials. The research is strictly limited to the computational analysis of anonymous technical logs and hardware alarm signals generated by hemodialysis machines, provided by the manufacturer for algorithm development. In accordance with EU Regulation No. 536/2014 and GDPR Recital 26, this type of non-clinical, technological research on industrial data is fully exempt from Ethics Committee or Institutional Review Board review.

Data Availability Statement

The codes presented in this study are openly available on GitHub at the following link: https://github.com/alessianicosia/Treatment_alarm_prediction.git (accessed on 15 September 2026). The dataset used in this study is private and can be accessed upon request.

Conflicts of Interest

Michele Passerini and Francesca Sau were employed by the Mozarc Medical®. All authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Abbreviations

AdaBoostAdaptive Boosting
AIArtificial Intelligence
AUCArea Under the Curve
AUPRCArea Under the Precision-Recall Curve
AUROCArea Under the Receiver Operating Characteristic Curve
AVFArteriovenous Fistula
CNNConvolutional Neural Network
DLDeep Learning
Extra TreesExtremely Randomized Trees
FA/hFalse Alarms per treatment hour
FPRFalse Positive Rate
HDHemodialysis
HDFHemodiafiltration
HFHemofiltration
HistGBHistogram-based Gradient Boosting
kNNk-Nearest Neighbors
LightGBMLight Gradient Boosting Machine
LRLogistic Regression
MIMutual Information
MLMachine Learning
MLPMulti-Layer Perceptron
RCRidge Classifier
RFRandom Forest
stdstandard deviation
TCNTemporal Convolutional Network
TPRTrue Positive Rate
XGBoosteXtreme Gradient Boosting

References

  1. Lv, J.-C.; Zhang, L.-X. Prevalence and Disease Burden of Chronic Kidney Disease. Adv. Exp. Med. Biol. 2019, 1165, 3–15. [Google Scholar] [CrossRef] [Scilit]
  2. Ronco, C.; Cruz, D.N. Hemodialysis: From Basic Research to Clinical Trials; Karger Medical and Scientific Publishers: Basel, Switzerland, 2008. [Google Scholar]
  3. Cancilla, N.; Gurreri, L.; Ciofalo, M.; Cipollina, A.; Tamburini, A.; Micale, G. Mathematical Modelling of Hollow-Fiber Haemodialysis Modules. Phys. Sci. Rev. 2025, 10, 11–50. [Google Scholar] [CrossRef] [Scilit]
  4. Poh, C.K.; Hardy, P.A.; Liao, Z.; Huang, Z.; Clark, W.R.; Gao, D. Effect of Flow Baffles on the Dialysate Flow Distribution of Hollow-Fiber Hemodialyzers: A Nonintrusive Experimental Study Using MRI. J. Biomech. Eng. 2003, 125, 481–489. [Google Scholar] [CrossRef] [Scilit]
  5. Murdeshwar, H.N.; Anjum, F. Hemodialysis. In StatPearls; StatPearls Publishing: Treasure Island, FL, USA, 2024. [Google Scholar]
  6. Dong, Z.; Fuentes, L.R.; Rao, S.; Kotanko, P. Closed Loop Ultrafiltration Feedback Control in Hemodialysis: A Narrative Review. Toxins 2024, 16, 351. [Google Scholar] [CrossRef] [Scilit]
  7. Sooriamoorthy, D.; Anandan, S.; Manoharan, A.; Sivanesan, S.; Alexander, C.H.C.; Selvaperumal, S.K.; Narendran, R. Hemodialysis Dialysate Temperature Control System. AIP Conf. Proc. 2024, 3161, 020067. [Google Scholar] [CrossRef] [Scilit]
  8. Rawas, S. AI: The Future of Humanity. Discov. Artif. Intell. 2024, 4, 25. [Google Scholar] [CrossRef] [Scilit]
  9. Neha, F.N.U.; Bansal, A.K. Radiology–Radiomics Fusion-Based Deep Learning Framework for Malignant Renal Cell Carcinoma Subtype Classification. In Proceedings of the Intelligent Computing; Arai, K., Lorenz, P., Eds.; Springer Nature: Cham, Switzerland, 2026; pp. 305–321. [Google Scholar] [CrossRef] [Scilit]
  10. Ren, Z.; Zhang, M.; Wang, P.; Chen, K.; Wang, J.; Wu, L.; Hong, Y.; Qu, Y.; Luo, Q.; Cai, K. Research on the Development of an Intelligent Prediction Model for Blood Pressure Variability during Hemodialysis. BMC Nephrol. 2025, 26, 82. [Google Scholar] [CrossRef] [Scilit]
  11. Li, Z.; Hao, S.; Shi, S.; Li, L.; Tao, Z. An Explainable Machine Learning Model for Early Warning of Hypertensive and Hypotensive Anomalies in Maintenance Hemodialysis Patients. BMC Nephrol. 2025, 26, 318, Correction in BMC Nephrol. 2025, 26, 515. [Google Scholar] [CrossRef] [Scilit]
  12. Zhang, J.; Zhang, R.; Shu, X.; Zhang, H. Classification of Arteriovenous Fistula Sounds Using a Convolutional Block Attention Module and Long Short-Term Memory Neural Network. Front. Physiol. 2024, 15, 1397317. [Google Scholar] [CrossRef] [Scilit]
  13. Niel, O.; Bastard, P.; Boussard, C.; Hogan, J.; Kwon, T.; Deschênes, G. Artificial Intelligence Outperforms Experienced Nephrologists to Assess Dry Weight in Pediatric Patients on Chronic Hemodialysis. Pediatr. Nephrol. Berl. Ger. 2018, 33, 1799–1803. [Google Scholar] [CrossRef] [Scilit]
  14. Ota, K.; Nishiura, Y.; Ishihara, S.; Adachi, H.; Yamamoto, T.; Hamano, T. Evaluation of Hemodialysis Arteriovenous Bruit by Deep Learning. Sensors 2020, 20, 4852. [Google Scholar] [CrossRef] [Scilit]
  15. Balamuthusamy, S.; Dhanabalsamy, N.; Thankavel, B.; Bala, M.; Pfaffle, A. Utility of Machine Learning (ML)Analytics on Real Time Risk Stratification and Re-Intervention Risk Prediction on AV Access Outcomes and Cost. J. Vasc. Access 2023, 25, 1224–1228. [Google Scholar] [CrossRef] [Scilit]
  16. Motofelea, A.C.; Mihaescu, A.; Olariu, N.; Marc, L.; Chisavu, L.; Pop, G.N.; Crintea, A.; Jura, A.M.C.; Ivan, V.M.; Apostol, A.; et al. Machine Learning Models for Predicting Mortality in Hemodialysis Patients: A Systematic Review. Appl. Sci. 2025, 15, 5776. [Google Scholar] [CrossRef] [Scilit]
  17. Chen, J.; Shen, C.; Xue, H.; Yuan, B.; Zheng, B.; Shen, L.; Fang, X. Development of an Early Prediction Model for Vomiting during Hemodialysis Using LASSO Regression and Boruta Feature Selection. Sci. Rep. 2025, 15, 10434. [Google Scholar] [CrossRef] [Scilit]
  18. Xie, H.; Deng, X.; Dong, B.; Chen, L.; Song, M.; Ying, Z.; Fan, Z.; Wang, X.; Peng, L. Dialysis Machine Alarm Recognition Based on Convolutional Neural Network. Ren. Replace. Ther. 2025, 11, 38. [Google Scholar] [CrossRef] [Scilit]
  19. Rahman, N.H.A.; Zaki, M.H.M.; Hasikin, K.; Razak, N.A.A.; Ibrahim, A.K.; Lai, K.W. Predicting Medical Device Failure: A Promise to Reduce Healthcare Facilities Cost through Smart Healthcare Management. PeerJ Comput. Sci. 2023, 9, e1279. [Google Scholar] [CrossRef] [Scilit]
  20. Chromik, J.; Klopfenstein, S.A.I.; Pfitzner, B.; Sinno, Z.-C.; Arnrich, B.; Balzer, F.; Poncette, A.-S. Computational Approaches to Alleviate Alarm Fatigue in Intensive Care Medicine: A Systematic Literature Review. Front. Digit. Health 2022, 4, 843747. [Google Scholar] [CrossRef] [Scilit]
  21. Hyland, S.L.; Faltys, M.; Hüser, M.; Lyu, X.; Gumbsch, T.; Esteban, C.; Bock, C.; Horn, M.; Moor, M.; Rieck, B.; et al. Early Prediction of Circulatory Failure in the Intensive Care Unit Using Machine Learning. Nat. Med. 2020, 26, 364–373. [Google Scholar] [CrossRef] [Scilit]
  22. Yang, M.; Peng, Z.; van Pul, C.; Andriessen, P.; Dong, K.; Silvertand, D.; Li, J.; Liu, C.; Long, X. Continuous Prediction and Clinical Alarm Management of Late-Onset Sepsis in Preterm Infants Using Vital Signs from a Patient Monitor. Comput. Methods Programs Biomed. 2024, 255, 108335. [Google Scholar] [CrossRef] [Scilit]
  23. Nicosia, A.; Cancilla, N.; Siino, M.; Passerini, M.; Sau, F.; Tinnirello, I.; Cipollina, A. Alarms Early Detection in Dialytic Therapies via Machine Learning Models. In Proceedings of the 9th European Medical and Biological Engineering Conference; Jarm, T., Šmerc, R., Mahnič-Kalamiza, S., Eds.; Springer Nature: Cham, Switzerland, 2024; pp. 55–66. [Google Scholar]
  24. Andrade, C. The P Value and Statistical Significance: Misunderstandings, Explanations, Challenges, and Alternatives. Indian J. Psychol. Med. 2019, 41, 210–215. [Google Scholar] [CrossRef] [Scilit]
  25. Bergstra, J.; Bengio, Y. Random Search for Hyper-Parameter Optimization. J. Mach. Learn. Res. 2012, 13, 281–305. [Google Scholar]
  26. Arlot, S.; Celisse, A. A Survey of Cross-Validation Procedures for Model Selection. Stat. Surv. 2010, 4, 40–79. [Google Scholar] [CrossRef] [Scilit]
  27. Lin, Y.; Koprinska, I.; Rana, M. Temporal Convolutional Attention Neural Networks for Time Series Forecasting. In Proceedings of the 2021 International Joint Conference on Neural Networks (IJCNN), Shenzhen, China, 18–22 July 2021; IEEE: New York, NY, USA, 2021; pp. 1–8. [Google Scholar] [CrossRef] [Scilit]
  28. Joseph, V.R. Optimal Ratio for Data Splitting. Stat. Anal. Data Min. ASA Data Sci. J. 2022, 15, 531–538. [Google Scholar] [CrossRef] [Scilit]
  29. Li, J.; Cheng, K.; Wang, S.; Morstatter, F.; Trevino, R.P.; Tang, J.; Liu, H. Feature Selection: A Data Perspective. ACM Comput. Surv. 2018, 50, 1–45. [Google Scholar] [CrossRef] [Scilit]
  30. Abid-Althaqafi, N.R.; Alsalamah, H.A. The Effect of Feature Selection on the Accuracy of X-Platform User Credibility Detection with Supervised Machine Learning. Electronics 2024, 13, 205. [Google Scholar] [CrossRef] [Scilit]
  31. Mutual_Info_Classif, Scikit-Learn Documentation, Scikit-Learn Developers. Available online: https://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.mutual_info_classif.html (accessed on 15 September 2026).
  32. El-Hashash, E.F.; Shiekh, R.H.A. A Comparison of the Pearson, Spearman Rank and Kendall Tau Correlation Coefficients Using Quantitative Variables. Asian J. Probab. Stat. 2022, 20, 36–48. [Google Scholar] [CrossRef] [Scilit]
  33. Supervised Learning, Scikit-Learn Documentation, Scikit-Learn Developers. Available online: https://scikit-learn.org/stable/supervised_learning.html (accessed on 15 September 2026).
  34. Cover, T.; Hart, P. Nearest Neighbor Pattern Classification. IEEE Trans. Inf. Theory 1967, 13, 21–27. [Google Scholar] [CrossRef] [Scilit]
  35. Breiman, L. Random Forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef] [Scilit]
  36. Geurts, P.; Ernst, D.; Wehenkel, L. Extremely Randomized Trees. Mach. Learn. 2006, 63, 3–42. [Google Scholar] [CrossRef] [Scilit]
  37. Freund, Y.; Schapire, R.E. A Decision-Theoretic Generalization of On-Line Learning and an Application to Boosting. J. Comput. Syst. Sci. 1997, 55, 119–139. [Google Scholar] [CrossRef] [Scilit]
  38. Guryanov, A. Histogram-Based Algorithm for Building Gradient Boosting Ensembles of Piecewise Linear Decision Trees. In Proceedings of the Analysis of Images, Social Networks and Texts; van der Aalst, W.M.P., Batagelj, V., Ignatov, D.I., Khachay, M., Kuskova, V., Kutuzov, A., Kuznetsov, S.O., Lomazova, I.A., Loukachevitch, N., Napoli, A., et al., Eds.; Springer International Publishing: Cham, Switzerland, 2019; pp. 39–50. [Google Scholar] [CrossRef] [Scilit]
  39. Chen, T.; Guestrin, C. XGBoost: A Scalable Tree Boosting System. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016; Association for Computing Machinery: New York, NY, USA, 2016; pp. 785–794. [Google Scholar] [CrossRef] [Scilit]
  40. Ke, G.; Meng, Q.; Finley, T.; Wang, T.; Chen, W.; Ma, W.; Ye, Q.; Liu, T.-Y. LightGBM: A Highly Efficient Gradient Boosting Decision Tree. In Proceedings of the Advances in Neural Information Processing Systems; Curran Associates, Inc.: Red Hook, NY, USA, 2017; Volume 30. [Google Scholar]
  41. Maalouf, M. Logistic Regression in Data Analysis: An Overview. Int. J. Data. Anal. Tech. Strateg. 2011, 3, 281–299. [Google Scholar] [CrossRef] [Scilit]
  42. Hoerl, A.E.; Kennard, R.W. Ridge Regression: Biased Estimation for Nonorthogonal Problems. Technometrics 1970, 12, 55–67. [Google Scholar] [CrossRef]
  43. Murtagh, F. Multilayer Perceptrons for Classification and Regression. Neurocomputing 1991, 2, 183–197. [Google Scholar] [CrossRef] [Scilit]
  44. Feurer, M.; Klein, A.; Eggensperger, K.; Springenberg, J.T.; Blum, M.; Hutter, F. Auto-Sklearn: Efficient and Robust Automated Machine Learning. In Automated Machine Learning; Hutter, F., Kotthoff, L., Vanschoren, J., Eds.; The Springer Series on Challenges in Machine Learning; Springer International Publishing: Cham, Switzerland, 2019; pp. 113–134. [Google Scholar] [CrossRef] [Scilit]
  45. Gijsbers, P.; Bueno, M.L.P.; Coors, S.; LeDell, E.; Poirier, S.; Thomas, J.; Bischl, B.; Vanschoren, J. AMLB: An AutoML Benchmark. J. Mach. Learn. Res. 2024, 25, 1–65. [Google Scholar]
  46. Sokolova, M.; Lapalme, G. A Systematic Analysis of Performance Measures for Classification Tasks. Inf. Process. Manag. 2009, 45, 427–437. [Google Scholar] [CrossRef] [Scilit]
  47. Goutte, C.; Gaussier, E. A Probabilistic Interpretation of Precision, Recall and F-Score, with Implication for Evaluation. In Advances in Information Retrieval; Losada, D.E., Fernández-Luna, J.M., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2005; Volume 3408, pp. 345–359. [Google Scholar] [CrossRef] [Scilit]
  48. Nicosia, A.; Cancilla, N.; Martín Guerrero, J.D.; Tinnirello, I.; Cipollina, A. Artificial Intelligence in Nephrology: From Early Detection to Clinical Management of Kidney Diseases. Bioengineering 2025, 12, 1069. [Google Scholar] [CrossRef] [Scilit]
  49. Harris, P.R.; Zègre-Hemsey, J.K.; Schindler, D.; Bai, Y.; Pelter, M.M.; Hu, X. Patient Characteristics Associated with False Arrhythmia Alarms in Intensive Care. Ther. Clin. Risk Manag. 2017, 13, 499–513. [Google Scholar] [CrossRef] [Scilit]
  50. Wang, J.; Xu, T. Hemodialysis Equipment Malfunction Incidence and Risk Profiling in Clinical Settings: A Retrospective Single-Center Cohort Analysis. Biomed. Eng. OnLine 2025, 24, 145. [Google Scholar] [CrossRef] [Scilit]
  51. Zhang, H.; Wang, L.-C.; Chaudhuri, S.; Pickering, A.; Usvyat, L.; Larkin, J.; Waguespack, P.; Kuang, Z.; Kooman, J.P.; Maddux, F.W.; et al. Real-Time Prediction of Intradialytic Hypotension Using Machine Learning and Cloud Computing Infrastructure. Nephrol. Dial. Transplant. Off. Publ. Eur. Dial. Transpl. Assoc.—Eur. Ren. Assoc. 2023, 38, 1761–1769. [Google Scholar] [CrossRef] [Scilit]
  52. Johnson, J.M.; Khoshgoftaar, T.M. Survey on Deep Learning with Class Imbalance. J. Big Data 2019, 6, 27. [Google Scholar] [CrossRef] [Scilit]
  53. Luo, J.; Yuan, Y.; Xu, S. Improving GBDT Performance on Imbalanced Datasets: An Empirical Study of Class-Balanced Loss Functions. Neurocomputing 2025, 634, 129896. [Google Scholar] [CrossRef] [Scilit]
  54. Omar, E.D.; Mat, H.; Abd Karim, A.Z.; Sanaudi, R.; Ibrahim, F.H.; Omar, M.A.; Ismail, M.Z.H.; Jayaraj, V.J.; Goh, B.L. Comparative Analysis of Logistic Regression, Gradient Boosted Trees, SVM, and Random Forest Algorithms for Prediction of Acute Kidney Injury Requiring Dialysis After Cardiac Surgery. Int. J. Nephrol. Renov. Dis. 2024, 17, 197–204. [Google Scholar] [CrossRef] [Scilit]
  55. Nicosia, A.; Cancilla, N.; Passerini, M.; Sau, F.; Tinnirello, I.; Cipollina, A. Performance Comparison of a Neural Network and a Regression Linear Model for Predictive Maintenance in Dialysis Machine Components. Bioengineering 2025, 12, 941. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.