Case study 01 · iPad · 2026

Reading a spine in seconds

ScolioLab finds each vertebra on a spine X-ray, draws the Cobb lines a doctor would draw and classifies the curve, all on the iPad.

median Cobb-angle error, measured in the app
1.83°
correct scoliosis yes/no on real X-rays never seen in training
91%
people on the team
5
ScolioLab: Spine analysis on iPad with on-device ML

Scoliosis is tracked with one number, the Cobb angle: the angle between the two most tilted vertebrae at the ends of a curve. In most clinics that number is still measured by hand, with a ruler and a protractor on the film. It is slow, and two careful people can read the same film a few degrees apart. ScolioLab is an iPad app that does the measuring for the doctor and then gets out of the way. It finds each vertebra, draws the Cobb lines a doctor would draw, classifies the curve and shows the result in seconds. The whole pipeline runs on the device, so the X-ray never leaves the iPad.

The problem

The app is the easy half of a medical imaging product. The hard half is trust. A doctor will only use a number they can check, so every reading has to show its working: which vertebrae were chosen as the end vertebrae, where the lines run, and how the angle came out. A typical screen shows a test film read as 34 degrees, a thoracic C-curve, with end vertebrae T2 and T11. If the doctor disagrees, they drag the handles on the Cobb lines and the angle updates. The model proposes; the doctor decides.

Privacy was the other constraint. Spine X-rays are patient records, so every step runs on the iPad: the film is read, measured and summarised without ever leaving the device.

My role

I led iOS development in a team of five, and I built the on-device X-ray pipeline: the models, their conversion to Core ML, and the code that turns their raw output into vertebrae, lines and a Cobb angle the interface can draw.

What we built

The pipeline starts with YOLO models trained with Ultralytics. They find each vertebra and its corners on the film. The app then picks the most tilted vertebrae at the ends of each curve, computes the Cobb angle and classifies the curve. Everything is wrapped in SwiftUI.

Around the measurement sits the rest of the product:

  • a 3D spine in SceneKit, so a family can see a curve instead of reading a number;
  • progress over time in Swift Charts;
  • brace-wear tracking as Live Activities;
  • patient summaries written on the device with Foundation Models.

The hard part was the data, not the app. The public scoliosis X-ray datasets we found mostly allow testing only, not training. Training on them anyway would have meant pulling the model later, so I did something slower instead: I rendered training X-rays from openly licensed CT scans and kept the real films purely for testing. We kept a register of every dataset, its licence and what it may be used for. Every model change was checked on held-out real films before it went into the app.

That choice shaped the whole machine learning plan. Rendered films are clean and perfectly labelled, real films are not, so most of the work went into closing that gap and measuring honestly whether it had closed.

The numbers

  • 1.83° median error of the Cobb angle measured in the app, by the YOLO models running on the iPad.
  • 91% correct scoliosis yes or no on real X-rays the model never saw in training (the held-out Fraiwan set, November 2026).
  • 5 people on the team. The app is on TestFlight, with a live demo at scoliolab.tech.

What I learned

Licences decide the machine learning plan before any code is written. The first question for a medical model is not which architecture to use but which data you are allowed to learn from, and the honest answer here forced a synthetic-data pipeline that took longer than the app itself.

I also learned that a model in a phone is a different object from a model in a notebook. Conversion to Core ML, image orientation and post-processing all change the result, so the only number worth reporting is the one measured inside the app. That is why the 1.83° figure is measured in the app and not in training.

Finally, an expert user needs a way to disagree with the machine. The draggable Cobb lines were a small feature, but they are what made the readings usable: a doctor can see the reasoning, correct it in a second and keep working.