In Silico · system structure
Privacy-Preserving Synthetic Data Generation and TSTR Validation
Synthesises health tables under a privacy budget and decides release by train-on-synthetic, test-on-reference and privacy gates. The dispensing-audit kernel from the same work is shown with it.
What this work is
This work has two parts. The first generates synthetic copies of tabular multi-omics and clinical data under differential privacy (DP) and decides whether a table may be released, using TSTR (train on synthetic, test on real) and privacy gates. The second is a dispensing-audit kernel that compares pill-capture outputs with prescription records and sends every mismatched or undecidable case to pharmacist review.
Scope Both reference implementations run only on locked fixtures and data made by code: a toy multi-omics world for D2, and a synthetic gallery, simulated vision outputs, and orders and rules written in abstract codes for S1. They therefore show nothing about real patient cohorts (TCGA, GEO, MIMIC-IV), real pill images or prescriptions, or clinical performance.
D2 · Synthetic harness · synth8
Privacy-preserving synthetic data engine and TSTR validation harness
Generates synthetic tables of expression, methylation and clinical values under a differential-privacy budget, then decides whether a table may be released. Models trained on the table must keep their performance on reference test data, and the table must not reveal training rows. In this harness the "real" side is the reference cohort of a toy world made by code.
- Toy multi-omics worldFixture configuration, locked by SHA-256 → Training, held-out and public cohorts in native units
- Schema check and normalisationCohort rows in native units → Encoded feature rows, or violation codes
- Privacy ledgerSensitivity and noise scale of each private access → Ledger entries and the composed (ε, δ)
- Baseline DP generator G0Encoded training rows, public basis, privacy budget → Synthetic rows and ledger entries
- TSTR/TRTR preservation judgementSynthetic table in released form; reference train and test splits → Status per endpoint and an overall utility status
- DCR and MIA privacy gatesSynthetic, training, held-out and public rows → DCR status and MIA status with confidence bounds
- Release ruleFive gate states for one generator → Eligible or blocked, with blocker codes
- Independent auditRun evidence document and the locked fixture → Audit document with a status per gate
| Component | What it does | Input → output | Code |
|---|---|---|---|
| Toy multi-omics world | Builds a toy world from the locked fixture and draws training, held-out and public cohorts in native units. No real cohort is read. | Fixture configuration, locked by SHA-256 → Training, held-out and public cohorts in native units | synth8/ |
| Schema check and normalisation | Gives violation codes to rows with forbidden, unregistered or out-of-range fields, standardises with public parameters, corrects batch effects and restores native units. | Cohort rows in native units → Encoded feature rows, or violation codes | synth8/ |
| Privacy ledger | Records each operation that touches private rows as one entry and composes them into one (ε, δ) budget. A table whose generator has no ledger cannot be released. | Sensitivity and noise scale of each private access → Ledger entries and the composed (ε, δ) | synth8/ |
| Baseline DP generator G0 | Projects private rows onto a public basis, clips them, and adds Gaussian noise to cell counts, sums and a second moment. It samples rows from a model fitted to these. | Encoded training rows, public basis, privacy budget → Synthetic rows and ledger entries | synth8/ |
| TSTR/TRTR preservation judgement | Trains the same learners on synthetic (TSTR) and reference (TRTR) rows, scores both on one test split, and judges endpoints by preservation ratio and skill above chance. | Synthetic table in released form; reference train and test splits → Status per endpoint and an overall utility status | synth8/ |
| DCR and MIA privacy gates | Measures DCR (distance from each synthetic row to its closest training and held-out rows) and runs two membership-inference attacks (MIA), each with a confidence bound. | Synthetic, training, held-out and public rows → DCR status and MIA status with confidence bounds | synth8/ |
| Release rule | Combines schema, utility, DCR, MIA and ledger states into one verdict. Release needs a clean schema, a utility pass, a DCR pass, a confirmed MIA pass and a valid ledger. | Five gate states for one generator → Eligible or blocked, with blocker codes | synth8/ |
| Independent audit | Reads the run document without importing the solver and recomputes metrics, bounds, ledger arithmetic and verdicts in a second implementation. Reports four gate results. | Run evidence document and the locked fixture → Audit document with a status per gate | synth8/ |
Flow
- The orchestrator checks the fixture's SHA-256 lock, and the toy world draws training, held-out and public cohorts.
- Rows pass the schema check, are standardised with public parameters, and are batch-corrected with parameters fitted on the training split only.
- Five generators produce synthetic tables: G0 with a privacy ledger, and four with known answers (independent resample, full copy, partial copy, shuffled columns).
- Each table is decoded to native units, checked against the schema again, re-encoded, and used to train the fixed learners for the TSTR and TRTR comparison.
- The privacy gates compute DCR statistics and two MIA scores, and compare an empirical lower estimate of ε with the ledger's ε.
- The release rule turns the gate states into eligible or blocked, and the run is written as one evidence document carrying the SHA-256 of its body.
- The audit recomputes the run from its score, distance and label arrays and writes a separate audit document.
What is guarded
- The fixture is locked by SHA-256. If it has changed, the run stops before anything is computed.
- Evidence documents may hold only identifier-like code tokens and the arrays used for verdicts. Free text stops the run, and rows in native units are not written.
- Release needs both a valid ledger and a confirmed empirical privacy pass. A missing ledger, a budget overrun, or an empirical ε estimate above the ledger's ε blocks release.
- A preservation ratio alone cannot pass an endpoint. The reference model must be distinguishable from chance, and skill above chance must also be preserved.
- DCR tolerances are fixed from a null calibration (independent resamples of the toy world) before any synthetic table is examined. That calibration is kept apart from the frozen run.
- The audit does not import solver modules and checks that the four known-answer generators get their expected verdicts. If its first gate fails, the other gates are not evaluated and the audit fails.
Not built or not run
- The main generator G1 (conditional latent diffusion trained with DP-SGD, with a co-expression penalty) and the shared–private VAE exist only as equations and a PyTorch interface. No training was run; the code holds only the DP-SGD accounting and the clip-and-noise aggregate.
- Training and measurement on real cohorts (TCGA, GEO, MIMIC-IV) were not run. Every row comes from the toy world.
- The data-use-agreement precondition, which blocks generators trained on sources not reviewed for release, is a design rule for the real-data stage and is not part of the harness's release rule.
- Batch correction runs only without the covariate term and only for batches seen in training. Aligning batches that are absent from training is described but not run.
- Small-cohort procedures (institution-level cross-fitting, repeated half-split membership audits) and a separate, blinded evaluation environment are described for the real-data stage and were not run.
Result and documents
The decision apparatus classified 4 of 4 generators with known answers correctly. The differentially private baseline generator, measured at epsilon 2.0, kept 100.7% of C-index, 92.9% of macro-F1, 97.0% of AUROC and 94.5% of biomarker rank agreement relative to a model trained on the reference table of the same synthetic world. Only 2 of 4 endpoints reached the 95% threshold, and its noise was a seeded simulation, not a formal DP mechanism, so release was blocked. Its membership-inference AUROC was 0.510 (upper bound 0.539).
Synthetic inputs only (synthetic_only). These figures come from a synthetic multi-omics world generated by code. No real cohort (TCGA, GEO, MIMIC-IV) was evaluated, the main latent-diffusion generator was specified but not trained, and no auditor has signed the result.
Measured values, limits and gates on the D2 record · Privacy-Preserving Synthetic Multi-Omics Data
D2 design specification: privacy-preserving synthetic data and TSTR validation (KR) · D2 harness modules and replay record (KR) · D2 null calibration of the distance gate (KR) · D2 run digest without score arrays (KR) · D2 and S1 cross-model review record (KR) · Audit record (JSON)
S1 · Synthetic harness · dispense18
Dispensing audit kernel: pill verification and DUR cross-check
Assists a pharmacist's final check. It compares pill-capture outputs with a structured prescription record, applies DUR rules (drug utilisation review: contraindication and caution rules), and sends every mismatched or undecidable case to a forced-review queue. It does not create or change prescriptions.
- Synthetic observation layerLocked fixtures: gallery, gate configuration, case grids → Kernel inputs: order, patient facts, vision outputs
- DUR rule enginePatient facts, order lines, hash-pinned rule table → Verdict per rule and review reason codes
- Imprint matcher and confusion graphImprint read of both faces; gallery records → Distance and uniqueness gap; lockout set; categories
- Conformal exclusion test (Gate B)Cosine scores against every gallery product → Kept product set and Gate B reason codes
- Audit kernel (two-stage gate)One case: order, patient facts, vision outputs, config hashes → AUTO_PASS or REVIEW, reason codes, end state
- Audit trail ledgerDecision, reasons, input hash, configuration versions → Chained records, anchors and head hash
- Drift monitorConfirmed capture: product label and its margin → Alarm state that sets the kernel's drift latch
- Independent auditRun evidence document and the locked fixtures → Audit document with four gate statuses
| Component | What it does | Input → output | Code |
|---|---|---|---|
| Synthetic observation layer | Expands the locked fixtures into simulated vision outputs (scores, imprint reads, attributes, counts) and orders with SHA-256 counter-based randomness. No decision logic. | Locked fixtures: gallery, gate configuration, case grids → Kernel inputs: order, patient facts, vision outputs | dispense18/ |
| DUR rule engine | Judges each rule as FLAG, CLEAR or UNKNOWN and combines them with Kleene OR. Missing facts give UNKNOWN, never a default; dose comparisons use exact decimal arithmetic. | Patient facts, order lines, hash-pinned rule table → Verdict per rule and review reason codes | dispense18/ |
| Imprint matcher and confusion graph | Compares imprint reads with the gallery by an edit distance that is cheap for confusable characters and ignores face order. Builds the confusion graph and lockout set. | Imprint read of both faces; gallery records → Distance and uniqueness gap; lockout set; categories | dispense18/ |
| Conformal exclusion test (Gate B) | Sets per-category thresholds from calibration margins by a PAC order statistic, keeps every product it cannot exclude, and passes only if just the expected one is kept. | Cosine scores against every gallery product → Kept product set and Gate B reason codes | dispense18/ |
| Audit kernel (two-stage gate) | Runs eight stages in fixed order on untrusted vision outputs and collects every reason. AUTO_PASS needs every stage to pass and the record committed; all else is REVIEW. | One case: order, patient facts, vision outputs, config hashes → AUTO_PASS or REVIEW, reason codes, end state | dispense18/ |
| Audit trail ledger | Append-only SHA-256 hash chain of decision records with pseudonymised case IDs and input hashes. Opens only after chain, anchors and trusted head verify; never recreated. | Decision, reasons, input hash, configuration versions → Chained records, anchors and head hash | dispense18/ |
| Drift monitor | Scores each confirmed capture against its product's reference margins, then adds it. When the martingale on these p-values crosses its bar, later cases go to review. | Confirmed capture: product label and its margin → Alarm state that sets the kernel's drift latch | dispense18/ |
| Independent audit | Recomputes the run without solver imports: memoised edit distance, possible-worlds rule oracle, exact rational thresholds, declarative gate, fault table, chain verifier. | Run evidence document and the locked fixtures → Audit document with four gate statuses | dispense18/ |
Flow
- The orchestrator checks the SHA-256 lock on the fixtures, and the synthetic layer builds kernel inputs: an order, patient facts and simulated vision outputs.
- The kernel first checks the configuration hashes and calibration age, the drift latch, and the structure of the order.
- Gate A then checks the DUR rules, capture quality and two count estimates, imprint and attribute identity, and the lockout list.
- Gate B applies the conformal exclusion test to the score vector. The case passes only if the expected product is the single one left and its margin is high enough.
- The kernel gathers all reasons, decides AUTO_PASS or REVIEW, and commits a record to the hash-chained ledger. A failed commit ends in REVIEW and a safe halt.
- Confirmed captures update the drift monitor. Once it alarms, the latch sends every later case to review.
- The benchmark driver runs benchmark, scenario, boundary and fault-injection cases into one evidence document, and the audit recomputes it into a separate audit document.
What is guarded
- Fail-closed stages: a stage that raises an exception, reports ticks past the deadline, or returns a malformed result counts as a failure, so the case goes to review.
- No release without a committed record. A kernel with no ledger attached, or a failed commit, ends in REVIEW and SAFE_HALT.
- Vision outputs are range-checked before any threshold comparison. Out-of-range, non-finite or wrongly typed values end the stage as an exception.
- Rule table, gallery and gate configuration are pinned by SHA-256 and checked on every case. A category with too few calibration captures is uncertified, and one such category stops all automatic passes.
- A product with a neighbour that the imprint check or the embedding cannot separate is locked out and always reviewed. An order with any UNKNOWN rule verdict also goes to review.
- The audit fails if any injected-error case passed automatically or if the head of its rebuilt decision chain differs. With an empty denominator no rate is computed; the group is reported as held.
Not built or not run
- Image inference (segmentation, OCR, embedding) was not run. Those modules are specified as interfaces and loss formulas only, and a simulator produces their outputs.
- No real data were used: no gallery built from the pill-identification data of MFDS (the Korean food and drug regulator), no rule table generated from published DUR rule codes, and no evaluation on ePillID images.
- A per-stage execution-time watchdog and a downstream release interlock exist only as design requirements. The harness judges timeouts from ticks that stages report and does not measure real time.
- Label-free early drift monitoring (a distribution test on the top margin, rates of empty-set and low-margin reasons) is a design requirement and is not implemented.
- Re-execution in an isolated, blinded environment and an auditor's signature are outside this work. The audit shares the fixture loader and the simulator with the solver.
Result and documents
Across 6 kinds of injected error, 4,500 cases in all, 0 passed automatically; one-sided 95% upper bounds on the miss rate range from 0.20% to 0.75%. Of 3,000 correct fills, 1,859 (62.0%) passed automatically and the rest went to forced pharmacist review. Vision outputs were simulated; no image inference was run.
Synthetic inputs only (synthetic_only). These figures come from a synthetic gallery, simulated vision outputs and orders written in abstract codes. No pill image was analysed, no real prescription or DUR rule table was used, clinical performance was not assessed and no auditor has signed the result.
Measured values, limits and gates on the S1 record · Prescription and Dispensing Rule Cross-Checks
S1 design specification: pill verification and DUR cross-audit software (KR) · S1 harness modules and replay record (KR) · Audit record (JSON) · Run output (JSON)
How to read this screen
This screen describes structure: the parts, the order work passes through them and what each run is checked against. It carries no measured value of its own. The figure in each result paragraph is filled from the audit file when the site is built, and every component names the code that does the work.