Machine Learning–Based Detection of Analytical Errors in Clinical Chemistry: A Simulation Study Using Population-Derived Biochemical Data | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Machine Learning–Based Detection of Analytical Errors in Clinical Chemistry: A Simulation Study Using Population-Derived Biochemical Data Sabira Dabeer, Hatim Palitanawala This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-9522381/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Objectives: Analytical errors in clinical chemistry laboratories, including drift, calibration shifts, and imprecision, can compromise test accuracy and affect clinical decision-making. Conventional quality control methods may fail to detect subtle or evolving analytical deviations. This study evaluates the performance of machine learning approaches for detecting analytical errors using population-derived biochemical data. Design and Methods: Biochemical data from the National Health and Nutrition Examination Survey (NHANES) were used, including glucose, high-density lipoprotein (HDL), and triglycerides. Synthetic analytical error scenarios (drift, shift, noise, outliers, and mixed patterns) were introduced to simulate instrument-related variability. A balanced dataset (n = 29,046) was created using random downsampling. Logistic regression and XGBoost models were developed and evaluated using stratified training and testing datasets. Performance metrics included accuracy, sensitivity, specificity, F1-score, and ROC-AUC. Results: The XGBoost model demonstrated superior performance compared to logistic regression (accuracy 0.74 vs 0.57; sensitivity 0.67 vs 0.51; specificity 0.82 vs 0.64; ROC-AUC 0.81 vs 0.59). Detection was highest for systematic errors such as drift and noise, while performance was lower for outlier and shift scenarios. Conclusions: Machine learning models, particularly XGBoost, show strong potential for detecting analytical errors in clinical chemistry using routine patient data. These approaches may complement existing quality control strategies and enhance laboratory performance monitoring. Machine learning Clinical chemistry Analytical error Quality control XGBoost NHANES Figures Figure 1 Figure 2 1. Introduction Clinical chemistry laboratories play a critical role in healthcare by providing biochemical measurements essential for diagnosis, treatment, and monitoring of diseases. The reliability of these measurements depends on accurate and stable analytical performance of laboratory instruments. However, analytical errors such as instrument drift, calibration shifts, and random imprecision can compromise data quality and lead to incorrect clinical decisions [ 1 , 3 ]. Traditional internal quality control (IQC) methods rely on periodic analysis of control materials, which may not detect subtle or time-dependent analytical errors [ 3 , 4 ]. Patient-based real-time quality control (PBRTQC) has been proposed as an alternative approach, leveraging patient results to monitor analytical performance continuously [ 3 , 9 ]. Despite its advantages, adoption of PBRTQC remains limited due to implementation challenges [ 6 ]. Recent advances in machine learning have enabled data-driven approaches for error detection in laboratory medicine [ 1 , 2 ]. However, limited studies have evaluated their effectiveness in detecting specific analytical error types under controlled conditions. This study proposes a simulation-based framework using population-derived biochemical data to evaluate machine learning methods for analytical error detection. 2. Materials and Methods 2.1 Study design This study was designed as a simulation-based evaluation of analytical error detection using population-derived biochemical data. 2.2 Data source Biochemical data were obtained from the National Health and Nutrition Examination Survey across multiple cycles (2007–2016). Variables included glucose, HDL cholesterol, and triglycerides. 2.3 Data preprocessing Data were merged using participant identifiers. Observations with missing or non-physiological values were excluded. Outliers were removed using percentile-based trimming (1st and 99th percentiles). Derived ratios (TG/HDL, glucose/HDL, glucose/triglycerides) were calculated. 2.4 Simulation of analytical error scenarios Drift was simulated as a gradual proportional increase of 1–3% across observations. Calibration shift was introduced as fixed additive changes (+ 4 glucose, + 2 HDL, + 8 triglycerides). Noise was simulated using Gaussian variation to represent analytical imprecision. Outliers were introduced in 5% of observations using moderate perturbations. A mixed scenario combined drift and noise. 2.5 Dataset balancing To address class imbalance, random downsampling was performed to create a balanced dataset of 29,046 observations (14,523 normal and 14,523 error). 2.6 Model development Two models were developed: Logistic regression XGBoost Data were split into training (80%) and testing (20%) sets using stratified sampling. 2.7 Evaluation metrics Performance was evaluated using accuracy, sensitivity, specificity, F1-score, and ROC AUC. 2.8 Workflow overview The overall study workflow is illustrated in Fig. 1 . NHANES biochemical data (glucose, HDL, triglycerides) comprising 29,046 samples (14,523 normal and 14,523 error observations after balancing) were preprocessed and used as baseline data. Synthetic analytical error scenarios, including drift, shift, noise, outliers, and mixed patterns, were introduced to simulate real-world laboratory instrument variability. The dataset was balanced and split into training and testing sets (80:20). Two models—logistic regression and XGBoost—were developed and evaluated using classification metrics and ROC analysis. The XGBoost model demonstrated superior performance (ROC AUC = 0.81) compared to logistic regression (ROC AUC = 0.59), with strong detection of drift and noise but lower performance for outlier and shift scenarios. No human subjects were directly involved in this study, and all data were derived from publicly available, de-identified datasets. 3. Results 3.1 Dataset characteristics A total of 29,046 observations were analyzed following simulation and balancing. 3.2 Model performance Table 1 Model performance comparison Model Accuracy Sensitivity Specificity F1 Score ROC AUC Logistic regression 0.57 0.51 0.64 0.54 0.59 XGBoost 0.74 0.67 0.82 0.72 0.81 The XGBoost model demonstrated superior performance compared to logistic regression. 3.3 ROC analysis ROC curves further illustrate model performance (Fig. 2 ), with XGBoost showing improved discrimination. The diagonal dashed line represents random classification performance. The XGBoost model shows a substantially higher true positive rate across a range of false positive rates, indicating superior ability to distinguish between normal and error-containing observations. 3.4 Scenario-wise performance Table 2 Scenario-wise performance of XGBoost model Scenario Accuracy Drift 0.88 Mixed 0.87 Noise 0.84 Normal 0.82 Shift 0.52 Outlier 0.21 Table 2 . Scenario-wise classification accuracy of the XGBoost model. The model demonstrated high performance in detecting systematic errors such as drift and noise, while performance was lower for outlier and shift scenarios. The improved performance of XGBoost compared to logistic regression suggests that nonlinear relationships between biochemical variables may contribute to improved detection of analytical errors. Discussion This study demonstrates the feasibility of using machine learning to detect analytical errors in clinical chemistry using population-derived biochemical data. The XGBoost model significantly outperformed logistic regression, highlighting the advantage of nonlinear models in capturing complex relationships in laboratory data [ 2 ]. The model showed strong performance in detecting systematic errors such as drift and noise. These types of errors introduce consistent patterns across observations, making them more detectable using ML-based approaches. Similar findings have been reported in studies evaluating PBRTQC and ML-based error detection methods [ 1 , 8 ]. However, detection performance was lower for outlier and shift scenarios. Outliers represent isolated anomalies that lack consistent patterns, while calibration shifts may mimic physiological variability within normal ranges. These findings align with previous studies indicating limitations of current QC approaches in detecting certain types of analytical errors [ 7 , 8 ]. From a laboratory perspective, the ability to detect gradual analytical drift is particularly valuable, as such errors may accumulate over time and remain undetected by conventional QC procedures. The model's strong performance in drift scenarios suggests its potential for real-time monitoring of analyzer performance. From an industry perspective, these results support the potential integration of ML-based QC systems into automated analyzers developed by companies such as Abbott Laboratories and Beckman Coulter. Real-time detection of analytical errors could enhance laboratory reliability and improve patient safety. Limitation The use of simulated analytical errors represents a limitation, as real-world instrument behavior may be more complex. Future studies incorporating instrument-generated QC data are needed to validate these findings. Conclusion Machine learning models, particularly XGBoost, demonstrate potential for detecting analytical errors in clinical chemistry using routine biochemical data. These approaches may complement existing quality control strategies and support improved monitoring of analytical performance in clinical laboratories. These findings support the integration of data-driven quality control approaches into automated clinical chemistry systems to improve analytical reliability and patient safety. Declarations Ethical approval: No human subjects were directly involved in this study. All data were obtained from publicly available, de-identified datasets (NHANES), and therefore, ethical approval was not required. Conflicts of interest: The author declares no conflict of interest. Funding: This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors. Author Contribution S.D. conceived the study, designed the simulation framework, curated and preprocessed the data, developed the machine learning models, performed the analyses, and wrote the manuscript. H.P. contributed to study design, assisted with data simulation and model evaluation, and reviewed and edited the manuscript. All authors read and approved the final version of the manuscript. Data Availability Yes. I used or generated research data in this study.This study used publicly available, de‑identified NHANES biochemical data and generated simulated analytical error scenarios (drift, shift, noise, outliers, mixed patterns) to create the analytical dataset used for machine learning model development and evaluation. References Lorde N, Mahapatra S, Kalaria T. Machine learning for patient-based real-time quality control (PBRTQC), analytical and preanalytical error detection in clinical laboratory. Diagnostics (Basel). 2024;14(16):1808. Spies NC, et al. Validating, implementing, and monitoring machine learning solutions in the clinical laboratory. Clin Chem. 2024;70(11):1334–1343. Badrick T, Bietenbeck A, Cervinski MA, Katayev A, van Rossum HH, Loh TP. Patient-based real-time quality control: review and recommendations. Clin Chem. 2019;65(8):962–971. van Rossum HH. When internal quality control is insufficient or inefficient: consider patient-based real-time quality control. Ann Clin Biochem. 2020;57(3):198–201. Zhou B, Li X, Cheng S, Zhou Z, Kang H. Patient-based pre-classified real-time quality control with neural network. Pract Lab Med. 2025;e00506. Dean P, Badrick T. Why is the adoption of patient-based real-time quality control still limited? J Lab Precis Med. 2025;10:54. doi: 10.21037/jlpm-24-54 . Lu Y, Yang F, Wen D, Shi K, Gu Z, Lu Q, et al. Assessment of patient-based real-time quality control on comparative assays for common clinical analytes. J Clin Lab Anal. 2022;36:e24651. doi: 10.1002/jcla.24651 . Duan X, Wang B, Zhu J, Shao W, Wang H, Shen J, et al. Assessment of patient-based real-time quality control algorithm performance on different types of analytical error. Clin Chim Acta. 2020;511:329–335. Loh TP, Bietenbeck A, Cervinski MA, van Rossum HH, Katayev A, Badrick T. Recommendation for performance verification of patient-based real-time quality control. Clin Chem Lab Med. 2020;58(8):1205–1213. Westgard JO. Basic QC practices: training in statistical quality control for healthcare laboratories. 4th ed. Madison: Westgard QC Inc; 2016. Additional Declarations No competing interests reported. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-9522381","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":630486997,"identity":"5ae286dd-2593-4725-a887-6f50d1202c8b","order_by":0,"name":"Sabira Dabeer","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAvklEQVRIiWNgGAWjYFCCBDYQycMP4TETr0VGsoFULTYGB4jVIt+e/OzBh4p7PMbHjz+TYKiwTmwgpMXgzDNzwxlninnMzuSYSTCcSSdCi0SCmTRvWwKP2YEcNgnGtsOEtcjPSP8m/fdfAo9x//NnEoz/iNDCcCPHTJqxIYEHZJ0EYwMRWgzOvCk37DmWwCNx442xRcKxdGPCDmtP3/bgR02CPX9/+sMbH2qsZQk7DAUkkKZ8FIyCUTAKRgEuAACpcDy2SOpJwgAAAABJRU5ErkJggg==","orcid":"","institution":"Arizona State University","correspondingAuthor":true,"prefix":"","firstName":"Sabira","middleName":"","lastName":"Dabeer","suffix":""},{"id":630486998,"identity":"8bfa812a-420c-4ecc-a027-88835cfe64a7","order_by":1,"name":"Hatim Palitanawala","email":"","orcid":"","institution":"Mumbai University","correspondingAuthor":false,"prefix":"","firstName":"Hatim","middleName":"","lastName":"Palitanawala","suffix":""}],"badges":[],"createdAt":"2026-04-25 05:23:32","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-9522381/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-9522381/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":108011089,"identity":"4ccf95b1-09f7-4e8f-99cd-47d63edafda5","added_by":"auto","created_at":"2026-04-28 13:14:19","extension":"jpeg","order_by":1,"title":"Figure 1","display":"","copyAsset":false,"role":"figure","size":374402,"visible":true,"origin":"","legend":"\u003cp\u003eWorkflow of the proposed machine learning framework for analytical error detection.\u003c/p\u003e","description":"","filename":"floatimage1.jpeg","url":"https://assets-eu.researchsquare.com/files/rs-9522381/v1/f22f10f18dc6724bd769eb59.jpeg"},{"id":108011087,"identity":"1c9cbef8-28fb-48f8-8b46-cce8d4a30b33","added_by":"auto","created_at":"2026-04-28 13:14:19","extension":"jpeg","order_by":2,"title":"Figure 2","display":"","copyAsset":false,"role":"figure","size":191604,"visible":true,"origin":"","legend":"\u003cp\u003e\u003cstrong\u003eReceiver operating characteristic (ROC) curves for classification models.\u003cbr\u003e\n(A) Logistic regression model showing moderate discriminative performance (ROC AUC = 0.59).\u003cbr\u003e\n(B) XGBoost model demonstrating improved classification performance (ROC AUC = 0.81).\u003c/strong\u003e\u003c/p\u003e","description":"","filename":"floatimage2.jpeg","url":"https://assets-eu.researchsquare.com/files/rs-9522381/v1/0ae65d77dce2cbcf5a9ea2f1.jpeg"},{"id":108599186,"identity":"7f387312-4b4b-4a37-a28b-f68d2252a0a5","added_by":"auto","created_at":"2026-05-06 11:13:17","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":725012,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-9522381/v1/09f9d07a-9519-4eaa-b8ff-dd67c03d51e6.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"Machine Learning–Based Detection of Analytical Errors in Clinical Chemistry: A Simulation Study Using Population-Derived Biochemical Data","fulltext":[{"header":"1. Introduction","content":"\u003cp\u003eClinical chemistry laboratories play a critical role in healthcare by providing biochemical measurements essential for diagnosis, treatment, and monitoring of diseases. The reliability of these measurements depends on accurate and stable analytical performance of laboratory instruments. However, analytical errors such as instrument drift, calibration shifts, and random imprecision can compromise data quality and lead to incorrect clinical decisions [\u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e, \u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e3\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eTraditional internal quality control (IQC) methods rely on periodic analysis of control materials, which may not detect subtle or time-dependent analytical errors [\u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e3\u003c/span\u003e, \u003cspan citationid=\"CR4\" class=\"CitationRef\"\u003e4\u003c/span\u003e]. Patient-based real-time quality control (PBRTQC) has been proposed as an alternative approach, leveraging patient results to monitor analytical performance continuously [\u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e3\u003c/span\u003e, \u003cspan citationid=\"CR9\" class=\"CitationRef\"\u003e9\u003c/span\u003e]. Despite its advantages, adoption of PBRTQC remains limited due to implementation challenges [\u003cspan citationid=\"CR6\" class=\"CitationRef\"\u003e6\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eRecent advances in machine learning have enabled data-driven approaches for error detection in laboratory medicine [\u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e, \u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2\u003c/span\u003e]. However, limited studies have evaluated their effectiveness in detecting specific analytical error types under controlled conditions.\u003c/p\u003e \u003cp\u003eThis study proposes a simulation-based framework using population-derived biochemical data to evaluate machine learning methods for analytical error detection.\u003c/p\u003e"},{"header":"2. Materials and Methods","content":"\u003cdiv id=\"Sec3\" class=\"Section2\"\u003e \u003ch2\u003e2.1 Study design\u003c/h2\u003e \u003cp\u003eThis study was designed as a simulation-based evaluation of analytical error detection using population-derived biochemical data.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec4\" class=\"Section2\"\u003e \u003ch2\u003e2.2 Data source\u003c/h2\u003e \u003cp\u003eBiochemical data were obtained from the National Health and Nutrition Examination Survey across multiple cycles (2007\u0026ndash;2016). Variables included glucose, HDL cholesterol, and triglycerides.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec5\" class=\"Section2\"\u003e \u003ch2\u003e2.3 Data preprocessing\u003c/h2\u003e \u003cp\u003eData were merged using participant identifiers. Observations with missing or non-physiological values were excluded. Outliers were removed using percentile-based trimming (1st and 99th percentiles). Derived ratios (TG/HDL, glucose/HDL, glucose/triglycerides) were calculated.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec6\" class=\"Section2\"\u003e \u003ch2\u003e2.4 Simulation of analytical error scenarios\u003c/h2\u003e \u003cp\u003eDrift was simulated as a gradual proportional increase of 1\u0026ndash;3% across observations. Calibration shift was introduced as fixed additive changes (+\u0026thinsp;4 glucose, +\u0026thinsp;2 HDL, +\u0026thinsp;8 triglycerides). Noise was simulated using Gaussian variation to represent analytical imprecision. Outliers were introduced in 5% of observations using moderate perturbations. A mixed scenario combined drift and noise.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec7\" class=\"Section2\"\u003e \u003ch2\u003e2.5 Dataset balancing\u003c/h2\u003e \u003cp\u003eTo address class imbalance, random downsampling was performed to create a balanced dataset of 29,046 observations (14,523 normal and 14,523 error).\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec8\" class=\"Section2\"\u003e \u003ch2\u003e2.6 Model development\u003c/h2\u003e \u003cp\u003eTwo models were developed:\u003c/p\u003e \u003cp\u003e \u003cul\u003e \u003cli\u003e \u003cp\u003eLogistic regression\u003c/p\u003e \u003c/li\u003e \u003cli\u003e \u003cp\u003eXGBoost\u003c/p\u003e \u003c/li\u003e \u003c/ul\u003e \u003c/p\u003e \u003cp\u003eData were split into training (80%) and testing (20%) sets using stratified sampling.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec9\" class=\"Section2\"\u003e \u003ch2\u003e2.7 Evaluation metrics\u003c/h2\u003e \u003cp\u003ePerformance was evaluated using accuracy, sensitivity, specificity, F1-score, and ROC AUC.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec10\" class=\"Section2\"\u003e \u003ch2\u003e2.8 Workflow overview\u003c/h2\u003e \u003cp\u003eThe overall study workflow is illustrated in Fig.\u0026nbsp;\u003cspan refid=\"Fig1\" class=\"InternalRef\"\u003e1\u003c/span\u003e.\u003c/p\u003e \u003cp\u003e \u003c/p\u003e \u003cp\u003eNHANES biochemical data (glucose, HDL, triglycerides) comprising 29,046 samples (14,523 normal and 14,523 error observations after balancing) were preprocessed and used as baseline data. Synthetic analytical error scenarios, including drift, shift, noise, outliers, and mixed patterns, were introduced to simulate real-world laboratory instrument variability. The dataset was balanced and split into training and testing sets (80:20). Two models\u0026mdash;logistic regression and XGBoost\u0026mdash;were developed and evaluated using classification metrics and ROC analysis. The XGBoost model demonstrated superior performance (ROC AUC\u0026thinsp;=\u0026thinsp;0.81) compared to logistic regression (ROC AUC\u0026thinsp;=\u0026thinsp;0.59), with strong detection of drift and noise but lower performance for outlier and shift scenarios.\u003c/p\u003e \u003cp\u003eNo human subjects were directly involved in this study, and all data were derived from publicly available, de-identified datasets.\u003c/p\u003e \u003c/div\u003e"},{"header":"3. Results","content":"\u003cdiv id=\"Sec12\" class=\"Section2\"\u003e\n \u003ch2\u003e3.1 Dataset characteristics\u003c/h2\u003e\n \u003cp\u003eA total of 29,046 observations were analyzed following simulation and balancing.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"Sec13\" class=\"Section2\"\u003e\n \u003ch2\u003e3.2 Model performance\u003c/h2\u003e\n \u003cdiv class=\"gridtable\"\u003e\n \u003ctable id=\"Tab1\" border=\"1\"\u003e\n \u003ccaption\u003e\n \u003cdiv class=\"CaptionNumber\"\u003eTable 1\u003c/div\u003e\n \u003cdiv class=\"CaptionContent\"\u003e\n \u003cp\u003eModel performance comparison\u003c/p\u003e\n \u003c/div\u003e\n \u003c/caption\u003e\n \u003cthead\u003e\n \u003ctr\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eModel\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eAccuracy\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eSensitivity\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eSpecificity\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eF1 Score\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eROC AUC\u003c/p\u003e\n \u003c/th\u003e\n \u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eLogistic\u003c/p\u003e\n \u003cp\u003eregression\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.57\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.51\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.64\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.54\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.59\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eXGBoost\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.74\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.67\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.82\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.72\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.81\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e\n \u003c/div\u003e\n \u003cp\u003eThe XGBoost model demonstrated superior performance compared to logistic regression.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"Sec14\" class=\"Section2\"\u003e\n \u003ch2\u003e3.3 ROC analysis\u003c/h2\u003e\n \u003cp\u003eROC curves further illustrate model performance (Fig.\u0026nbsp;\u003cspan class=\"InternalRef\"\u003e2\u003c/span\u003e), with XGBoost showing improved discrimination.\u003c/p\u003e\n \u003cp\u003e\u003cstrong\u003eThe diagonal dashed line represents random classification performance. The XGBoost model shows a substantially higher true positive rate across a range of false positive rates, indicating superior ability to distinguish between normal and error-containing observations.\u003c/strong\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"Sec15\" class=\"Section2\"\u003e\n \u003ch2\u003e3.4 Scenario-wise performance\u003c/h2\u003e\n \u003cdiv class=\"gridtable\"\u003e\n \u003cdiv class=\"colspec\" align=\"left\"\u003e\u0026nbsp;\u003c/div\u003e\n \u003cdiv class=\"colspec\" align=\"char\"\u003e\u0026nbsp;\u003c/div\u003e\n \u003ctable id=\"Tab2\" border=\"1\"\u003e\n \u003ccaption\u003e\n \u003cdiv class=\"CaptionNumber\"\u003eTable 2\u003c/div\u003e\n \u003cdiv class=\"CaptionContent\"\u003e\n \u003cp\u003eScenario-wise performance of XGBoost model\u003c/p\u003e\n \u003c/div\u003e\n \u003c/caption\u003e\n \u003cthead\u003e\n \u003ctr\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eScenario\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eAccuracy\u003c/p\u003e\n \u003c/th\u003e\n \u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eDrift\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.88\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eMixed\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.87\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eNoise\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.84\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eNormal\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.82\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eShift\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.52\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eOutlier\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"char\" char=\".\"\u003e\n \u003cp\u003e0.21\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e\n \u003c/div\u003e\n \u003cp\u003eTable\u0026nbsp;\u003cspan class=\"InternalRef\"\u003e2\u003c/span\u003e. Scenario-wise classification accuracy of the XGBoost model. The model demonstrated high performance in detecting systematic errors such as drift and noise, while performance was lower for outlier and shift scenarios.\u003c/p\u003e\n \u003cp\u003eThe improved performance of XGBoost compared to logistic regression suggests that nonlinear relationships between biochemical variables may contribute to improved detection of analytical errors.\u003c/p\u003e\n\u003c/div\u003e"},{"header":"Discussion","content":"\u003cp\u003eThis study demonstrates the feasibility of using machine learning to detect analytical errors in clinical chemistry using population-derived biochemical data. The XGBoost model significantly outperformed logistic regression, highlighting the advantage of nonlinear models in capturing complex relationships in laboratory data [\u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eThe model showed strong performance in detecting systematic errors such as drift and noise. These types of errors introduce consistent patterns across observations, making them more detectable using ML-based approaches. Similar findings have been reported in studies evaluating PBRTQC and ML-based error detection methods [\u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e, \u003cspan citationid=\"CR8\" class=\"CitationRef\"\u003e8\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eHowever, detection performance was lower for outlier and shift scenarios. Outliers represent isolated anomalies that lack consistent patterns, while calibration shifts may mimic physiological variability within normal ranges. These findings align with previous studies indicating limitations of current QC approaches in detecting certain types of analytical errors [\u003cspan citationid=\"CR7\" class=\"CitationRef\"\u003e7\u003c/span\u003e, \u003cspan citationid=\"CR8\" class=\"CitationRef\"\u003e8\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eFrom a laboratory perspective, the ability to detect gradual analytical drift is particularly valuable, as such errors may accumulate over time and remain undetected by conventional QC procedures. The model's strong performance in drift scenarios suggests its potential for real-time monitoring of analyzer performance.\u003c/p\u003e \u003cp\u003eFrom an industry perspective, these results support the potential integration of ML-based QC systems into automated analyzers developed by companies such as Abbott Laboratories and Beckman Coulter. Real-time detection of analytical errors could enhance laboratory reliability and improve patient safety.\u003c/p\u003e"},{"header":"Limitation","content":"\u003cp\u003eThe use of simulated analytical errors represents a limitation, as real-world instrument behavior may be more complex. Future studies incorporating instrument-generated QC data are needed to validate these findings.\u003c/p\u003e"},{"header":"Conclusion","content":"\u003cp\u003eMachine learning models, particularly XGBoost, demonstrate potential for detecting analytical errors in clinical chemistry using routine biochemical data. These approaches may complement existing quality control strategies and support improved monitoring of analytical performance in clinical laboratories.\u003c/p\u003e \u003cp\u003eThese findings support the integration of data-driven quality control approaches into automated clinical chemistry systems to improve analytical reliability and patient safety.\u003c/p\u003e"},{"header":"Declarations","content":"\u003cp\u003e \u003ch2\u003eEthical approval:\u003c/h2\u003e \u003cp\u003eNo human subjects were directly involved in this study. All data were obtained from publicly available, de-identified datasets (NHANES), and therefore, ethical approval was not required.\u003c/p\u003e \u003c/p\u003e \u003cp\u003e \u003cstrong\u003eConflicts of interest:\u003c/strong\u003e \u003cp\u003eThe author declares no conflict of interest.\u003c/p\u003e \u003c/p\u003e\u003ch2\u003eFunding:\u003c/h2\u003e \u003cp\u003eThis research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors.\u003c/p\u003e\u003ch2\u003eAuthor Contribution\u003c/h2\u003e\u003cp\u003eS.D. conceived the study, designed the simulation framework, curated and preprocessed the data, developed the machine learning models, performed the analyses, and wrote the manuscript. H.P. contributed to study design, assisted with data simulation and model evaluation, and reviewed and edited the manuscript. All authors read and approved the final version of the manuscript.\u003c/p\u003e\u003ch2\u003eData Availability\u003c/h2\u003e\u003cp\u003eYes. I used or generated research data in this study.This study used publicly available, de‑identified NHANES biochemical data and generated simulated analytical error scenarios (drift, shift, noise, outliers, mixed patterns) to create the analytical dataset used for machine learning model development and evaluation.\u003c/p\u003e"},{"header":"References","content":"\u003col\u003e\u003cli\u003e\u003cspan\u003eLorde N, Mahapatra S, Kalaria T. Machine learning for patient-based real-time quality control (PBRTQC), analytical and preanalytical error detection in clinical laboratory. Diagnostics (Basel). 2024;14(16):1808.\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eSpies NC, et al. Validating, implementing, and monitoring machine learning solutions in the clinical laboratory. Clin Chem. 2024;70(11):1334\u0026ndash;1343.\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eBadrick T, Bietenbeck A, Cervinski MA, Katayev A, van Rossum HH, Loh TP. Patient-based real-time quality control: review and recommendations. Clin Chem. 2019;65(8):962\u0026ndash;971.\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003evan Rossum HH. When internal quality control is insufficient or inefficient: consider patient-based real-time quality control. Ann Clin Biochem. 2020;57(3):198\u0026ndash;201.\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eZhou B, Li X, Cheng S, Zhou Z, Kang H. Patient-based pre-classified real-time quality control with neural network. Pract Lab Med. 2025;e00506.\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eDean P, Badrick T. Why is the adoption of patient-based real-time quality control still limited? J Lab Precis Med. 2025;10:54. doi:\u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003e10.21037/jlpm-24-54\u003c/span\u003e\u003cspan address=\"10.21037/jlpm-24-54\" targettype=\"DOI\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e.\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eLu Y, Yang F, Wen D, Shi K, Gu Z, Lu Q, et al. Assessment of patient-based real-time quality control on comparative assays for common clinical analytes. J Clin Lab Anal. 2022;36:e24651. doi:\u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003e10.1002/jcla.24651\u003c/span\u003e\u003cspan address=\"10.1002/jcla.24651\" targettype=\"DOI\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e.\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eDuan X, Wang B, Zhu J, Shao W, Wang H, Shen J, et al. Assessment of patient-based real-time quality control algorithm performance on different types of analytical error. Clin Chim Acta. 2020;511:329\u0026ndash;335.\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eLoh TP, Bietenbeck A, Cervinski MA, van Rossum HH, Katayev A, Badrick T. Recommendation for performance verification of patient-based real-time quality control. Clin Chem Lab Med. 2020;58(8):1205\u0026ndash;1213.\u003c/span\u003e\u003c/li\u003e \u003cli\u003e\u003cspan\u003eWestgard JO. Basic QC practices: training in statistical quality control for healthcare laboratories. 4th ed. Madison: Westgard QC Inc; 2016.\u003c/span\u003e\u003c/li\u003e\u003c/ol\u003e"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":true,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Machine learning, Clinical chemistry, Analytical error, Quality control, XGBoost, NHANES","lastPublishedDoi":"10.21203/rs.3.rs-9522381/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-9522381/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003ch2\u003eObjectives:\u003c/h2\u003e \u003cp\u003eAnalytical errors in clinical chemistry laboratories, including drift, calibration shifts, and imprecision, can compromise test accuracy and affect clinical decision-making. Conventional quality control methods may fail to detect subtle or evolving analytical deviations. This study evaluates the performance of machine learning approaches for detecting analytical errors using population-derived biochemical data.\u003c/p\u003e\u003ch2\u003eDesign and Methods:\u003c/h2\u003e \u003cp\u003eBiochemical data from the National Health and Nutrition Examination Survey (NHANES) were used, including glucose, high-density lipoprotein (HDL), and triglycerides. Synthetic analytical error scenarios (drift, shift, noise, outliers, and mixed patterns) were introduced to simulate instrument-related variability. A balanced dataset (n\u0026thinsp;=\u0026thinsp;29,046) was created using random downsampling. Logistic regression and XGBoost models were developed and evaluated using stratified training and testing datasets. Performance metrics included accuracy, sensitivity, specificity, F1-score, and ROC-AUC.\u003c/p\u003e\u003ch2\u003eResults:\u003c/h2\u003e \u003cp\u003eThe XGBoost model demonstrated superior performance compared to logistic regression (accuracy 0.74 vs 0.57; sensitivity 0.67 vs 0.51; specificity 0.82 vs 0.64; ROC-AUC 0.81 vs 0.59). Detection was highest for systematic errors such as drift and noise, while performance was lower for outlier and shift scenarios.\u003c/p\u003e\u003ch2\u003eConclusions:\u003c/h2\u003e \u003cp\u003eMachine learning models, particularly XGBoost, show strong potential for detecting analytical errors in clinical chemistry using routine patient data. These approaches may complement existing quality control strategies and enhance laboratory performance monitoring.\u003c/p\u003e","manuscriptTitle":"Machine Learning–Based Detection of Analytical Errors in Clinical Chemistry: A Simulation Study Using Population-Derived Biochemical Data","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2026-04-28 13:06:49","doi":"10.21203/rs.3.rs-9522381/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"af411540-f4a0-47b1-bc8f-210bfe7d39f3","owner":[],"postedDate":"April 28th, 2026","published":true,"recentEditorialEvents":[{"type":"decision","content":"Withdrawn","date":"2026-05-06T11:05:06+00:00","index":"","fulltext":""},{"type":"editorAssigned","content":"","date":"2026-04-30T11:14:55+00:00","index":"","fulltext":""},{"type":"checksComplete","content":"","date":"2026-04-30T11:14:04+00:00","index":"","fulltext":""}],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2026-05-06T11:11:29+00:00","versionOfRecord":[],"versionCreatedAt":"2026-04-28 13:06:49","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-9522381","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-9522381","identity":"rs-9522381","version":["v1"]},"buildId":"XKTyCvWXoU3ODBz1xrDgd","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.