The Use of Machine Learning Techniques in Error Detection and Improving Laboratory Work Quality

Main Article Content

Saad Thani Farha Altarfawi, Naif Awadh Duhaylis Alrashdi, Abdulrahman Mezel Aldhamashi, Fahad Mohammad Khalaf Alshammari, Awad Abdulmohsen Al Harbi, Sabah Sulaiman Altuhayr Alrashdi, Laboratory Technician

Abstract

The accuracy of clinical laboratory testing is fundamental to patient safety, yet traditional quality control methods remain largely reactive and limited in scope. Machine learning (ML) offers a paradigm shift towards intelligent, predictive error detection. This study addresses a critical gap by developing and validating an end-to-end ML framework specifically for the clinical laboratory environment of Saudi Arabia. We conducted a retrospective analysis of 3.98 million test records from three high-throughput, ISO-accredited laboratories in Saudi Arabia (Riyadh, Jeddah, Dammam) from 2020-2023. Data underwent rigorous preprocessing and feature engineering. We developed and compared supervised models (XGBoost, Random Forest, Neural Network) for multi-class error classification (pre-analytical, analytical, post-analytical) against a rule-based baseline. Unsupervised autoencoders were implemented for proactive anomaly detection. Model performance was evaluated on a temporally held-out test set (2023 data), and a 30-day operational simulation projected the impact of ML integration. The optimized XGBoost model achieved an overall error detection rate of 89.6%, a 23-percentage-point absolute improvement over the traditional rule-based system (66.6%, p<0.001). It demonstrated high recall for analytical (91.2%) and post-analytical (85.5%) errors. The autoencoder model identified novel, latent system issues with 31.7% precision, flagging subtle instrument drifts prior to quality control failure. Feature importance analysis revealed key regional risk predictors, including non-linear reagent lot aging and elevated error rates on night shifts and Sundays. The operational simulation projected a 73.8% reduction in the error reporting rate and optimized technologist workflow. This study provides robust evidence that a contextually tailored ML framework significantly outperforms conventional methods in laboratory error detection within the Saudi healthcare setting. By enabling both superior classification of known errors and proactive identification of emerging risks, ML facilitates a transition from reactive filtering to predictive quality management, with substantial projected benefits for diagnostic accuracy and patient safety.

Article Details

Section
Articles