Skip to main content

LUP Student Papers

LUND UNIVERSITY LIBRARIES

An Explainable AI and LLM-Assisted Framework for Within-Household SARS-CoV-2 Secondary Transmission Risk Prediction in Sweden

Du, Mingtong LU (2026) EITM02 20261
Department of Electrical and Information Technology
Abstract
Artificial intelligence (AI) is playing an expanding role in infectious disease surveillance and intervention planning by enabling analysis of large-scale health data. One of the key challenges in this area is to characterize transmission within households and to identify factors that influence both infectivity and susceptibility. The present study focuses on the COVID-19 pandemic, which not only generated unprecedented population-level data but also emphasized household secondary transmission as a central mechanism in the spread of respiratory infectious diseases.

Predicting the household secondary transmission risk at both the household and individual levels can provide complementary evidence for targeted public health intervention.
... (More)
Artificial intelligence (AI) is playing an expanding role in infectious disease surveillance and intervention planning by enabling analysis of large-scale health data. One of the key challenges in this area is to characterize transmission within households and to identify factors that influence both infectivity and susceptibility. The present study focuses on the COVID-19 pandemic, which not only generated unprecedented population-level data but also emphasized household secondary transmission as a central mechanism in the spread of respiratory infectious diseases.

Predicting the household secondary transmission risk at both the household and individual levels can provide complementary evidence for targeted public health intervention.
This thesis presents a multi-level explainable framework for predicting household SARS-CoV-2 secondary transmission risk, applied to the linked Swedish population and healthcare registers from the 2020 pre-vaccination period, covering 252,472 households and 608,473 individuals.

The system integrates two independent prediction tasks within a unified framework: a household-level classifier that estimates the transmission probability, and an individual-level predictor that estimates relative susceptibility scores for household members. Four classifiers (logistic regression, random forest, XGBoost, and TabPFN) are benchmarked at both levels. TabPFN, a transformer-based foundation model pre-trained on causally structured synthetic datasets via in-context learning, and XGBoost show comparable performance at both the household level (AUC-ROC: 0.645 vs. 0.641) and the individual level (0.717 vs. 0.726). The focus of this study lies not in prediction per se, but in generating interpretable insights into the determinants of household transmission. Explainability is achieved through a structured three-level KernelSHAP analysis, i.e., global population-wide attribution, subgroup stratification, and local instance-level decomposition. Finally, an LLM-based explanation agent translates model predictions and
SHAP attributions into plain-language narratives. Five frontier LLMs (Claude
Sonnet 4.5, GPT-5.3, Grok 4.2, DeepSeek V3.2, and Llama 4) were evaluated using a two-tier framework combining qualitative and quantitative metrics, which demonstrated the real-world application potential of LLMs.

The proposed framework integrates machine learning, explainable AI, and large language models to support more transparent and accessible public health decision-making. The code and materials for this work are publicly available at https://github.com/mingtongdu862-dot/covid19-household-transmission. (Less)
Popular Abstract
When a virus enters a home, who is at risk, and can Artificial Intelligence (AI)
help us answer that question in plain language?

When someone tests positive for COVID-19, the people living under the same roof face
an immediate and difficult situation. They have been exposed. They are sharing a
kitchen, a bathroom, the same air. Yet not every household member will get infected,
and not every home that harbours an infected person will spread the virus further.
Understanding which households are most likely to become outbreak clusters, and which
individuals within those homes are most vulnerable, is one of the practical challenges
at the heart of epidemic control.

Traditional epidemiological methods have taught us a great deal... (More)
When a virus enters a home, who is at risk, and can Artificial Intelligence (AI)
help us answer that question in plain language?

When someone tests positive for COVID-19, the people living under the same roof face
an immediate and difficult situation. They have been exposed. They are sharing a
kitchen, a bathroom, the same air. Yet not every household member will get infected,
and not every home that harbours an infected person will spread the virus further.
Understanding which households are most likely to become outbreak clusters, and which
individuals within those homes are most vulnerable, is one of the practical challenges
at the heart of epidemic control.

Traditional epidemiological methods have taught us a great deal about household
transmission: larger households carry more risk, older people are more susceptible,
and socioeconomic disadvantage amplifies vulnerability. These findings, however, are
based on relatively simple statistical models that struggle to capture the complex
web of interacting factors present in large-scale national health data. During the
COVID-19 pandemic, Sweden accumulated detailed records on millions of individuals:
where they lived, their age and income, their medical histories, and the timing of
their infections. This thesis asks whether modern artificial intelligence, applied to
these population-wide data, can predict household transmission risk more accurately
and more usefully than existing tools.

The answer requires solving three problems at once.

