Shadow deployment
Replacing the ModelVersion that serves production is a risky move: a new version can score better on the test split of its DatasetVersion and still behave worse on the images your cameras send today. A Shadow deployment removes the guesswork. You run the candidate ModelVersion next to the one in production, on the same images, and you only promote it once the production data shows that it does better.
1. What is a Shadow Model?
Each Deployment serves one ModelVersion, called the Champion Model: its Prediction are the ones your application relies on. A Deployment can also hold a second ModelVersion, called the Shadow Model, which infers on the same images as the Champion Model. Its Prediction are logged on the Deployment next to the ones of the Champion Model, but they are only there to be compared with them.

Champion & Shadow Model
2. Deploy a Shadow Model
A. From the Dashboard
On the Dashboard of a Deployment without a Shadow Model, the Shadow Model card reads No Shadow Model and carries a Set shadow model button. Click on it to open the Set Shadow Model modal: it lists the ModelVersion you can deploy as Shadow Model, each one with its framework, its Detection Type, and its number of Label, and a search field filters them by name. Only the ModelVersion that have files, and the same Labelmap and Detection Type as the Champion Model, are offered. Select one and click on Update.

Set Shadow Model modal
Once a Shadow Model is deployed, the card displays its Model and ModelVersion, next to the Champion Model card.

Champion Model and Shadow Model cards
B. Through the Continuous Deployment
When a Pipeline retrains your ModelVersion (see Pipeline), the Deploy Shadow policy of the Continuous Deployment exports the Experiment as a new ModelVersion and deploys it as Shadow Model on the Deployment. The new version then has to prove itself on production data before you promote it, instead of replacing the Champion Model blindly.
C. With the SDK
Any ModelVersion can also be deployed as Shadow Model on an existing Deployment with the set_shadow_model() method of the Picsellia Python SDK.
3. Make both ModelVersion infer
ModelVersion inferThe comparison only makes sense if both ModelVersion infer on the same images:
- When the
ModelVersionare served by the Picsellia Serving Engine, this is handled for you: as soon as a Shadow Model is deployed, every further inference produces a Champion and a ShadowPrediction, both logged on theDeployment. Since bothModelVersionrun on each image, an inference consumes MPU for the two of them (see Track your usage). - When you serve them on your own infrastructure, you have to make both
ModelVersioninfer on each image, then log bothPredictionon theDeploymentat once with the monitor() method of the Python SDK, as shown in this example.
Inferences are detailed in Inferences.
4. Compare the Champion and Shadow Prediction
PredictionA. In the Predictions tab
The Layer dropdown above the list of PredictedAsset chooses which Prediction is drawn on the images: pick Champion or Shadow to look at the same images through each ModelVersion in turn. In the Table view, the number of Shape of each Prediction (champion shapes and shadow shapes) points you to the images where the two ModelVersion disagree. Both are detailed in Predictions overview.

Predictions on the Shadow layer
B. In the Prediction Review tool
In the Prediction Review tool, the dropdown in the header switches the Prediction displayed between Champion and Shadow. This lets you start your review from the Prediction closest to the truth, and see on each image which ModelVersion got it right.

Champion / Shadow dropdown of the review tool
C. On the Dashboard
Some metrics of the Dashboard display an additional line for the Shadow Model, so that you can compare both ModelVersion over time: the Latency, and, once Prediction are reviewed, the Average Precision and the Average Recall.

Champion & Shadow latency
5. Promote a Shadow Model
Once the production data shows that the Shadow Model does better than the Champion Model, click on the Promote button of the Shadow Model card of the Dashboard. It acts immediately, without asking for a confirmation, and a Shadow model promoted successfully message confirms it. The Shadow Model becomes the Champion Model of the Deployment, and its Prediction are the ones your application relies on from then on. The former Champion Model is removed from the Deployment, which no longer has a Shadow Model until you set a new one.
Updated 3 days ago