A vision model only learns from what its data pipeline hands it. At GE HealthCare I worked on that pipeline for X-ray computer vision: one schema across more than 400 datasets, the PyTorch loaders that turn stored images into training batches, and the known-answer suites that check a change hasn’t moved a result. None of it is the model. All of it decides whether the model’s answers can be trusted.
- Schema
- One shared schema across 400+ X-ray datasets.
- Loaders
- PyTorch pipelines that read, prepare and batch images for vision models.
- Tests
- Known-answer suites that check a change against results already established.
- Stack
- Python, PyTorch
One schema for 400+ datasets
Datasets gathered at different times and in different places rarely describe themselves the same way. The same fact turns up under different names, in different formats and with different vocabularies. A view might be written “PA”, “pa” or “posteroanterior”; an age might be a number, a padded string or a count of months.
A model can only learn from a mix of datasets if they all say things the same way. I standardized the schema across more than 400 of them, so a training run could draw on any combination without a one-off script for each.
| Dataset A | Dataset B | Dataset C | |
|---|---|---|---|
| View | View Position"PA"view"PA" | ViewPosition"ap"view"AP" | projection"posteroanterior"view"PA" |
| Sex | Patient Gender"F"sex"F" | PatientSex"M"sex"M" | gender"female"sex"F" |
| Age | Patient Age63age_years63 | PatientAge"071Y"age_years71 | age_months540age_years45 |
| Findings | Finding Labels"Effusion|Atelectasis"findings["effusion", "atelectasis"] | labels["pleural effusion"]findings["effusion"] | effusion, atelectasis0, 1findings["atelectasis"] |
Getting images into the model
A model never sees an X-ray file. It sees whatever the loader makes of it: read, resized, scaled and stacked into a batch. I built those PyTorch data pipelines for the vision models.
The trap is that a pipeline can change what every image looks like and still run without an error. If training and evaluation prepare images even slightly differently, the model is scored on pictures it never learned from, and nothing tells you.
Training
Evaluation
Difference
The simplest guard is structural: one definition of “prepared”, used by both sides.
# Illustrative, not GE code
class XrayDataset(Dataset):
def __init__(self, index, prepare):
self.index, self.prepare = index, prepare # one row per image, on the shared schema
def __len__(self):
return len(self.index)
def __getitem__(self, i):
row = self.index[i]
return self.prepare(read_image(row.image_path)), row.findings
prepare = build_prepare() # the only definition of "prepared"
train = DataLoader(XrayDataset(train_index, prepare), batch_size=32, shuffle=True)
test = DataLoader(XrayDataset(test_index, prepare), batch_size=32)
Tests with known answers
Because a pipeline change can fail without a sound, I built known-answer evaluation suites to catch it. Each case has an output that’s already established. After a change the cases run again: if every answer holds, the change can go ahead; if one moves, it stops until someone knows why.
Tidying the code without changing its steps passes. Both of the differences from Fig. 3 are caught, though neither raised an error.
What carried over
The people relying on a medical model need to trust its answer before they act on it, and that trust is built long before training: in data that means the same thing everywhere, loaders that never drift, and tests whose answers you already know. It’s the same habit behind Clear and the Quote Engine: show the working, and check it against what you already know.
This describes the work in general terms. The figures run on synthetic images and invented field names, not GE HealthCare data, and the code is illustrative.