Routine health records can flag hidden hepatitis C before diagnosis

An explainable machine-learning model built from ordinary electronic health record data identified undiagnosed hepatitis C across a large public health system in southern Spain, offering a way to search for silent infection without relying on new laboratory campaigns or costly universal screening. The preprint focuses on a stubborn gap in elimination efforts: even after direct-acting antivirals transformed treatment, an estimated 25% to 30% of active infections in Spain still remain undiagnosed. In practical terms, that means many patients continue to move through clinics with subtle laboratory abnormalities or comorbidity patterns that never trigger HCV testing.

The model was designed to work with the data already embedded in routine care. Investigators used the Andalusian Population Health Database and assembled a retrospective, population-based cohort of people diagnosed with HCV between 2017 and 2024, totaling 25,028 cases. Those cases were matched to controls by birth year, sex, and health district, then used to train an Explainable Boosting Machine on 2017 to 2022 data. A threshold was selected in a 2023 validation set to preserve at least 60% sensitivity, and the final model was then tested unchanged in an independent 2024 sample designed to approximate real-world screening conditions.

A screening tool tested at population prevalence, not just in enriched data

The test set matters because it was not shaped by the same matching framework used in development. It was independent, non-matched, and population-representative, which makes performance more relevant to a real screening workflow where the background prevalence is low and the signal is easy to miss. In that setting, the model achieved an area under the curve of 0.837, with sensitivity of 63.5%, specificity of 91.8%, positive predictive value of 7.0%, and negative predictive value of 99.6%.

That combination tells a clinically useful story. The model was not built to “diagnose” HCV on its own; it was built to sort through routine data and surface people who deserve confirmatory testing. The low positive predictive value is unsurprising in a setting where hidden HCV is uncommon, yet the very high negative predictive value suggests the tool could safely exclude large numbers of people from further workup while preserving a manageable pool for targeted testing. In a screening environment, that is the difference between a vague data exercise and a workable operational filter.

Laboratory patterns and comorbidity signals carried the strongest weight

The most influential variables were clinically recognizable rather than opaque machine-learning artifacts. Minimum alanine aminotransferase, HIV infection, dependence on non-tobacco substances, and platelet-count statistics emerged as leading predictors, forming a profile consistent with chronic liver injury, shared transmission risk, and hematologic changes that often accompany advanced liver disease. The model’s behavior appears coherent with bedside hepatology: transaminase abnormalities can reflect ongoing hepatic inflammation, platelet reductions can track portal hypertension or fibrosis, and HIV or substance-use diagnoses often identify overlapping risk networks in which HCV circulates silently.

Age and sex were excluded as predictors because they had already been used for matching, preventing the model from leaning on those broad demographic features as shortcuts. Predictors reflecting socioeconomic proxies or matching artifacts were also removed after explainability review, including pharmaceutical co-payment category and a zone-level deprivation index. Bias auditing was not an afterthought here; it was integrated into model curation. The resulting system was designed to favor biologically and clinically grounded information over variables that might simply encode health-system access or administrative structure.

The choice matters because HCV detection tools can easily drift toward social proxies that mirror access to care rather than infection risk itself. An algorithm that flags poverty-linked patterns without clinical justification may appear accurate while perpetuating inequity. By stripping out those variables after explainability review, the investigators tried to preserve relevance to disease biology and reduce the chance that the model would simply replicate who gets tested more often.

Why this approach fits the elimination phase of HCV control

The logic behind the model is straightforward: hidden HCV is rarely invisible to the health system. Even when a patient has never had a recorded HCV diagnosis, the record may contain lab abnormalities, comorbid infections, substance-use history, or other signatures that cluster around undetected disease. Machine learning is useful here not because it replaces clinical judgment, but because it can search across many weak clues at once and rank patients by probability more efficiently than manual chart review.

That advantage becomes more important as countries move from broad treatment expansion toward the last mile of elimination. At that stage, the remaining undiagnosed cases are harder to find because they are distributed across ordinary outpatient records rather than high-risk specialty clinics. A tool that is explainable, bias-audited, and based only on routinely collected data has a plausible path into public health workflows, especially if it can be embedded inside existing health systems without requiring new data capture.

A promising model, still a preprint, with implementation questions left open

The preprint argues that discrimination was comparable to previously published tools, while being evaluated under conditions closer to true population prevalence. It also shows that bias review can be incorporated without destroying interpretability. Those are real strengths, but they do not erase the limits of the current evidence. This remains a preprint, not yet certified by peer review, and the exact performance in other regions, different health systems, or settings with other testing habits is unknown.

The most important unanswered operational question is not whether the model can score well in Andalusian records, but how it will behave when deployed into daily practice: which patients it would actually route to confirmatory testing, how many additional diagnoses it would produce, and whether clinicians would trust its recommendations enough to use them consistently. The preprint establishes feasibility and gives a strong signal that hidden HCV can be surfaced from routine data. What it does not yet establish is the downstream impact on case finding, linkage to care, or elimination metrics once the model leaves the research environment.


Reporting by Dr. A.R. Athira, MBBS for Medicine World Foundation, with additional data provided by medRxiv (Clinical Preprints).