Life Sciences

How to do ML-based Triage Prediction with KNIME

December 9, 2022 — by Franziska Rau
How to do ML-based Triage Prediction with KNIME

Have you ever needed to seek immediate help at a hospital? You probably went straight to the emergency room. Maybe you were lucky and got help right away, but more likely you had to wait your turn. Emergency rooms don’t operate on a “first come, first serve” basis. Doctors and nurses need to quickly assess who needs to be prioritized and who can wait a little. And such decisions must be made quickly, even before any diagnosis is determined. This process is called triage. 

Triage is based on an internationally recognized five-level system wherein Level 5 = not urgent and Level 1 = most urgent. To automate this process, I created a workflow that predicts the triage score of newly arrived patients, based on several parameters which can be entered into an interactive view and later viewed by a medical expert for diagnosis. The complete workflow can be seen in Figure 1.

ML-based Triage Prediction with KNIME
Figure 1: Triage Score Prediction workflow, including model training, patient admission, and diagnosis from a medical expert. 

Triage Score Systems in Emergency Departments 

Managing growing patient volumes in emergency departments (EDs) has become a major problem worldwide. To deal with it, most EDs have a triage system. It is crucial to identify those most in need of immediate care. The goal is to reduce patient overcrowding and improve the efficiency of emergency care, as well as allocate medical resources according to priority. 

The most frequently used triage system in Europe is the Manchester Triage System (MTS), wherein a specially trained expert determines a score based on several symptoms — e.g. pain, consciousness, temperature, duration of disease/illness, loss of blood, etc. This usually works fine, but sometimes patients have a very complex combination of symptoms, and prioritizing them is complicated even for specifically trained experts. 

Therefore, we thought about utilizing machine learning to propose a prioritization based on patient symptoms and additional information. The expert can simply input the patient’s information into the “Patient Admission” dashboard, and the machine learning model predicts a triage score and puts the patient in the correct position in the “waiting” queue based on that score. In the second “Diagnosis” dashboard, the doctor can enter a diagnosis after thorough examination of the patient, and the patient is then automatically removed from the “triage” queue. Let’s take a closer look at how this is done with KNIME.

Korean Triage Study Dataset

The dataset I used for training the machine learning model is from a Korean triage study across two hospitals. In total, 1,267 medical records with 24 features are included. The features and values can be seen in Figure 2.

ML-based Triage Prediction with KNIME
Figure 2: Features and associated values from the Korean triage study dataset. 

The triage scale they used is the Korean Triage and Acuity Scales (KTAS), which is based on the better-known Canadian Triage and Acuity Scale (CTAS). It consists of a five-level system (5 = non-urgent, 1 = most urgent). (Each country has its own approach or scale to determine the priority of patients.) 

Triage Score Prediction using AutoML

First I prepared the features for model training. I replaced the missing values in the dataset with mean or median values. Missing values can occur if, for example, the measurement was not accurate, or if there was an emergency during which there was no time to measure.

Since KTAS 1 (most urgent) and 2 are underrepresented classes in the dataset, I used the SMOTE node to synthetically sample them to make sure the dataset is more balanced. I also converted all features to numeric values using one-hot encoding. The prepared features can then be used for training in the AutoML component. This component automates the training, validation, and deployment of up to nine machine learning algorithms, combining them with any other required nodes. For more details, read “Integrated Deployment - Automated Machine Learning.” The best model is selected, which in this case is XGBoost Trees, with an accuracy of 96%. 

Patient Admission 

To get a triage score prediction for patients, I created a patient admission board. All vital values, as well as name, age, gender, mental state, and arrival mode, can be entered. All the information, including the time of arrival, is saved in a database so it can be accessed later. Additionally, the triage score is automatically calculated and saved. I also highlighted the different scores with their own colors so that emergencies can be more easily recognized and prioritized immediately. Figure 3 shows the patient board with values entered. 

ML-based Triage Prediction with KNIME
Figure 3: Interactive patient board which allows one to enter vital values, as well as name, age, gender, mental state, and arrival mode.

Clicking the “Add Patient” Refresh Button will display the entries in a Table View, as seen in Figure 4. The table is sorted by the patient’s triage score to quickly show who is most in need of help at the top.

ML-based Triage Prediction with KNIME
Figure 4: Database entries of the patients with all entered values from the patient board, with the predicted triage scores sorted by urgency. 

Using the SQLite Connector and DB Table Creator, I created a SQLite database table in which all the patient admission data will be saved. This data is then used by the medical expert to add a diagnosis. 

Diagnosis by Medical Expert

The medical expert can access all the patient admission data, and by using the Table Editor, they can directly type in a diagnosis after treatment, as seen in Figure 5. By clicking the “Add Diagnosis” Refresh Button, the patient with an added diagnosis will be deleted from the initial database table and saved into a different table which has all completed diagnoses. 

ML-based Triage Prediction with KNIME
Figure 5: All patients with a diagnosis from the medical expert, which will be stored in a separate database.

Automating Triage Score Categorization

Here we demonstrated how to utilize machine learning to help medical experts better prioritize patients upon admission to emergency departments. The “Patient Admission” dashboard makes it easy to enter the necessary information and quickly get the model’s predictions in a nice color-coded table view. Once a diagnosis is made, a doctor can add this information to the table, and the patient is removed from the queue automatically. The patient's information is safely stored in a database. 

You Might Also Like

What are you looking for?