The first is prediction. We developed a machine learning system that works
at two complementary levels: it estimates the probability that transmission will
spread to at least one new person in a given household, and it identifies which
specific household members are most susceptible. Using data from 252,000 Swedish
households in 2020 (before vaccines were available), we tested four different
AI models. The most suitable one, called TabPFN, is unusual in that it was trained
not on medical data alone but on millions of artificial datasets designed to mimic
the kind of cause-and-effect relationships we expect to see in the real world. This
gave it a meaningful advantage, and its design opens the door for future work that could investigate causal relationships among risk factors.

The second problem is explainability. A prediction that cannot be explained
is a prediction that cannot be trusted, especially in a public health setting. We used
a technique called SHAP to open the black box of the AI model and examine which
factors drove each prediction. Across both the household
and individual prediction levels, family income was the most consistently present risk factor across both prediction levels, ranking first at the individual level and second at the household level, where the age of the index case was the primary driver, reflecting the real-world constraints of overcrowded housing, limited ability to
isolate a sick family member, and restricted access to protective resources. The age of
the person who first introduced the virus into the household was also critical; older
index cases appeared to pose a more intense and prolonged source of exposure for
everyone living with them. These findings mirror what epidemiologists already know from
classical studies, which tells us the AI model has learned something genuinely
meaningful rather than spurious statistical noise.

The third problem is communication. SHAP values and probability scores are
useful to an AI engineer but opaque to a public health officer or policymaker who needs
to decide where to direct limited intervention resources. To bridge this gap, we
connected the AI system to five state-of-the-art large language models,
type of technology that powers modern AI assistants. These models were given the AI's
predictions and explanations and asked to write plain-language summaries for a
non-technical audience. We designed an evaluation framework to check whether
the summaries were accurate, logically sound, epidemiologically correct, and
appropriately framed as model outputs rather than factual diagnoses. All five models achieved perfect scores on most evaluation dimensions, with expert epidemiological review conducted on a representative subset of outputs.

The broader message of this work is that factors such as income inequality and age leave clear and
consistent signatures in who is most at risk when a respiratory virus enters a home. Making them legible not
just to scientists, but to the decision-makers who could act on them, is a challenge
that modern AI is now well-equipped to address at a population scale. (Less)
Please use this url to cite or link to this publication:
author
Du, Mingtong LU
supervisor
organization
course
EITM02 20261
year
type
H2 - Master's Degree (Two Years)
subject
keywords
Explainable AI, Household secondary transmission, SHAP, SARS-CoV-2, Large Language Models, TabPFN.
report number
LU/LTH-EIT 2026-1136
language
English
id
9234032
date added to LUP
2026-06-10 13:07:23
date last changed
2026-06-10 13:07:23
@misc{9234032,
  abstract     = {{Artificial intelligence (AI) is playing an expanding role in infectious disease surveillance and intervention planning by enabling analysis of large-scale health data. One of the key challenges in this area is to characterize transmission within households and to identify factors that influence both infectivity and susceptibility. The present study focuses on the COVID-19 pandemic, which not only generated unprecedented population-level data but also emphasized household secondary transmission as a central mechanism in the spread of respiratory infectious diseases.

Predicting the household secondary transmission risk at both the household and individual levels can provide complementary evidence for targeted public health intervention. 
This thesis presents a multi-level explainable framework for predicting household SARS-CoV-2 secondary transmission risk, applied to the linked Swedish population and healthcare registers from the 2020 pre-vaccination period, covering 252,472 households and 608,473 individuals.

The system integrates two independent prediction tasks within a unified framework: a household-level classifier that estimates the transmission probability, and an individual-level predictor that estimates relative susceptibility scores for household members. Four classifiers (logistic regression, random forest, XGBoost, and TabPFN) are benchmarked at both levels. TabPFN, a transformer-based foundation model pre-trained on causally structured synthetic datasets via in-context learning, and XGBoost show comparable performance at both the household level (AUC-ROC: 0.645 vs. 0.641) and the individual level (0.717 vs. 0.726). The focus of this study lies not in prediction per se, but in generating interpretable insights into the determinants of household transmission. Explainability is achieved through a structured three-level KernelSHAP analysis, i.e., global population-wide attribution, subgroup stratification, and local instance-level decomposition. Finally, an LLM-based explanation agent translates model predictions and
SHAP attributions into plain-language narratives. Five frontier LLMs (Claude
Sonnet 4.5, GPT-5.3, Grok 4.2, DeepSeek V3.2, and Llama 4) were evaluated using a two-tier framework combining qualitative and quantitative metrics, which demonstrated the real-world application potential of LLMs. 

The proposed framework integrates machine learning, explainable AI, and large language models to support more transparent and accessible public health decision-making. The code and materials for this work are publicly available at https://github.com/mingtongdu862-dot/covid19-household-transmission.}},
  author       = {{Du, Mingtong}},
  language     = {{eng}},
  note         = {{Student Paper}},
  title        = {{An Explainable AI and LLM-Assisted Framework for Within-Household SARS-CoV-2 Secondary Transmission Risk Prediction in Sweden}},
  year         = {{2026}},
}