|
| 1 | +.. _Configuration: |
| 2 | + |
| 3 | +Configuration |
| 4 | +============= |
| 5 | + |
| 6 | +Thetis needs a YAML configuration file that specifies several aspects, e.g., the task, available classes, requested |
| 7 | +evaluation aspects, etc. `Download an example configuration file <https://raw.githubusercontent.com/EFS-OpenSource/Thetis/refs/heads/main/examples/demo_config_classification.yaml>`__ or copy/paste the |
| 8 | +following configuration file. An explanation for each configuration aspect can be found below. |
| 9 | + |
| 10 | + |
| 11 | +Example configuration file |
| 12 | +-------------------------- |
| 13 | + |
| 14 | +A YAML configuration structure for Thetis has the following general form: |
| 15 | + |
| 16 | +.. code-block:: yaml |
| 17 | +
|
| 18 | + # meta data of model predictions and dataset |
| 19 | + meta: |
| 20 | +
|
| 21 | + model: |
| 22 | + name: "<model name>" |
| 23 | + revision: "<model revision>" |
| 24 | +
|
| 25 | + dataset: |
| 26 | + name: "<dataset name>" |
| 27 | + revision: "r1" |
| 28 | +
|
| 29 | +
|
| 30 | + # Examination task. Can be one of: "classification" (binary/multi-class classification), |
| 31 | + # "detection" (image-based object detection) or "regression" |
| 32 | + task: "classification" |
| 33 | +
|
| 34 | + # Language of the final report. Can be one of: "en", "de" |
| 35 | + language: "en" |
| 36 | +
|
| 37 | + # Task-specific settings. Required and available fields depend on the selected task. |
| 38 | + task_settings: |
| 39 | +
|
| 40 | + # List of distinct classes that can occur within the dataset (can only be set for classification or |
| 41 | + # object detection). If specified then this parameter cannot be empty. |
| 42 | + distinct_classes: ["no person", "person"] |
| 43 | +
|
| 44 | + # In binary classification (when 'distinct_classes' has length of 2), you must specify a positive label out of |
| 45 | + # the list of available classes. This is important since you only give a single "confidence" for each prediction, |
| 46 | + # targeting the probability of the positive class. May only be specified for binary classification. |
| 47 | + binary_positive_label: "person" |
| 48 | +
|
| 49 | + # Bounding-box format. Can be one of: "xyxy" (xmin, ymin, xmax, ymax), "xywh" (xmin, ymin, width, height), |
| 50 | + # or "cxcywh" (center x, center y, width, height). |
| 51 | + detection_bbox_format: "xyxy" |
| 52 | +
|
| 53 | + # List with IoU scores used for object detection evaluation |
| 54 | + # Note: the IoU score "0.5" is always active for the evaluation. You can specify more IoU scores if you want |
| 55 | + detection_bbox_ious: [0.75] |
| 56 | +
|
| 57 | + # String with bounding box matching strategy. Must be one of: "exclusive", "max". |
| 58 | + detection_bbox_matching: "exclusive" |
| 59 | +
|
| 60 | + # Set to true if the bounding boxes are also inferred with a separate variance score (currently not supported) |
| 61 | + detection_bbox_probabilistic: false |
| 62 | +
|
| 63 | + # In detection mode, it is possible to set a confidence threshold |
| 64 | + # to discard blurry predictions with low confidence |
| 65 | + detection_confidence_thr: 0.2 |
| 66 | +
|
| 67 | + # In detection mode it is possible to specify a tolerance zone outside image bounds within which clipping is applied. The boxes within these zones are |
| 68 | + # clipped to the image dimensions. For boxes outside the specified tolerance, an error is raised instead. |
| 69 | + detection_bbox_clipping: 20% |
| 70 | +
|
| 71 | + # Settings for the data evaluation routine |
| 72 | + data_evaluation: |
| 73 | + examine: true |
| 74 | +
|
| 75 | + # Settings for the AI baseline performance evaluation (which should be always performed!) |
| 76 | + performance: |
| 77 | + examine: true |
| 78 | +
|
| 79 | + # Settings for the evaluation of confidence calibration |
| 80 | + uncertainty: |
| 81 | + examine: true |
| 82 | +
|
| 83 | + # Number of bins used for ECE calculation, required for classification and detection evaluation |
| 84 | + ece_bins : 20 |
| 85 | +
|
| 86 | + # During ECE/D-ECE computation, bins with a number of samples less than this threshold are ignored |
| 87 | + # Required for classification and detection evaluation |
| 88 | + ece_sample_threshold: 10 |
| 89 | +
|
| 90 | + # Number of bins used for D-ECE calculation (object detection), required for detection evaluation |
| 91 | + dece_bins: 5 |
| 92 | +
|
| 93 | + # Settings for the evaluation of model fairness |
| 94 | + fairness: |
| 95 | + examine: true |
| 96 | +
|
| 97 | + # Specify sensitive attributes that are used for fairness evaluation. For each of these attributes, |
| 98 | + # you need to specify the classes for which the attributes are actually valid (out of the labels |
| 99 | + # within 'distinct_classes' list). You can also leave it empty or type "all" to mark validity for all classes. |
| 100 | + sensitive_attributes: |
| 101 | + gender: ["no person", "person"] |
| 102 | + age: "all" |
| 103 | +
|
| 104 | +
|
| 105 | +General application settings |
| 106 | +---------------------------- |
| 107 | + |
| 108 | +In the following, we give a detailed overview about all possible general configuration settings. |
| 109 | + |
| 110 | +.. list-table:: Meta information settings describing the customer information, model properties, and used dataset. |
| 111 | + :widths: 35 10 55 |
| 112 | + :header-rows: 1 |
| 113 | + |
| 114 | + * - Key/Specifier |
| 115 | + - Dtype |
| 116 | + - Description |
| 117 | + * - :code:`meta/model/name` |
| 118 | + - string |
| 119 | + - Name of the AI model used to generate predictions. |
| 120 | + * - :code:`meta/model/revision` |
| 121 | + - string |
| 122 | + - Revision of the AI model used to generate predictions. |
| 123 | + * - :code:`meta/dataset/name` |
| 124 | + - string |
| 125 | + - Name of the dataset holding the ground truth information. |
| 126 | + * - :code:`meta/dataset/revision` |
| 127 | + - string |
| 128 | + - Revision of the dataset holding the ground truth information. |
| 129 | + |
| 130 | + |
| 131 | +.. list-table:: General application settings |
| 132 | + :widths: 35 10 55 |
| 133 | + :header-rows: 1 |
| 134 | + |
| 135 | + * - Key/Specifier |
| 136 | + - Dtype |
| 137 | + - Description |
| 138 | + * - :code:`task` |
| 139 | + - string |
| 140 | + - Selection of the examination task. Can be one of: "classification" (binary/multi-class classification), "detection" (image-based object detection). |
| 141 | + * - :code:`language` |
| 142 | + - string |
| 143 | + - Language of the final evaluation report. Can be one of: "en" (US English), "de" (German). |
| 144 | + * - :code:`task_settings/distinct_classes` |
| 145 | + - list of int or string |
| 146 | + - List of distinct classes that can occur within the dataset. Only to be provided in case of Classification or Detection |
| 147 | + * - :code:`task_settings/binary_positive_label` |
| 148 | + - int or string |
| 149 | + - In binary classification (when 'distinct_classes' has length of 2), you must specify a positive label out of |
| 150 | + the list of available classes. This is important since you only give a single "confidence" for each prediction, |
| 151 | + targeting the probability of the positive class. |
| 152 | + * - :code:`task_settings/detection_bbox_format` |
| 153 | + - string |
| 154 | + - Bounding-box format of the provided boxes in object detection mode. Can be one of: "xyxy" (xmin, ymin, xmax, ymax), |
| 155 | + "xywh" (xmin, ymin, width, height), or "cxcywh" (center x, center y, width, height). |
| 156 | + * - :code:`task_settings/detection_bbox_ious` |
| 157 | + - list of float |
| 158 | + - List with IoU scores (in [0, 1] interval) used for object detection evaluation. |
| 159 | + Note: the IoU score "0.5" is always active for the evaluation. You can specify more IoU scores if you want. |
| 160 | + * - :code:`task_settings/detection_bbox_matching` |
| 161 | + - string |
| 162 | + - String with bounding box matching strategy within object detection evaluation. The strategy of matching the predicted bounding boxes |
| 163 | + with the ground truth ones must be either "exclusive," where each prediction and each ground truth are assigned to at most a single counterpart, |
| 164 | + or "max," with maximum/non-exclusive bounding box matching, where each ground truth object may have multiple predictions assigned to it. |
| 165 | + The default is "exclusive". |
| 166 | + * - :code:`task_settings/detection_bbox_probabilistic` |
| 167 | + - boolean |
| 168 | + - Currently not used. |
| 169 | + * - :code:`task_settings/detection_confidence_thr` |
| 170 | + - float |
| 171 | + - In detection mode, it is possible to set a confidence threshold (in [0, 1] interval) to discard blurry predictions with low confidence. |
| 172 | + * - :code:`task_settings/detection_bbox_clipping` |
| 173 | + - int |
| 174 | + - In detection mode, it is possible to specify a tolerance zone outside the image in case of boxes that are out of image bounds. |
| 175 | + This can be ommitted, in which case no clipping is applied and an error is raised if a box is out of image bounds. |
| 176 | + Alternatively, it can be set to relative(relative to image width and height)% ([0-100]%) or absolute values in px ([int]px). |
| 177 | + These specify the dimensions outside the image, such that if any boxes extend into this tolerance zone, they will get clipped to the image dimensions. |
| 178 | + If boxes exceed these tolerance zones no clipping will be applied, an error will be raised instead. |
| 179 | + |
| 180 | +Configuration of safety evaluation |
| 181 | +---------------------------------- |
| 182 | + |
| 183 | +.. list-table:: Configuration settings for dataset evaluation. |
| 184 | + :widths: 35 10 55 |
| 185 | + :header-rows: 1 |
| 186 | + |
| 187 | + * - Key/Specifier |
| 188 | + - Dtype |
| 189 | + - Description |
| 190 | + * - :code:`data_evaluation/examine` |
| 191 | + - boolean |
| 192 | + - Enables/disables the data evaluation for the final rating & reporting. |
| 193 | + |
| 194 | +.. list-table:: Configuration settings for AI performance evaluation. |
| 195 | + :widths: 35 10 55 |
| 196 | + :header-rows: 1 |
| 197 | + |
| 198 | + * - Key/Specifier |
| 199 | + - Dtype |
| 200 | + - Description |
| 201 | + * - :code:`performance/examine` |
| 202 | + - boolean |
| 203 | + - Enables/disables the AI performance evaluation (e.g., accuracy, mAP, precision, recall, etc.) for the final reporting. |
| 204 | + |
| 205 | +.. list-table:: Configuration settings for uncertainty evaluation (uncertainty calibration). |
| 206 | + :widths: 35 10 55 |
| 207 | + :header-rows: 1 |
| 208 | + |
| 209 | + * - Key/Specifier |
| 210 | + - Dtype |
| 211 | + - Description |
| 212 | + * - :code:`uncertainty/examine` |
| 213 | + - boolean |
| 214 | + - Enables/disables the uncertainty evaluation (uncertainty calibration, e.g., computation of the Expected Calibration Error (ECE)) for the final rating & reporting. |
| 215 | + * - :code:`uncertainty/ece_bins` |
| 216 | + - int |
| 217 | + - Number of bins used for the computation of the Expected Calibration Error (ECE), Maximum Calibration Error (MCE), |
| 218 | + and the respective reliability diagrams. The default value is 20. |
| 219 | + * - :code:`uncertainty/ece_sample_threshold` |
| 220 | + - int |
| 221 | + - Sample threshold used for the computation of the ECE, MCE, D-ECE, and the respective reliability diagrams to discard |
| 222 | + bins with an amount of samples below this threshold. Discarding bins with only a small amount of samples is |
| 223 | + recommended to stabilize the ECE/MCE computations. The default value is 10. |
| 224 | + * - :code:`uncertainty/dece_bins` |
| 225 | + - int |
| 226 | + - Number of bins used for the computation of the Decetion Expected Calibration Error (D-ECE) (object detection only) |
| 227 | + and the respective reliability diagrams. The D-ECE is the counterpart of the ECE for position-dependent calibration |
| 228 | + evaluation of object detection tasks. The default value is 5. |
| 229 | + |
| 230 | +.. list-table:: Configuration settings for AI fairness evaluation. |
| 231 | + :widths: 35 10 55 |
| 232 | + :header-rows: 1 |
| 233 | + |
| 234 | + * - Key/Specifier |
| 235 | + - Dtype |
| 236 | + - Description |
| 237 | + * - :code:`fairness/examine` |
| 238 | + - boolean |
| 239 | + - Enables/disables the AI fairness evaluation for the final rating & reporting. |
| 240 | + * - :code:`fairness/sensitive_attributes/<label name>` |
| 241 | + - optional string or list of int/string |
| 242 | + - Specify one or multiple sensitive attributes (e.g., gender or age) that are used for fairness evaluation. |
| 243 | + The value of this entry is a list of target classes (given by "distinct_classes" parameter) for which the |
| 244 | + sensitive attribute is valid. For example, if "distinct_classes" specifies labels "person" and "car", a |
| 245 | + sensitive attribute for "gender" might only be valid for target label "person". If the attribute is valid for |
| 246 | + all specified target labels, you can also leave the value empty or pass "all". |
0 commit comments