Abstract
Acute Kidney Injury (AKI) is a prevalent condition in intensive care units, yet its diagnosis via the KDIGO clinical standards remains complex and error-prone when performed manually on time-series data. We present pyAKI, an open-source Python pipeline that automates AKI staging. By implementing a standardized data model and flexible baseline logic, pyAKI achieves perfect diagnostic accuracy, outperforming trained physicians and enabling scalable clinical research.
Introduction
Acute Kidney Injury (AKI) affects approximately half of all patients in Intensive Care Units (ICUs). The global standard for diagnosis is the KDIGO criteria, which evaluate three clinical pathways: urine output (UO) reduction, serum creatinine (SCr) elevation, and the initiation of renal replacement therapy (dialysis).
Despite the apparent simplicity of these rules, applying them to "messy" clinical time-series data is challenging. Manual annotation is resource-intensive and susceptible to human errors, such as rounding mistakes or miscalculated baselines. Furthermore, the lack of a standardized data format across research groups hinders the reproducibility and comparability of studies. pyAKI was developed to bridge this gap by providing a reliable, automated, and open-source tool for AKI staging.
Methods
The pyAKI pipeline transforms raw clinical data into validated AKI stages (0–3) through several key components:
- Standardized Data Model: The system utilizes three primary input tables—Urine Data, Creatinine Data, and Kidney Replacement Data—linked by patient identifiers and timestamps.
- Flexible Baseline Logic: Users can choose from various methods to define "baseline" creatinine, such as rolling windows or the Cockcroft-Gault formula, addressing a major source of variability in AKI research.
- Data Interpolation: To handle sparse clinical records, the pipeline includes customizable imputation methods to up-sample data to hourly intervals, ensuring consistent application of KDIGO temporal windows (6, 12, or 24 hours).
The tool was validated using the MIMIC-IV demo version 2.2, extracting 2,651 hours of data from 15 patients. A "ground truth" was established by three junior physicians, with final review and conflict resolution provided by a panel of senior expert physicians.
Results
The validation study demonstrated that pyAKI significantly outperforms human experts in diagnostic precision.
- Perfect Accuracy: pyAKI achieved an accuracy of 1.0 (100%) across all categories, including UO, SCr, Dialysis, and Overall Stage, when compared against the expert-resolved ground truth.
- Human Error Margin: In contrast, human physicians achieved an overall accuracy of 0.9771. Errors were most frequent in the Urine Output pathway (0.9664 accuracy), likely due to the difficulty of manually performing windowed averaging over long time series.
- Efficiency and Scalability: The automated nature of the pipeline allows for the processing of large-scale datasets that would be practically impossible for human experts to annotate manually.
Discussion and Limitations
While pyAKI offers a robust solution for adult ICU data, several areas for future development remain. The current version is not validated for pediatric use, as KDIGO criteria for children involve different GFR thresholds. Additionally, while the pipeline automates staging, users must still perform initial data cleaning to fit the pyAKI data model.
The success of pyAKI highlights the importance of standardization in clinical machine learning. By providing a "minimal required subset" of variables and transparent baseline calculations, pyAKI serves as a blueprint for future automated clinical research. Future iterations may see integration into real-time clinical decision support systems to provide early warnings for AKI events in the ICU.
Summary updated