Skip to content
prof-chatchaiPublic

About

Safety-first Abstention-enabled Formal triage Engine with parallel GATEs for medical AI systems with provable safety guarantees

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

60 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Safety-First Gated Triage with Conservative Risk Merging (SAFE-Gate)

One command regenerates every number of the IJFS paper: an ordinal aggregation operator (ACWCM) that never dilutes a critical gate output, compared with Sugeno, OWA, belief-function and learned baselines on frozen, never-scored synthetic cohorts.

License Python

Overview

SAFE-Gate merges six hand-written triage gates with Adaptive Confidence-Weighted Conservative Merging (ACWCM): the most cautious gate output is returned and relaxed by one tier only when a weighted quota of the confidence lies above it; R1 and abstention are absorbing and a floor of R2 is never relaxed. These are merge-level properties (CP, AC, CND), computed per decision in the audit trail. They are not clinical safety: the system can only keep a critical case that some gate flags. All data are synthetic; nothing here is clinically validated.

Key results (release v2.0.0-ijfs)

  • Exhaustive counts over 5^6 tier profiles x 8 confidence profiles: ACWCM never breaks CP or CND; every Sugeno, OWA, prioritized, TSK and Dempster-Shafer variant tested does. ACWCM is not smooth: a one-tier input change can move the output by two tiers.
  • Fresh cohorts frozen before scoring (results/round4_protocol.json): critical sensitivity 94.9% (independent generator) and 89.7% (diagnosis-conditioned generator), 0 false discharges, equal to the gate-recall bound; over-triage 29.6% and 60.9%; R3-conditional under-triage 32.3% and 36.7%. Dempster-Shafer: 84.3% and 80.6% with 7 and 9 false discharges. The minimum, normalised weighted max, consonant belief-median and min-cost BMA rules are about as safe as ACWCM.
  • Development cohort (seed 42; its test split was scored in earlier rounds): 175/175 critical, accuracy 82.5%, over-triage 6.2%, 30.3% of R3 cases under-triaged by one tier.
  • The calibration v2 chosen for accuracy is less robust than a robustness-aware choice (89.7% vs 93.3% critical sensitivity on the diagnosis-conditioned cohort).

See REPRODUCIBILITY.md for the full protocol.

Repository structure

src/            ACWCM merge, six gates, risk lattice, counterfactual explanation records, baselines
data/           Synthetic generator + train/val/test JSON splits (4797 / 798 / 805)
results/        Metrics regenerated by run_all.py (summary.json, safety_check.json, CSVs)
evaluation/     Figure scripts + exported manuscript/supplementary figures (PNG/PDF)
scripts/        Evaluation driver and manifest generation
tests/          Full-system behaviour checks
run_all.py      One-command reproduction entry point

Installation

git clone https://github.com/ChatchaiTritham/SAFE-Gate.git
cd SAFE-Gate
python -m venv .venv && source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt

Reproducing the results

python run_all.py --round4   # pinned env: pip install -r requirements.lock

The driver regenerates the synthetic cohort, runs SAFE-Gate plus the baselines, evaluates the safety properties, and writes results/summary.json, results/safety_check.json, results/theorem_verification.json, and the per-tier, baseline, ablation, and confusion-matrix CSVs. Every metric is computed from a fixed seed, so a second run reproduces the same values; the determinism of the pipeline has been confirmed by repeated execution.

Figures

FIGURE_MANIFEST.csv lists the manuscript and supplement figures, produced by evaluation/generate_manuscript_figures.py from results/. evaluation/generate_figures_from_results.py is a legacy dashboard script.

Data

No human subjects are involved and no ethics approval is required. All cohorts are synthetic and regenerated from seeds (see REPRODUCIBILITY.md). The development cohort has 6,400 vertigo-triage cases with 52 clinical features, generated under seed 42 and split into 4,797 training, 798 validation, and 805 test cases (data/synthetic/). The generator lives in data/generation/, so the data can be rebuilt rather than trusted as a static dump.

Citation

@unpublished{tritham_safegate,
  author = {Tritham, Chatchai and Snae Namahoot, Chakkrit},
  title  = {Safety-First Gated Triage with Conservative Risk Merging},
  note   = {Manuscript under review},
  year   = {2026}
}

License

Released under the MIT License (see LICENSE).

Contact

Chatchai Tritham — Department of Computer Science and Information Technology, Faculty of Science, Naresuan University, Phitsanulok 65000, Thailand. Email: [email protected] · ORCID: 0000-0001-7899-228X Chakkrit Snae Namahoot — same affiliation. Email: [email protected] · ORCID: 0000-0003-4660-4590

Portfolio relationship

Repository Role
BASICS-CDSS Beyond-accuracy evaluation methodology
TRI-X Framework-level package
ORASR Routing and safety-action component
DRAS-5 Dynamic risk-state component
SAFE-Gate Safety-gated ensemble framework
SynDX Synthetic validation and explainability evidence
SURgul SRGL/governance reproducibility component
TRI-X-CDSS Integration and implementation package
Selective-CDSS Risk-controlled selective-prediction (abstention) component
Causal-CDSS Causal-inference evaluation component
Beyond-Accuracy Simulation-based safety/calibration evaluation framework

About

Safety-first Abstention-enabled Formal triage Engine with parallel GATEs for medical AI systems with provable safety guarantees

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages