Acute kidney injury (AKI) is a serious medical condition that can lead to severe complications and a high risk of mortality if not detected and treated promptly. It is a common and serious clinical problem that affects millions of people in the world, with about 13.3 million new cases of acute kidney injury and 2 million deaths every year [1–3]. Early detection and timely intervention are critical to preventing progression, reducing complications, and potentially saving lives. Integrating advanced monitoring systems and early-warning technologies, such as AIoT-based (Artificial Intelligence of Things) solutions [4], can significantly enhance the ability to identify and manage AKI at its earliest stages, improving patient outcomes.
The occurrence of AKI is a critical factor influencing a patient’s prognosis. Prompt detection and early intervention are essential in mitigating kidney damage and enhancing recovery outcomes [5]. Delayed diagnosis or treatment can escalate the condition, potentially leading to irreversible kidney damage, chronic kidney disease, or end-stage renal failure. These complications significantly increase the risk of long-term health issues and mortality. AKI often acts as a precursor to serious complications, such as fluid overload, electrolyte imbalances, and multi-organ failure, which can exacerbate a patient’s condition. Therefore, implementing strategies for early recognition through biomarkers, imaging, and routine clinical assessments is vital. Timely management, including fluid management, addressing the underlying causes, and renal support therapies, can greatly reduce the likelihood of progression to severe complications, improving survival rates and quality of life for affected patients.
According to Wang [5], in acute kidney injury and mortality in hospitalized patients, among 19,249 hospitalized patients, 22.7% of patients will develop AKI, where the mortality rate is 6.3% and 16.5% in stage-1 and stage-2 AKI, respectively. Thus, the importance of early prevention and intervention of AKI has become increasingly prominent.
Traditionally, the diagnosis and monitoring of AKI mainly rely on clinical indicators and biological test results. However, these indicators often only show significant changes before AKI is about to occur, making early identification and intervention difficult. In recent years, with the rapid development of artificial intelligence (AI) technology, predictive models based on machine learning and deep learning have become potential solutions to this problem [6–8]. However, research to date on AI prediction systems in AKI prevention remains limited. Therefore, in this study we aimed to develop a prediction system based on convolution neural network (CNN) associated with long short-term memory (LSTM) to accurately predict the risk of AKI according to patients’ urine volume. Through this prediction system, doctors can identify high-risk patients at an early stage and provide timely interventions to reduce the incidence of AKI and the risk of related complications.
The remainder of this paper is organized as follows. Section “Training Model and Network Development” deals with an AI training model with our new networks. A real-time embedded implementation for AKI prediction is discussed in “Experiments for real-time test”. The conclusions are presented in the last Section.
Training model and network development. AKI is a sudden impairment of kidney function that usually happens within hours or days. AKI is a common clinical problem that may occur in patients of all ages, including hospitalized patients, surgical patients, intensive care patients, and patients with underlying kidney disease [1]. The pathogenesis of AKI is complex and may involve a variety of causative factors, including insufficient renal blood perfusion, renal tubular damage, renal tissue inflammation, renal structural damage, etc. [9]. Renal tubular damage refers to structural or functional injury to the tubular cells of the kidney, which can result from ischemia, toxins, or other insults, and directly affects the kidney’s ability to concentrate urine, reabsorb electrolytes, and excrete waste products. Renal inflammation is a response of the immune system to injury, infection, or autoimmune triggers. Common causes of AKI include renal ischemia, kidney stones, infection, nephrotoxic drug use, and renal tumors. The occurrence of AKI prevents the kidneys from effectively removing waste and fluids from the body, leading to the accumulation of toxins and electrolytes in the blood, which in turn has serious consequences for other organs and systems.
In this study, we used MIMIC-III Datasets to develop the AI model. Medical Information Mart for Intensive Care (MIMIC) [10] is a widely used public medical database mainly used to support and promote clinical and medical research. Developed jointly by the Massachusetts Institute of Technology and Harvard Medical School, the database contains a large amount of clinical data, especially from patients in the intensive care unit (ICU). We selected 547,694 urine output data of 2,012 AKI patients, and divided them into a training set and a test set. The total number of people in the training set was 1607, and it contained 438,155 test urine output data. The test set was obtained from 405 patients and contained 109,539 test urine output data. We utilized an AI-based approach to predict the potential occurrence of AKI using MIMIC-III Datasets. By leveraging machine learning techniques, we analyzed patterns in patient data to identify early indicators of AKI. This predictive method is designed to assist in timely medical interventions, thereby improving patient outcomes and reducing the risks associated with delayed detection and treatment (Figure 1).
Feature extraction: The dataset was further pre-processed for the training data to extract the required data from MIMIC-III Datasets [10]. From the MIMIC-III Datasets, clinical experiments recorded the relationship between urine flow and the occurrence of AKI, as illustrated in Figure 1. These findings demonstrate that AKI occurrence is strongly correlated with urine flow. A low urine flow rate is associated with a higher probability of AKI, emphasizing its significance as an early indicator for detection and intervention.
The preprocessing of the dataset is a crucial step to extract relevant features for training the model. Here, the data are structured to include time-sequenced urine volume (VALUE) and the AKI detection result (HAVEAKI) for effective analysis and model training. The data are divided into one piece of data with the VALUE every 30 h, and one piece of data with the HAVEAKI value in the last 6 h, where “VALUE” is sensed with urine volume, and “HAVEAKI” the AKI detected result. Figure 1 A represents the urine volume data and HAVEAKI value for a condition with AKI. A noticeable increase in HAVEAKI = 1 corresponds to occurrence of the AKI event. Figure 1 B represents data for a condition without AKI. HAVEAKI remains low throughout the sequence.
We used the train_test_split function to divide the dataset for train and test, and to prepare for training the neural network. The following steps were performed:
Data Splitting: use the train_test_split function to divide the dataset into training and testing subsets with a 4: 1 ratio. For instance, if there are 1,000 samples, 800 would be used for training and 200 for testing.
Matrix Conversion: Convert the dataset into a matrix format that aligns with numerical processing. Each sample is represented as a numerical matrix, where rows and columns correspond to features and their values.
Reshaping the Data: make the data compatible with neural network requirements, reshape them into the format (batch_size, steps, channels).
Data Input to neural network: pass the reshaped data to the network model for training. This format ensures that the model layers can process the data correctly, utilizing convolutional filters to extract spatial and channel-wise features effectively.
To analyze the urine volume sequence dataset using a combination of convolutional neural networks (CNN) and long short-term memory (LSTM) networks. The urine volume sequence in the dataset is represented as an r × m matrix = [x1, x2, x3, x4, …, xr], where “r” is the number of samples and “m” is the sequence length. Then, this matrix is input into the CNN for feature extraction. For data training, the parameters are set to filters = 32, kernel_size = 7, and feature extraction is performed through 32 filters, then activated through the Relu function. Then pooled processing is through maxpooling, to down-sample the feature maps and reduce their dimensionality. Next, a dropout with a probability of 0.3 was added to prevent overfitting by randomly disabling neurons during training. Finally, a sequence was output as corresponding to the input of the subsequent LSTM. The resulting sequence from the CNN is passed as input to the LSTM layer for temporal modeling. LSTM processes the sequence to learn time-dependent relationships in the data for AKI prediction.
LSTM model for urine volume sequence prediction
Feature extraction through CNN can obtain a time-dependent sequence, and then these are input into LSTM in chronological order. Certain parameters or techniques are used to deal with class imbalance problems in machine learning. When the number of samples in different categories in the training set is very different, the model may be biased towards predicting categories with a larger number and have poor prediction results for categories with a smaller number. This is the class imbalance problem, and “class_weight” can be used to deal with this problem. When training a model, the weights of the model are usually optimized by minimizing the loss function so that the model’s predictions are as close to the actual values as possible. The class_weight parameter allows one to specify different weights for different categories, so that the model pays more attention to minority class samples during the training process, which can improve the model’s prediction ability for minority classes. The occurrence of AKI in the training data of this study is an oligopoly event, so we used class_weight to adjust the class imbalance problem.
Since the AKI detection is not very complex, the network for data training is proposed in Figure 2. The first used two convolution layers and then processed them with maxpool and dropout processing to condense the data. Next, the convoluted data were processed with two LSTM layers for sequence detection, and then dense data for output. The computational complexity of this network is low, and it can be implemented with a low-cost embedded system for real-time operation.
Simulations
For training data with this network, the training environment was set up as shown in Table I. The Python programming language was used for model development. The training was performed using TensorFlow [11]. The training hardware used was Nvidia GTX 1650ti with the Cuda development tool [12]. The training epochs were 300 times, and input batch size was 128. Since the dataset was very large, we required about 36 h for training. The training loss was estimated with the function binary_crossentropy.
Table I
Training environment setup
Parameter | Value |
---|---|
Python Version | 3.7.16 |
TensorFlow Version | 2.11.0 |
Cuda Version | 10.1 |
GPU | Nvidia GTX 1650ti |
Epochs | 300 |
Batch_size | 128 |
Training time | 36 h |
Loss function | Binary_crossentropy |
Accuracy refers to the proportion of samples correctly classified by the model out of the total samples. It serves as an essential metric for evaluating the performance of classification models. The higher the accuracy, the better is the model’s ability to make correct predictions. On the other hand, loss represents the degree of error or mismatch between the model’s predicted outputs and the actual target values during training. The choice of loss function varies depending on the model’s structure. Binary cross-entropy is often used for binary classification tasks, while mean squared error is common in regression tasks. The primary objective during model training is to minimize the loss function, which effectively optimizes the model parameters. A lower loss value typically correlates with better model performance.
We trained our model on a dataset comprising 621,092 in-hospital urine output records from 32,805 patients with AKI. After training, the evaluation metrics demonstrated the effectiveness of the model:
Accuracy: The model achieved an accuracy of 0.979, reflecting its ability to classify AKI and non-AKI cases correctly.
Loss: The loss value was 0.0745, indicating a low error rate during the training process.
F1 score: The F1 score, which balances precision and recall in binary classification, was 0.94, showing strong overall performance.
Figures 3 and 4 illustrate the model’s accuracy and loss curves during training, respectively, highlighting the model’s convergence and stability. These results confirm that the proposed model is highly effective for AKI detection and classification.
The receiver operating characteristic (ROC) curve can show the performance of the model under different thresholds. The threshold is a value used to convert the output of the model into a classification result. When the probability value of the output exceeds the threshold, it is classified as a positive class; otherwise it is classified as a negative class. Adjusting the threshold can affect the false positive rate and true rate of the model, thereby affecting the shape of the ROC curve.
The ROC curve of an ideal classifier will rise from the lower left to the upper left corner, then move to the upper right corner. This means that at the same false positive rate, the true positive rate is higher, or in other words, at the same true positive rate, the false positive rate is lower. The area under the ROC curve is called the area under the curve (AUC). An AUC value close to 1 indicates better performance of the AI model. Our ROC curve from the results of this study is very close to 1, as shown in Figure 5, with 0.996. This indicates that the accuracy of AKI risk detection is extremely high for the patient.
Experiments for real-time test. In order to apply the proposed AKI detection in real practice, we set up the physical system in the experiments. The system archecture for AKI detection is shown in Figure 6. We used a urine collection bag to collect the urine, as shown in Figure 7. The weight sensor (shown in Figure 8) used to detect the urine volume was attached to the urine bag using a hook. The output of the weight sensor was sent to an analog-to-digital converter (ADC). The digitalized signal was sent to an ARM-based embedded system [13, 14]. The AI model for AKI detection is pre-trained, and its coefficients are stored on disk. At system initialization, the embedded system loads the AI model from the disk into its random access memory (RAM) for execution. The system processes sequential data from an ADC chip as input. Once the AI model detects AKI, it triggers an emergency alarm message to notify the doctor, helping to mitigate the risk of AKI promptly.
The ADC converter used the HX711 chip. The HX711 [15] is a 24-bit A/D converter chip specially designed for high-precision load cells. In this study, HX711 is responsible for converting the urine weight measured by the electronic tension scale from an analog to a digital signal and then transmitting it to a Pi embedded system [13] for AI analysis to help us determine whether there is a risk of acute renal failure. Compared with other ADC chips, this chip is specially designed for weighing sensors. The weighing sensor system requires only a single HX711 chip to process weighing signals and perform analog-to-digital (AD) conversion. The chip interfaces with a microcontroller to determine the current weight value. The system employs a function routine that reads the converted value from the HX711 and uses a linear equation to calculate the precise weight of the object at that moment. This streamlined approach ensures accurate weight measurement with minimal hardware complexity. Given the low sampling rate required for practical AKI detection, a cost-effective Raspberry Pi embedded system is employed in our setup. The system collects urine data at a rate of one data point per second, enabling the detection result to be updated every second. This design ensures that the system meets the real-time operational requirements of AKI detection, providing timely and accurate results for early intervention (Figure 9).
Figure 10 illustrates the real-world testing scenario for AKI detection in a patient. A weight sensor is used to monitor a urine bag attached to a hospital bed. The sensing data are transmitted to a Raspberry Pi embedded system for real-time AKI detection. When medical staff inputs the Subject_id for a patient, the system begins measuring the urine volume and displays the Subject_id, measurement time, and urine weight on the screen. This visual presentation allows medical staff to intuitively monitor changes in urine volume over time. Additionally, all data are stored in the system in the form of a CSV file, creating a detailed record of the patient’s urine output. These data records can also be utilized to retrain and improve the AI model, enhancing its accuracy for future AKI detection. This implementation demonstrates the feasibility of integrating AI-based AKI detection into clinical practice. The combination of a low-cost hardware setup and a trained AI model enables real-time monitoring and alerts, making the system both practical and effective for early intervention.
To ensure comprehensive and continuous monitoring of patients, the system extends its capabilities through Internet of Things (IoT) integration. This allows both medical professionals and family members to access the patient’s condition remotely and in real time. When the patient is exposed to a dangerous situation, the system will send the alarm information to the network. The value can be easily connected by any mobile device by clicking on the URL with IOT (Internet of Things) techniques [4]. With firebase data, we used Node.js to develop a web application to display the monitoring status of AKI, which includes all the patient’s urine output monitoring status and the AKI risk index after AI prediction, as shown in Figure 11. This system enables real-time monitoring of AKI status for both medical staff and family members. The integration of web-based visualization ensures that critical information is always accessible. When an AKI event is detected, a pop-up alert is triggered on the webpage, immediately notifying medical staff to facilitate timely intervention. By leveraging web pages and data visualization, the system simplifies the observation process, enhancing usability and practicality. This makes the system well suited for direct application in hospitals, improving the management and care of patients at risk of AKI. By leveraging IoT, cloud services, and AI-driven analytics, the system creates a robust and user-friendly platform that significantly enhances the management and response to AKI risks.
In conclusion, this paper proposes a learning-based network for AKI detection. The results show that our AI model can achieve high accuracy to predict AKI. When AKI is predicted, the system automatically sends a notification to the hospital group to alert medical staff. Additionally, it converts the urine output values into a line chart, enabling medical professionals to interpret the patient’s condition more intuitively. With rapid notifications and early treatment, the system can effectively reduce the mortality and severe disease rates associated with AKI. The system has been implemented with physical hardware integrated with AI-powered software. This application not only enhances patient care but also addresses the shortage of nursing staff by significantly reducing the reliance on human monitoring. Using the proposed AI model, the relationship between urine output and AKI can be effectively leveraged to predict AKI occurrence, ensuring timely and targeted medical interventions. Further, AI algorithms associated with IoT devices make it possible to collect, analyze, and visualize health data seamlessly. It provides medical staff with instant access to critical information, enhancing decision-making and allowing timely interventions. This platform provides healthcare providers with easy access to critical data and enhances the ability to respond promptly to emergencies.