🧠 Implemented hospital baseline architectureארכיטקטורת בסיס ממומשת לבית חולים

From incomplete hospital records to a leakage-resistant research prediction pipeline

The hospital architecture separates cohort eligibility, preprocessing, model fitting and threshold selection. Missingness is handled inside cross-validation, imaging is not required, and no heuristic is presented as a trained hospital model.

מרשומות בית חולים חלקיות אל Pipeline מחקרי המונע דליפת מידע

הארכיטקטורה מפרידה בין זכאות לעוקבה, עיבוד מקדים, אימון המודל ובחירת הסף. הטיפול בחוסרים מתבצע בתוך Cross-Validation, אין דרישה להדמיה, ואין הצגה של נוסחת גיבוי כמודל בית חולים מאומן.

0–24h
Input windowחלון קלט
8/16
Minimum core coverageכיסוי ליבה מינימלי
≥80%
Primary feature availabilityזמינות מאפיין ראשי
5-fold
Stratified CVCross-Validation מרובד
98%
Target sensitivityרגישות יעד

End-to-end model architecture

This diagram reflects the implemented hospital training path in the repository. The final hospital coefficients and performance are not yet available because hospital data have not yet been supplied.

ארכיטקטורת המודל מקצה לקצה

התרשים משקף את מסלול האימון הממומש במאגר. המקדמים והביצועים הסופיים בבית החולים עדיין אינם זמינים, משום שטרם התקבל מאגר בית החולים.

Research statusThe architecture is implemented, but the hospital model has not yet been fitted, calibrated or externally validated. It must not be used for patient-care decisions.
מצב מחקריהארכיטקטורה ממומשת, אך מודל בית החולים טרם אומן, כויל או עבר אימות חיצוני. אין להשתמש בו לקבלת החלטות רפואיות.
1

Hospital inputsקלט בית חולים

  • Demographics
  • Vital signs
  • Laboratory results
  • Comorbidities
  • Habits and home medications
  • דמוגרפיה
  • מדדים חיוניים
  • בדיקות מעבדה
  • מחלות רקע
  • הרגלים ותרופות קבועות
2

Eligibility gateשער זכאות

  • Adult encounter
  • Documented acute pancreatitis
  • Lipase or amylase ≥3× ULN
  • Outcome follow-up available
  • At least 8/16 core groups
  • אשפוז של בגיר
  • אבחנת AP מתועדת
  • ליפאז או עמילאז ≥3× ULN
  • מעקב תוצא זמין
  • לפחות 8/16 קבוצות ליבה
3

Canonical preparationהכנה קנונית

  • SI/legacy unit reconciliation
  • BMI and MAP
  • Shock index
  • NLR
  • CRP/albumin
  • Lipase/ULN and amylase/ULN
  • איחוד יחידות SI ויחידות ישנות
  • BMI ו־MAP
  • Shock Index
  • NLR
  • יחס CRP/אלבומין
  • יחסי אנזים/ULN
4

Feature contractחוזה מאפיינים

  • Candidate predictors only
  • Primary availability ≥80%
  • Outcomes and post-window treatment removed
  • Numeric and categorical lists frozen
  • משתני ניבוי בלבד
  • זמינות ראשית ≥80%
  • הסרת תוצאים וטיפול לאחר החלון
  • הקפאת רשימות מספריות וקטגוריאליות
5

Stratified 5-fold CVCV מרובד ב־5 קפלים

  • Shuffle with fixed seed
  • Preprocessing fitted only on training fold
  • Out-of-fold probabilities retained
  • No whole-dataset imputation
  • ערבוב עם seed קבוע
  • עיבוד מותאם רק על קפל האימון
  • שמירת הסתברויות Out-of-Fold
  • ללא אימפוטציה על כל המאגר
6

Balanced classifierמסווג מאוזן

  • Logistic regression baseline
  • Class weight: balanced
  • Solver: liblinear
  • Maximum 3,000 iterations
  • Binary severe-AP probability
  • בסיס Logistic Regression
  • Class weight מאוזן
  • Solver מסוג liblinear
  • עד 3,000 איטרציות
  • הסתברות בינארית ל־SAP
7

Threshold and bundleסף וחבילת מודל

  • Target sensitivity: 98%
  • Maximise specificity among eligible thresholds
  • Fit final pipeline on development cohort
  • Store features, threshold, availability and metrics
  • רגישות יעד: 98%
  • מקסום סגוליות בין הספים המתאימים
  • אימון Pipeline סופי על עוקבת הפיתוח
  • שמירת מאפיינים, סף, זמינות ומדדים
