コンテンツへスキップ

パフォーマンス指標ディープダイブ

はじめに

Performance metrics are key tools to evaluate the accuracy and efficiency of object detection models. They shed light on how effectively a model can identify and localize objects within images. Additionally, they help in understanding the model's handling of false positives and false negatives. These insights are crucial for evaluating and enhancing the model's performance. In this guide, we will explore various performance metrics associated with YOLO11, their significance, and how to interpret them.



見るんだ: Ultralytics YOLO11 Performance Metrics | MAP, F1 Score, 精密, IoU & Accuracy

オブジェクト検出メトリクス

Let's start by discussing some metrics that are not only important to YOLO11 but are broadly applicable across different object detection models.

  • Intersection over Union (IoU): IoU is a measure that quantifies the overlap between a predicted bounding box and a ground truth bounding box. It plays a fundamental role in evaluating the accuracy of object localization.

  • 平均精度 (AP):APは精度-想起曲線の下での面積を計算し、モデルの精度と想起性能を包括する単一の値を提供する。

  • 平均平均精度(mAP):mAPは、複数のオブジェクトクラスにわたる平均AP値を計算することで、APの概念を拡張します。これは、モデルの性能の包括的な評価を提供するために、マルチクラスのオブジェクト検出シナリオにおいて有用である。

  • 精度(Precision)と再現率(Recall):Precisionは,すべての陽性予測の中の真陽性の比率を定量化し,偽陽性を回避するモデルの能力を評価する.一方、Recall は、すべての実際の陽性の中の真の陽性の比率を計算し、クラスのすべてのインスタンスを検出するモデルの能力を測定します。

  • F1スコア:F1スコアは、精度と想起の調和平均であり、偽陽性と偽陰性の両方を考慮しながら、モデルの性能のバランスの取れた評価を提供する。

How to Calculate Metrics for YOLO11 Model

Now, we can explore YOLO11's Validation mode that can be used to compute the above discussed evaluation metrics.

検証モードの使い方は簡単だ。学習済みモデルができたら、model.val()関数を呼び出します。この関数は検証データセットを処理し、さまざまなパフォーマンス・メトリクスを返します。しかし、これらのメトリクスは何を意味するのでしょうか?また、どのように解釈すべきでしょうか?

出力の解釈

model.val()関数の出力を分解して、出力の各セグメントを理解しよう。

クラス別指標

出力のセクションの1つは、パフォーマンス・メトリクスのクラスごとの内訳です。このきめ細かな情報は、特にオブジェクト・カテゴリが多様なデータセットにおいて、特定のクラスごとにモデルがどの程度うまくいっているかを理解しようとするときに便利です。データセットの各クラスについて、以下が提供されます:

  • クラス:person(人)、car(車)、dog(犬)など。

  • 画像:このメトリクスは、オブジェクトクラスを含む検証セット内の画像の数を示します。

  • インスタンス:これは、検証セット内のすべての画像で、そのクラスが何回出現したかをカウントする。

  • Box(P、R、mAP50、mAP50-95):このメトリックは、オブジェクトを検出する際のモデルの性能に関する洞察を提供する:

    • P(精度):検出された物体の精度。いくつの検出が正しかったかを示す。

    • R(Recall):画像内のオブジェクトのすべてのインスタンスを識別するモデルの能力。

    • mAP50: 交差点オーバーユニオン(IoU)のしきい値0.50で計算された平均平均精度。これは「簡単な」検出のみを考慮したモデルの精度の尺度である。

    • mAP50-95: 0.50から0.95までの様々なIoU閾値で計算された平均平均精度。異なる検出難易度におけるモデルのパフォーマンスを包括的に見ることができる。

スピード指標

特にリアルタイムの物体検出シナリオでは、推論のスピードは精度と同じくらい重要である。このセクションでは、前処理から後処理まで、検証プロセスの様々な段階にかかる時間を分解する。

COCO評価指標

COCOデータセットで検証するユーザーのために、COCO評価スクリプトを使用して追加のメトリクスが計算されます。これらのメトリクスは、異なるIoUしきい値や異なるサイズのオブジェクトに対する精度とリコールに関する洞察を与えます。

ビジュアル出力

