Skip to content

About

A WAICY research project exploring how AI checks the evidence behind chest X-ray predictions and decides when to reassess them.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

VeriSight AI — CEVR-Net demo developer kit

Live demo: https://verisight-ai.streamlit.app

Run the Streamlit app

python3 -m venv .venv && source .venv/bin/activate
python -m pip install -r requirements.txt
streamlit run app.py

app.py opens the Reliability Workstation in English or Arabic. The Clinical Workspace provides zoom, brightness, contrast, and an activation display for three bundled TBX11K cases. The Reliability Lab compares image edits, visualizes the intervention weights, and explains the resulting score changes. The Recovery Explorer shows the candidate outputs, transition probabilities, and policy decision, with a JSON export for live cases. The Research Dashboard displays the separate team-reported experiments. Deploy on Streamlit Community Cloud with main file app.py.

Model status: random, untrained weights. Educational architecture demonstration.

The app runs the original architecture with seeded random weights. Its activations, scores, and routing decisions illustrate the mechanics of a forward pass. The team's reported held-out results appear in the Benchmark tab, including both recovered cases and new misses. Raw prediction logs and trained weights are unavailable for independent verification.

Reference image attribution

The bundled cases are unmodified TBX11K images. All three appear in the VeriSight manifest's primary training split. The app creates stress-test edits in memory.

Bundled case TBX11K source Source category
h0001 health/h0001.png Healthy
s2989 sick/s2989.png Sick, non-TB
tb0221 tb/tb0221.png Active TB

TBX11K by Yun Liu, Yu-Huan Wu, Yunfeng Ban, Huifang Wang, and Ming-Ming Cheng, Media Computing Lab at Nankai University. Dataset and paper, CC BY 4.0.

Start here

Python 3.11 or 3.12 recommended. Open a terminal in the repository:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python demo_model.py --xray h0001 --out demo_output
python demo_model.py --case checker --challenge marker --out demo_challenged

On Windows use .venv\Scripts\activate rather than the source command. No training dataset or pretrained-weight download is needed for the demonstration. Dependency installation may require internet access. Default device is CPU; --device mps or --device cuda may work on supported setups but were not tested here.

demo_output/case.json contains the Predict, Challenge and Correct outputs. The X-ray run writes xray_input.png and untrained_activation_map.png. The synthetic smoke test writes synthetic_input.png and its activation map.

Connect the model to your demo

from demo_model import DemoModel

model = DemoModel(device='cpu')  # initialize once on server startup
result, image, activation_map = model.run_reference('h0001', challenge='marker')
print(result['predict'])
print(result['challenge'])
print(result['correct'])

The method returns a JSON-serializable dictionary and two 512×512 float NumPy arrays in [0,1]. Pass include_features=True to include the spatial activation and pooling weights in the trace. Both input modes accept None, border, or marker as the challenge. The synthetic smoke-test API is model.run(case='rings'), with rings, gradient, and checker available. results/reported/benchmark_results.json provides the benchmark tables and their provenance status.

Architecture outputs

  • Predict: 512×16×16 deep feature map, 1×32×32 localization output, three action logits.
  • Challenge: original/context/evidence/control scores, six reliability signals, 520-dimensional router features (512 pooled features, initial score, entropy, six signals).
  • Correct: two five-class transition probability distributions, two action utilities, selected action and final decision score. The final score is not a calibrated probability. Thresholds in the random checkpoint config are illustrative, not learned.

Files

Path Contents
verisight.py Original full CEVR-Net, ResNet-18 baseline, verification, router, training, calibration and evaluation
inspect_case.py Original held-out case inspection utility for real trained checkpoints
app.py Streamlit workstation and navigation
case_views.py, recovery_views.py, research_views.py Case inspection, verification, recovery and research pages
docs/ WAICY research-style summary
demo_model.py Live architecture runner and JSON/image export for reference and synthetic inputs
assets/tbx11k/ Bundled reference X-rays with attribution above
init_demo_weights.py Recreate seed-42 random checkpoints without training
weights/ Full random CEVR-Net and router state dictionaries, explicit uncalibrated config
verisight_data_manifest.json Original fixed TBX11K splits, labels and normalized boxes
results/reported/ All four technical-report tables, confusion counts, recovery transitions, benchmark JSON, report PDF and confusion-matrix figure
results/random_weight_smoke_test/ Actual forward-pass outputs on two generated patterns, not benchmark evaluations
make_reported_results.py Recreate the reported aggregate tables and JSON (not evaluation code)
TRAINING.md Original setup, data audit, training and held-out evaluation instructions
test_demo.py Smoke tests for reference and synthetic runs, routing controls and benchmark arithmetic

Moving to trained weights

Use TRAINING.md to audit the full local TBX11K dataset, train the original model and router, calibrate thresholds using the calibration split, and evaluate the held-out test data. The original script writes actual checkpoints, config.json, results.json and test_predictions.csv under your training run folder. Do not overwrite or relabel the demo checkpoint as trained. Real benchmark results can be verified only with the actual trained checkpoints and outputs. Use inspect_case.py on the fixed held-out set after training, and explicitly label the model as a research prototype. No raw test prediction logs or trained weights were available when this package was built.

Validation and privacy

CPU forward passes for clean rings and marker-challenged checker patterns succeeded in the build environment (PyTorch 2.10.0+cpu, torchvision 0.25.0+cpu). Full training, external validation and GPU/MPS performance have not been tested in this packaging step. No medical efficacy is established by these smoke tests. Keep the source private if considering patent protection. Document AI-assisted code development in the competition submission.

About

A WAICY research project exploring how AI checks the evidence behind chest X-ray predictions and decides when to reassess them.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages