查看性能指标 - Amazon Lookout for Vision

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

查看性能指标

您可以从控制台和通过调用 DescribeModel 操作来获取性能指标。

查看性能指标(控制台)

训练完成后,控制台会显示性能指标。

Amazon Lookout for Vision 控制台会针对测试期间所做的分类显示以下性能指标:

如果模型是分割模型,则控制台还会显示每个异常标签的以下性能指标:

测试结果概览部分会显示测试数据集中图像的正确预测和错误预测总数。您还可以看到测试数据集中各个图像的预测及实际标签分配情况。

以下过程展示了如何从项目的模型列表视图获取性能指标。

查看性能指标(控制台)
  1. 打开 Amazon Lookout for Vision 控制台,网址为 https://console.aws.amazon.com/lookoutvision/

  2. 选择开始使用

  3. 在左侧导航窗格中,选择项目

  4. 在项目视图中,选择包含您要查看的模型版本的项目。

  5. 在左侧导航窗格中,于项目名称下选择模型

  6. 在模型列表视图中,选择您要查看的模型的版本。

  7. 在模型详细信息页面,查看性能指标选项卡上的性能指标。

  8. 请注意以下几点:

    1. 模型性能指标部分中,包含模型对测试图像所做的分类预测的总体模型指标(精度、召回率、F1 分数)。

    2. 如果模型是图像分割模型,则每标签性能部分中将包含从中发现异常标签的测试图像数量。您还会看到每个异常标签的指标(F1 分数、平均 IoU)。

    3. 测试结果概览部分提供了 Lookout for Vision 用来评估模型的每张测试图像的结果。其中包括以下内容:

      • 所有测试图像的正确(真阳性)和错误(假阴性)分类预测(正常或异常)总数。

      • 每张测试图像的分类预测。如果在图像下方看到正确,表明对图像预测的分类与实际分类一致。否则,表示模型未正确对图像分类。

      • 使用图像分割模型时,您可以看到模型分配给图像的异常标签,以及图像上与异常标签的颜色匹配的掩码。

查看性能指标 (SDK)

您可以使用 DescribeModel 操作获取模型的概要性能指标(分类)、评估清单和模型的评估结果。

获取概要绩效指标

对于模型在测试期间所做的分类预测,它们的概要性能指标(精度调用F1 分数)会在通过调用 DescribeModel 返回的 Performance 字段中提供。

"Performance": { "F1Score": 0.8, "Recall": 0.8, "Precision": 0.9 },

Performance 字段不包括由分割模型返回的异常标签性能指标。您可以在 EvaluationResult 字段中获取它们。有关更多信息,请参阅 查看评估结果

有关概要性能指标的信息,请参阅步骤 1:评估模型的性能。有关示例代码,请参阅 查看您的模型 (SDK)

使用评估清单

评估清单提供了用于测试模型的各个图像的测试预测指标。对于测试数据集中的每张图像,JSON 行中包含图像的原始测试(真值)信息和模型对图像的预测。Amazon Lookout for Vision 将评估清单存储在 Amazon S3 桶中。在 DescribeModel 操作的响应中,您可以从 EvaluationManifest 字段中获取该位置。

"EvaluationManifest": { "Bucket": "lookoutvision-us-east-1-nnnnnnnnnn", "Key": "my-sdk-project-model-output/EvaluationManifest-my-sdk-project-1.json" }

文件名格式为 EvaluationManifest-project name.json。有关示例代码,请参阅 查看您的模型

在以下 JSON 示例行中,class-name 是图像内容的真值。在此示例中,图像包含异常。confidence 字段显示了 Amazon Lookout for Vision 对所做预测的置信度。

{ "source-ref"*: "s3://customerbucket/path/to/image.jpg", "source-ref-metadata": { "creation-date": "2020-05-22T21:33:37.201882" }, // Test dataset ground truth "anomaly-label": 1, "anomaly-label-metadata": { "class-name": "anomaly", "type": "groundtruth/image-classification", "human-annotated": "yes", "creation-date": "2020-05-22T21:33:37.201882", "job-name": "labeling-job/anomaly-detection" }, // Anomaly label detected by Lookout for Vision "anomaly-label-detected": 1, "anomaly-label-detected-metadata": { "class-name": "anomaly", "confidence": 0.9, "type": "groundtruth/image-classification", "human-annotated": "no", "creation-date": "2020-05-22T21:33:37.201882", "job-name": "training-job/anomaly-detection", "model-arn": "lookoutvision-some-model-arn", "project-name": "lookoutvision-some-project-name", "model-version": "lookoutvision-some-model-version" } }

查看评估结果

对于整套测试图像,评估结果中具有以下综合性能指标(分类):

评估结果还包括用于训练和测试模型的图像数量。

如果模型是分割模型,则评估结果还包括测试数据集中发现的每个异常标签的以下指标:

Amazon Lookout for Vision 将评估结果存储在 Amazon S3 桶中。在 DescribeModel 操作的响应中,您可以查看 EvaluationResult 字段的值来获取该位置。

"EvaluationResult": { "Bucket": "lookoutvision-us-east-1-nnnnnnnnnn", "Key": "my-sdk-project-model-output/EvaluationResult-my-sdk-project-1.json" }

文件名格式为 EvaluationResult-project name.json。有关示例,请参阅 查看您的模型

以下模式显示了评估结果。

{ "Version": 1, "EvaluationDetails": { "ModelArn": "string", // The Amazon Resource Name (ARN) of the model version. "EvaluationEndTimestamp": "string", // The UTC date and time that evaluation finished. "NumberOfTrainingImages": int, // The number of images that were successfully used for training. "NumberOfTestingImages": int // The number of images that were successfully used for testing. }, "AggregatedEvaluationResults": { "Metrics": { //Classification metrics. "ROCAUC": float, // ROC area under the curve. "AveragePrecision": float, // The average precision of the model. "Precision": float, // The overall precision of the model. "Recall": float, // The overall recall of the model. "F1Score": float, // The overal F1 score for the model. "PixelAnomalyClassMetrics": //Segmentation metrics. [ { "Precision": float, // The precision for the anomaly label. "Recall": float, // The recall for the anomaly label. "F1Score": float, // The F1 score for the anomaly label. "AIOU" : float, // The average Intersection Over Union for the anomaly label. "ClassName": "string" // The anomaly label. } ] } } }