MLOps for Vision
MLOps for vision keeps cameras, datasets, and models versioned together, so a model that worked in the lab keeps working on the street.
Why Does This Exist?
A vision model that scores well on a frozen test set meets a harsher world on release: seasons change lighting, cameras get replaced, new packaging appears on shelves. Accuracy slides silently because nobody labels the live stream. Teams discover the drop from complaints, weeks late.
MLOps for vision closes that loop. Data snapshots, model versions, and serving configs move as one bundle, while monitors watch input and output statistics for drift. Model serving covers the rollout mechanics, edge deployment covers cameras with weak links, and data-centric practice covers fixing the dataset instead of the net.
Think of It Like This
A bus depot with inspection bays
Buses leave the depot on schedule, but every return passes an inspection bay: tires, lights, brakes. A bus that fails goes to the shop, and the depot log ties each repair to a mileage snapshot.
Images are the buses, the model is the route, and the monitor is the bay. Versioned data plus model versions form the log. The analogy stops at automation: buses do not retrain themselves, while a vision pipeline can trigger labeling and training from the inspection result.
How It Actually Works
Three stores move together: a data snapshot with hashes of every image, a model registry entry with weights plus metrics, and a serving config with thresholds and hardware targets. Live traffic first hits a canary on a small share, and monitors compare live input stats plus prediction mix against the training snapshot. A breach pages the team and freezes promotion.
Worked example
A shelf-monitoring model serves images a day at accuracy. After a packaging refresh, the monitor sees accuracy on a -image audit set fall to , a drop, while the share of unknown-SKU predictions triples from to . The rule fires: halt full rollout at percent canary, label fresh images, retrain, and promote only when the audit set clears again. One number plus one mix shift made the call.
Code
The firing rule, checked nightly on the audit sample.
def needs_retraining(base_acc: float, audit_acc: float, drop_tol: float = 0.03) -> bool: """Fire when audit accuracy falls more than tolerance below baseline.""" return (base_acc - audit_acc) > drop_tol # absolute drop, not relative
print(needs_retraining(0.92, 0.86)) # -> Trueprint(needs_retraining(0.92, 0.905)) # -> FalseWatch Out For
Versioning weights without the images
Storing model files while letting the training folder drift means a rollback restores weights nobody can rebuild or audit. The symptom is a retrain that never reproduces the promoted score.
Hash the dataset snapshot into the registry entry. No hash, no promotion.
Monitoring predictions but not inputs
Watching only the label mix misses slow camera decay: predictions look stable while blur grows. Then a lens cleaning flips the mix overnight and the team blames the model.
Track input stats like brightness and sharpness beside outputs. Input drift warns weeks earlier.
The Quick Version
- Vision MLOps versions data, model, and serving config as one bundle.
- Canary rollouts plus input and output monitors catch drift early.
- Worked numbers: daily images, to triggers action at drop.
- Unknown-SKU share tripling from to confirms the shift.
- Hash datasets into the registry and monitor inputs, not just predictions.