Preprocessing branches inside every training foldענפי עיבוד מקדים בתוך כל קפל אימון

🔢 Numeric branchענף מספרי

Raw numeric fieldsשדות מספריים גולמיים
Median imputationאימפוטציית חציון
Missing indicatorsדגלי חוסר
StandardScaler

🔤 Categorical branchענף קטגוריאלי

Raw categoriesקטגוריות גולמיות
Most-frequent imputationאימפוטציית השכיח
OneHotEncoder
Unknown values ignoredהתעלמות מערכים חדשים
Hospital record
  → eligibility + completeness audit
  → canonical units + derived features
  → availability-based feature selection
  → StratifiedKFold(5)
      → numeric: median imputer + missing indicators + scaling
      → categorical: most-frequent imputer + one-hot encoding
      → LogisticRegression(class_weight="balanced", solver="liblinear")
  → out-of-fold probabilities
  → threshold targeting sensitivity ≥ 0.98
  → final serialised model bundle
  → /predict: severe-AP probability + thresholded risk group

Exact implementation contract

The architecture deliberately distinguishes essential cohort fields from predictors and prevents outcome or treatment leakage.

חוזה המימוש המדויק

הארכיטקטורה מפרידה בכוונה בין שדות הכרחיים להגדרת העוקבה לבין משתני ניבוי, ומונעת דליפת תוצאים או טיפול.

ComponentרכיבImplemented designמימושReasonסיבה
Input windowFirst 24 hours from T0Keeps prediction temporally defined.מגדיר במדויק את זמן התחזית.
ImagingNot requiredThe current hospital dataset specification has no structured imaging fields.במפרט הנוכחי אין שדות הדמיה מובנים.
Feature selectionAvailability threshold, default 0.80Avoids building the primary model around rarely ordered tests.מונע תלות של המודל הראשי בבדיקות נדירות.
Numeric missingnessMedian + missing indicatorRetains partial cases and preserves whether a value was absent.משמר מקרים חלקיים ואת עצם היעדר הערך.
Categorical missingnessMost frequent + one-hotProvides a reproducible baseline for structured categories.מספק בסיס ניתן לשחזור למשתנים קטגוריאליים.
ClassifierBalanced logistic regressionInterpretable, stable baseline before comparing more complex models.בסיס פרשני ויציב לפני השוואה למודלים מורכבים יותר.
ValidationOut-of-fold predictions from stratified 5-fold CVThreshold selection is based on held-out fold predictions.בחירת הסף מבוססת על תחזיות מקפלים שלא שימשו לאימון.
Operating pointTarget sensitivity 0.98; maximise specificityPrioritises a high-sensitivity research operating point.מעדיף נקודת הפעלה מחקרית בעלת רגישות גבוהה.
Runtime safetyNo trained bundle → HTTP 503Prevents an untrained heuristic from appearing as a validated hospital model.מונע הצגת נוסחה לא מאומנת כמודל בית חולים תקף.

Derived features and safeguards

Feature engineering is deterministic and fitted values are kept separate from clinical outcome fields.

מאפיינים נגזרים ואמצעי הגנה

הנדסת המאפיינים דטרמיניסטית, וערכי הניבוי נשמרים בנפרד משדות התוצא הקליניים.

📐

Unit normalisationנרמול יחידות

Urea/BUN, creatinine, glucose, calcium, albumin, bilirubin and triglycerides can be reconciled between SI and legacy units.ניתן לאחד אוראה/BUN, קריאטינין, גלוקוז, סידן, אלבומין, בילירובין וטריגליצרידים בין יחידות SI ליחידות ישנות.

Ratiosיחסים

NLR, CRP/albumin, lipase/ULN, amylase/ULN and shock index.

🧮

Calculated measuresמדדים מחושבים

BMI and mean arterial pressure are derived only when their required source measurements are present.

🚫

Leakage exclusionsהחרגות למניעת דליפה

Persistent organ failure, ICU admission, later ventilation, renal replacement therapy, length of stay, mortality and discharge disposition are not predictors.כשל איברים מתמשך, טיפול נמרץ, הנשמה מאוחרת, דיאליזה, משך אשפוז, תמותה ויעד שחרור אינם משתני ניבוי.

🧾

Audit outputsפלטי ביקורת

