Repository navigation
Spine Contour v1.5.0
Spine Contour 1.5.0
This release carries PR #72: fine-tuned spine models and one measurement pipeline for lumbar, cervical and full-spine
films, with an NVIDIA GPU runtime as a preview. Apart from the model list in Settings, the desktop app's screens are
unchanged. A film segmented before 1.5.0 keeps its result until it is run again; a new run uses the new models and may
give different numbers.
Fine-tuned models
- The cervical and lumbar landmark models (HRNet), the S1 detector (Keypoint R-CNN) and the optional region detector
start from their earlier weights and are fine-tuned on annotated films, with the original training data mixed in.
Cervical training uses 4,506 images, 39 of them annotated cervical films and 36 annotated full-spine films; lumbar and
S1 training use 4,423, 55 of them annotated lumbar films and 40 annotated full-spine films. Cropping, mirroring,
rotation, scaling, translation and intensity augmentation are on; a landmark cropped out of view is left out of the
loss. The femoral U-Net, the cervical localization models and the view classifier are unchanged. - The results are mixed. Against the preceding cervical checkpoint, the bundled one fits the annotated films far more
closely (39 cervical films: landmark error 5.80 → 2.60 px, C2–C7 Cobb 3.44° → 1.43°; 36 full-spine films in saved crop
mode: 15.52 → 3.12 px, 5.73° → 1.77°), but those films are training data, so this is fit, not accuracy on unseen
patients. On the 20-patient cervical validation panel, which took part in checkpoint selection, the Cobb error moves
4.60° → 4.90°; on the held-out 541-image lumbar test split, the S1 slope error falls 2.42° → 2.30° and the L1–S1
lordosis error rises 3.38° → 3.51°. Difficult vertebral levels and obscured cervical landmarks still go wrong. - Data, selection rules, hashes and every figure are in annotated-data fine-tuning and
its aggregate results.
One measurement pipeline
- Lumbar, cervical and full-spine films go through one fixed pipeline (fixed measurement
pipeline), revisionseven-measurements-20261023. Landmarks are decoded to subpixel positions
(a 9 × 9 weighted neighbourhood around each heatmap peak) before they are mapped back to the film. The measurement
definitions are unchanged. - The vertebral bodies are read by HRNet only. The lumbar U-Net segmentation model is removed, and with it the
vertebral-model choice in Settings, which now shows each structure's model as fixed. A lumbar result, like a
cervical or full-spine one before it, carries no segmentation mask; its outlines are drawn from the landmarks. A
result the U-Net produced before 1.5.0 is still labelled U-Net in the Analysis header. - Pelvic tilt and global SVA keep their own anchors, from crops chosen for them, in
geometry.measurement_sources; the
viewer draws and the backend measures each from the same source. Moving a shared S1, hip or C7 anchor by hand makes
that edit take precedence over the automatic source, and a reset restores the original geometry. - Settings → Processing → Crop localizer and Toolbar removal no longer change processing. Both are still saved
and recorded with each result as requested (qc.processing.requested_crop_localizer,
qc.processing.requested_toolbar_removal), but the pipeline always runs the crop search on lumbar and full-spine
films and segments every film as uploaded, toolbar included. Both switches are still shown in Settings.
NVIDIA GPU processing (preview)
- An NVIDIA (CUDA) runtime,
backend/requirements-cuda.txt, lists each NVIDIA GPU in Settings → Processing →
Processor by its UUID (cuda:GPU-…). On it, crop candidates run in batches that halve after an out-of-memory error;
a persistent failure runs the film again on the CPU. Batch sizes and retries are recorded inqc.processing.batches. - This runtime ships only in a Windows preview ZIP (
Spine-Contour-Preview-Windows-NVIDIA), which the preview workflow
builds as an artifact, on pull requests that touch the GPU runtime files or on request, and never publishes. A
packaged CUDA build has not yet been tested on NVIDIA hardware. - The published Windows installer keeps ONNX Runtime's DirectML build, with its parity check against the CPU, and the
macOS build runs on the CPU, as in 1.4.0.
Build
- Every model file (
*.onnx,*.pt,*.pth,*.ckpt,*.safetensors) is now stored in Git LFS, the crop-detector
and view-classifier graphs included. Tracked model assets total about 1,364 MB (983.5 MB in 1.4.0). - The Windows workflows try the Tesseract (OCR) install up to three times, 15 s apart, before failing the build.
Verification
1,252 desktop tests on the merged tree, the same count as 1.4.0; PR #72 updates three tests' expectations (the vertebral
model, the store's default and the cervical run's model) and adds none on the desktop side. PR #72 reports the backend
suite passing, 771 tests on macOS (three skipped) and 773 on Windows (one skipped), and its checks on the pull request
built and verified the Windows and macOS packages (the packaged models and OCR) and the NVIDIA preview ZIP. All 99 real
full-spine films in its validation set completed without an inference error, in 5 min 35 s across two GPUs with saved
localization and calibration; against the older AI workbook, C2–C7 Cobb is newly unavailable on 2 of them and newly
available on none, which is a change in availability, not an accuracy result (fixed-pipeline
validation). The smoke suites were not re-run for this release, and smoke-cervical
now expects the clinical cohort's new dataset name. These are software checks, not clinical validation. The release
workflow builds and tests the Windows and macOS installers before publication; merging the release PR to main
publishes v1.5.0.
Compatibility
No store version bump: the study record, the label record, the CSV exports and the bundles keep their format, and a
library written by 1.4.0 loads unchanged. A result from 1.5.0 adds geometry.pipeline_revision,
geometry.measurement_sources, geometry.source_geometry and qc.processing.batches; opening a library a 1.5.0 build
has written in an earlier build was not tested. A processor saved as cuda:GPU-… by the NVIDIA preview runs on the CPU,
and says so, in a build without the CUDA runtime. The macOS build remains unsigned.
Source: 9e6241e25a27fb87c61bd1f050b48cbec1ca6534 on main.