A tiered deep learning and symbolic reasoning framework for safe, explainable disease diagnosis
Abstract
This study introduces a modular, AI-powered disease diagnosis system that combines deep learning, neuro-symbolic reasoning, and structured automation to support early, scalable, and explainable clinical decision-making. Built upon the large-scale DDXPlus dataset, the system processes over one million patient records into standardized, multi-hot encoded vectors representing binary symptoms, normalized age, and sex, and addresses overlapping symptom profiles by stratifying diseases into three tiers—high, medium, and low symptom-overlap tiers—using Jaccard similarity. High-overlap tiers contain fewer but more symptomatically similar diseases; low-overlap tiers contain more diseases with distinct profiles. The core diagnostic model is a residual multilayer perceptron (MLP), trained separately for each tier with transfer learning, class weighting, label smoothing, and tier-specific loss masking to improve generalization and mitigate class imbalance, while a post-inference neuro-symbolic safety layer enforces ICD-10-aligned clinical rules, blocking unsafe or incomplete predictions and triggering context-sensitive follow-up questions when needed. The system is deployed via a FastAPI backend and orchestrated with an n8n-based automation pipeline, where a large language model (LLM) acts solely as a routing agent to ensure deterministic and auditable logic flows, enabling flexible deployment across telemedicine platforms, triage tools, and digital health assistants. By integrating symbolic reasoning with data-driven models in a fully automated pipeline, this approach advances AI-assisted diagnosis toward more trustworthy, interpretable, and clinically viable solutions.