Case eligibility, core coverage, selected features, feature availability, threshold and metrics are exported.מיוצאים זכאות המקרה, כיסוי הליבה, המאפיינים שנבחרו, זמינותם, הסף והמדדים.

📊

Reported metricsמדדים מדווחים

Out-of-fold AUROC, average precision, F1, F2, sensitivity, specificity and confusion-matrix counts.

Hospital baseline versus public-data experiments

The implemented hospital path starts with an interpretable logistic-regression baseline. Other algorithms remain exploratory comparisons until they are retrained and evaluated under the same hospital pipeline.

בסיס בית החולים לעומת ניסויים בנתונים ציבוריים

מסלול בית החולים הממומש מתחיל ב־Logistic Regression פרשני. אלגוריתמים אחרים נשארים השוואות חקרניות עד שיאומנו וייבדקו מחדש תחת אותו Pipeline בית חולים.

Model familyמשפחת מודלCurrent roleתפקיד נוכחיHospital deployment statusמצב פריסה בבית חולים
Balanced Logistic RegressionImplemented primary hospital baselineבסיס בית החולים הראשי הממומשAwaiting hospital trainingממתין לאימון
Random Forest / Gradient BoostingExploratory public-cohort comparisonהשוואה חקרנית בעוקבה ציבוריתNot fitted locallyלא אומן מקומית
XGBoost / LightGBM / CatBoostExploratory GBDT comparisonהשוואת GBDT חקרניתNot fitted locallyלא אומן מקומית
MLP / Residual MLP / Attention MLPExploratory neural comparisonהשוואה נוירונית חקרניתNot fitted locallyלא אומן מקומית
NGBoost / EBMExploratory probabilistic and interpretable comparisonהשוואה חקרנית הסתברותית ופרשניתNot fitted locallyלא אומן מקומית
Why start with logistic regression?It provides a transparent, regularised baseline for checking the cohort definition, units, missingness patterns, calibration and threshold policy before introducing higher-capacity models.
מדוע להתחיל ב־Logistic Regression?הוא מספק בסיס שקוף ויציב לבדיקת הגדרת העוקבה, היחידות, דפוסי החוסר, הכיול ומדיניות הסף לפני הכנסת מודלים בעלי קיבולת גבוהה יותר.

Inference architecture

The online research API applies the fitted feature contract rather than rebuilding preprocessing from request data.

ארכיטקטורת החיזוי

ה־API המחקרי המקוון מפעיל את חוזה המאפיינים שאומן, במקום לבנות עיבוד מקדים מחדש מנתוני הבקשה.

1️⃣

Validate requestבדיקת הבקשה

Adult age, documented AP, enzyme criterion, 8/16 coverage and presence of vital and laboratory information.גיל בגיר, AP מתועד, קריטריון אנזימים, כיסוי 8/16 ונוכחות מידע חיוני ומעבדתי.

2️⃣

Rebuild canonical featuresבניית מאפיינים קנוניים

Normalise units and calculate the same deterministic derived variables used during training.נרמול יחידות וחישוב אותם משתנים נגזרים דטרמיניסטיים ששימשו באימון.

3️⃣

Enforce fitted feature orderאכיפת סדר המאפיינים

Missing fitted fields remain missing and are handled by the stored pipeline.מאפיינים חסרים נשארים חסרים ומטופלים על ידי ה־Pipeline השמור.

4️⃣

Generate probabilityיצירת הסתברות

The serialised estimator returns a severe-AP probability.המסווג השמור מחזיר הסתברות ל־SAP.

5️⃣

Apply stored thresholdהפעלת הסף השמור

The bundle threshold creates the research risk group; it is not a treatment recommendation.סף החבילה יוצר קבוצת סיכון מחקרית ואינו המלצת טיפול.

🛑

Fail safelyכשל בטוח

When no trained hospital bundle is configured, the endpoint returns HTTP 503.כאשר לא הוגדרה חבילת מודל מאומנת, נקודת הקצה מחזירה HTTP 503.

Next step: train on a governed hospital cohortהשלב הבא: אימון על עוקבת בית חולים תחת ממשל נתונים

The architecture is ready for local mapping, feasibility analysis, retrospective training, calibration and external validation under hospital and ethics oversight.

הארכיטקטורה מוכנה למיפוי מקומי, בדיקת היתכנות, אימון רטרוספקטיבי, כיול ואימות חיצוני תחת פיקוח בית החולים והוועדה האתית.