model.val()関数は、数値的なメトリクスを生成するだけでなく、モデルのパフォーマンスをより直感的に理解できる視覚的な出力も生成します。以下は、期待できる視覚的出力の内訳です:

  • F1得点曲線(F1_curve.png): This curve represents the F1 score across various thresholds. Interpreting this curve can offer insights into the model's balance between false positives and false negatives over different thresholds.

  • 精度-再現曲線PR_curve.png): An integral visualization for any classification problem, this curve showcases the trade-offs between precision and recall at varied thresholds. It becomes especially significant when dealing with imbalanced classes.

  • 精度曲線P_curve.png):異なる閾値における精度値のグラフ表示。この曲線は、閾値の変化に応じて精度がどのように変化するかを理解するのに役立ちます。

  • リコール曲線R_curve.png):これに対応して、このグラフは、異なる閾値の間で想起値がどのように変化するかを示している。

  • Confusion Matrix (confusion_matrix.png):混同行列は、結果の詳細なビューを提供し、各クラスの真陽性、真陰性、偽陽性、偽陰性のカウントを表示します。

  • 正規化混同行列confusion_matrix_normalized.png):この可視化は、混同行列の正規化バージョンである。これは生の数ではなく比率でデータを表します。この形式により、クラス間の性能を比較するのがより簡単になります。

  • バリデーション・バッチ・ラベルval_batchX_labels.jpg):これらの画像は、検証データセットから得られた個別のバッチに対する真実のラベルを示す。これらの画像は、データセットに従って、オブジェクトが何であり、それぞれの位置が何であるかを明確に示している。

  • 検証バッチ予測 (val_batchX_pred.jpg): Contrasting the label images, these visuals display the predictions made by the YOLO11 model for the respective batches. By comparing these to the label images, you can easily assess how well the model detects and classifies objects visually.

結果 保管

将来の参考のために、結果は通常runs/detect/valという名前のディレクトリに保存される。

正しい指標の選択

評価するための適切なメトリクスの選択は、多くの場合、特定のアプリケーションに依存します。

  • mAP:モデルの性能を幅広く評価するのに適している。

  • IoU:対象物の正確な位置が重要な場合に不可欠。

  • 精度:誤検出を最小限に抑えることが優先される場合に重要。

  • リコール:オブジェクトのすべてのインスタンスを検出することが重要な場合に重要。

  • F1スコア:精度と想起のバランスが必要な場合に有用。

リアルタイム・アプリケーションでは、FPS(Frames Per Second)やレイテンシといったスピード・メトリクスが、タイムリーな結果を保証するために極めて重要です。

結果の解釈

メトリックを理解することが重要です。ここでは、一般的に観察される低いスコアのいくつかが示唆するものを紹介します。

  • mAPが低い:モデルの全般的な改良が必要であることを示す。

  • IoUが低い:モデルがオブジェクトを正確に特定するのに苦労している可能性がある。バウンディングボックスの方法を変えれば解決する可能性がある。

  • 精度が低い:モデルが存在しない物体を検出しすぎている可能性がある。信頼度のしきい値を調整することで、これを減らすことができる。

  • Low Recall: The model could be missing real objects. Improving feature extraction or using more data might help.

  • F1スコアのアンバランス:精度と想起の間に不均衡がある。

  • クラス別のAP:ここでのスコアが低いと、そのモデルが苦手とするクラスが浮き彫りになる。

ケーススタディ

実例は、これらの指標が実際にどのように機能するかを明確にするのに役立つ。

ケース1

  • 状況:mAPとF1スコアは最適ではないが、Recallは良いがPrecisionは良くない。

  • 解釈と行動:誤検知が多すぎる可能性がある。信頼性のしきい値を厳しくすることで、これらの誤検出を減らすことができる。

ケース2

  • 状況:MAPとリコールは問題ないが、IoUが不足している。

  • 解釈と行動:このモデルは物体をよく検出しているが、正確に位置を特定できていない可能性がある。バウンディングボックスの予測を改良することで解決できるかもしれない。

ケース3

  • 状況全体的なMAPがそこそこでも、APが他のクラスよりずっと低いクラスがある。

  • 解釈と行動:これらのクラスはモデルにとってより難しいかもしれない。これらのクラスについてより多くのデータを使用するか、トレーニング中にクラスの重みを調整することが有益である可能性がある。

接続とコラボレーション

Tapping into a community of enthusiasts and experts can amplify your journey with YOLO11. Here are some avenues that can facilitate learning, troubleshooting, and networking.

