How the AI Works
Eight transparent stages from symptom intake to expert validation. The prototype intentionally uses rule-based logic so that every recommendation is auditable.
1. Symptom input
Clinicians enter standardized features — erythema severity, diffuse redness, scaling, pustules, BSA %, itching, burning, joint pain, fever, pregnancy, herbal allergy history. Fields map to the project's ML feature schema for downstream reproducibility.
2. Rule-based syndrome prediction
A deterministic rule engine maps symptom combinations to TTM syndrome IDs (e.g. wind-heat, blood-heat, blood-deficiency-wind-dryness). Output includes a syndrome ID, risk level, referral label, confidence score, and human-readable reasoning text. No opaque ML in the prototype.
3. Knowledge base lookup
The predicted syndrome ID keys into curated tables — explainability_traces, therapeutic_directions, clinical_safety_rules, and knowledge_consensus. The Evidence Panel renders the supporting evidence with source IDs and citation context.
4. Clinical safety rules
clinical_safety_rules entries trigger before therapeutic display. Rules can escalate referral level (e.g. urgent_referral), block suggestions, or require expert review — for fever, pustular presentation, pregnancy, or extensive BSA.
5. Explainability traces
Each prediction shows the trace path: input trigger → symptom → element → pathogenesis → syndrome → therapeutic direction → safety rule → final action — with Thai-language explanation and an evidence_source_id citation.
6. Consensus evidence
knowledge_consensus indicates whether multiple sources agree on the interpretation. Levels render as high (green), medium (yellow), or low (red), and flag when expert review is recommended.
7. Clinician override
The clinician can agree, modify, or override. Disagreement is captured with a rationale, the clinician's syndrome opinion, and an optional urgent-referral safety flag — stored to clinician_observations for audit. The clinician's decision is final.
8. Validation workflow
Expert reviewers rate each case on five 1–5 dimensions: clinical usefulness, explanation clarity, safety appropriateness, evidence trustworthiness, and workflow usability — stored to expert_validations and summarized on the Research page.