ScenarioTest is a way to monitor model performance in critical scenarios. Each test is defined on a subset (Slice) of data and can consist of multiple evaluation metrics. Within a test user can either compare the model performance against other baseline models (e.g. on which metrics is model X better than model Y) or hard thresholds (e.g. is the IoU of model X > 0.8 on the slice of interest).
In this guide we’ll create a scenario test on a fictional Slice with several evaluation functions and walk through how baseline models and pass/fail thresholds can be set.
Interacting with Validate SDK
You can use the Validate Python SDK via theNucleusClient.validate module. You set up the SDK exactly like you would when interacting with Nucleus (see the Getting Started section). You can list existing scenario tests (will be empty in the beginning) and available evaluation functions.
Creating a new ScenarioTest
Selecting the slice
We select theSlice we want as the basis of our ScenarioTest data as we would normally select slices from the SDK. You can also find the Slice ID by viewing the slice in the UI and copying the slc_... ID from the URL.
Selecting the EvaluationFunction
Validate comes with a growing set of standard evaluation functions which are listed on the AvailableEvalFunctions object returned by validate.eval_functions.public_functions. These can all be found as members of the client.validate.eval_functions object. If the public evaluation functions don’t satisfy your needs and you need to define more private evaluation functions, please contact us and we’ll help you to get the private evaluation functions set up.
We currently support the following list of evaluation functions:
- 2D object detection: bounding box precision, recall, IOU, mAP
- 3D object detection: cuboid precision, recall, IOU (both 3D and birds-eye-view 2D)
- Image categorization: Categorical F1 score
Defining a ScenarioTest
We finally create the ScenarioTest with the pedestrians slice and the criterion for the IOU and mean average precision evaluation functions. We add the two additional metrics in a subsequent step. Note, that all of them could be added at once in the list. Each test needs to at least contain one evaluation function upon instantiation.