より広いコミュニティとの関わり

  • GitHub Issues: The YOLO11 repository on GitHub has an Issues tab where you can ask questions, report bugs, and suggest new features. The community and maintainers are active here, and it's a great place to get help with specific problems.

  • Ultralytics Discordサーバー: Ultralytics にはDiscordサーバーがあり、他のユーザーや開発者と交流することができます。

公式文書とリソース:

  • Ultralytics YOLO11 Docs: The official documentation provides a comprehensive overview of YOLO11, along with guides on installation, usage, and troubleshooting.

Using these resources will not only guide you through any challenges but also keep you updated with the latest trends and best practices in the YOLO11 community.

結論

In this guide, we've taken a close look at the essential performance metrics for YOLO11. These metrics are key to understanding how well a model is performing and are vital for anyone aiming to fine-tune their models. They offer the necessary insights for improvements and to make sure the model works effectively in real-life situations.

Remember, the YOLO11 and Ultralytics community is an invaluable asset. Engaging with fellow developers and experts can open doors to insights and solutions not found in standard documentation. As you journey through object detection, keep the spirit of learning alive, experiment with new strategies, and share your findings. By doing so, you contribute to the community's collective wisdom and ensure its growth.

物体検出に満足!

よくあるご質問

What is the significance of Mean Average Precision (mAP) in evaluating YOLO11 model performance?

Mean Average Precision (mAP) is crucial for evaluating YOLO11 models as it provides a single metric encapsulating precision and recall across multiple classes. mAP@0.50 measures precision at an IoU threshold of 0.50, focusing on the model's ability to detect objects correctly. mAP@0.50:0.95 averages precision across a range of IoU thresholds, offering a comprehensive assessment of detection performance. High mAP scores indicate that the model effectively balances precision and recall, essential for applications like autonomous driving and surveillance.

How do I interpret the Intersection over Union (IoU) value for YOLO11 object detection?

Intersection over Union (IoU)は、予測されたバウンディングボックスとグランドトゥルースのバウンディングボックスの重なりを測定する。IoU値は0から1の範囲で、値が大きいほどローカライズの精度が高いことを示す。IoUが1.0であれば、完璧なアライメントを意味します。通常、IoUしきい値0.50は、mAPのようなメトリクスで真陽性を定義するために使用されます。低いIoU値は、モデルが正確なオブジェクト・ローカライゼーションに苦戦していることを示唆し、バウンディング・ボックス回帰を改良するか、アノテーションの精度を上げることで改善できる。

Why is the F1 Score important for evaluating YOLO11 models in object detection?

The F1 Score is important for evaluating YOLO11 models because it provides a harmonic mean of precision and recall, balancing both false positives and false negatives. It is particularly valuable when dealing with imbalanced datasets or applications where either precision or recall alone is insufficient. A high F1 Score indicates that the model effectively detects objects while minimizing both missed detections and false alarms, making it suitable for critical applications like security systems and medical imaging.

What are the key advantages of using Ultralytics YOLO11 for real-time object detection?

Ultralytics YOLO11 offers multiple advantages for real-time object detection:

  • スピードと効率:高速推論に最適化されており、低レイテンシーを必要とするアプリケーションに適しています。
  • 高精度:高度なアルゴリズムにより、mAPとIoUのスコアが高く、精度と想起のバランスがとれています。
  • 柔軟性:物体検出、セグメンテーション、分類など様々なタスクをサポート。
  • 使いやすさ:ユーザーフレンドリーなインターフェース、豊富なドキュメント、Ultralytics HUB(HUB Quickstart)のようなプラットフォームとのシームレスな統合。

This makes YOLO11 ideal for diverse applications from autonomous vehicles to smart city solutions.

How can validation metrics from YOLO11 help improve model performance?

Validation metrics from YOLO11 like precision, recall, mAP, and IoU help diagnose and improve model performance by providing insights into different aspects of detection:

  • 精度:偽陽性の特定と最小化に役立つ。
  • リコール:すべての関連オブジェクトが検出されるようにする。
  • mAP:全体的なパフォーマンスのスナップショットを提供し、全般的な改善を導く。
  • IoU:物体の定位精度の微調整に役立つ。

これらのメトリクスを分析することで、精度を向上させるために信頼度のしきい値を調整したり、リコールを向上させるためにより多様なデータを収集したりするなど、特定の弱点をターゲットにすることができます。これらのメトリクスの詳細な説明と解釈方法については、Object Detection Metricsをご覧ください。

📅 Created 11 months ago ✏️ Updated 22 days ago

コメント