Answers.Body: <p>For classification problems, using <strong>crossentropy</strong> and <strong>bce</strong> is always my go-to option. It usually performs best for these types of problems. However, using <strong>MSE</strong> or its variants is also common in some cases. <strong>Hinge loss</strong> is another one that you might want to look at if the previous options didn't work.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-30T01:53:46.377Z
Answers.Text: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Answers.UserDisplayName: Community
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-29T23:31:12.197Z
Answers.LastActivityDate: 2022-08-29T23:31:12.197Z
Answers.UserDisplayName: ARK1375
Answers.Body: <p>You could use top-n accuracy with a couple different n values like is normally done in simple classification tasks.</p>
  <p>For a given class prediction, you score it as 1 if the ground truth label is in the top <span class="math-container">$n$</span> prediction probabilities, and 0 if it isn't in the top <span class="math-container">$n$</span>. Then you average all these values over all your relevant predictions. (see <a href="https://stats.stackexchange.com/questions/95391/what-is-the-definition-of-top-n-accuracy">https://stats.stackexchange.com/questions/95391/what-is-the-definition-of-top-n-accuracy</a> for more on this)</p>
  <p>For object detection specifically you could only count boxes towards your accuracy score that have sufficient IOU with a ground truth box so that it is only evaluating class accuracy on accurate bounding boxes.</p>
  <p>You can also make a confusion matrix (<a href="https://en.wikipedia.org/wiki/Confusion_matrix" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Confusion_matrix</a>) to see which classes are being commonly confused.</p>
  <p>The problem with using class loss as your metric, as suggested in one of the other answers, is that it's one of the parameters you'd want to play with while aiming for a better accuracy so you wouldn't have a consistent way to score your experiments.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-07T06:10:22.760Z
Answers.LastActivityDate: 2023-06-07T06:10:22.760Z
Answers.UserDisplayName: Eric Pedley
Body: <p>Object detection uses mAP as the metrics. But if we are only interested in classification once the object in a bounding box is extracted, what metrics should we use? Thanks!</p>
  
Tags: <classification><object-detection>
Title: How to measure classification accuracy in object detection task?
UserDisplayName: Curimeow Cat
ThreadText: # How to measure classification accuracy in object detection task?
  
  (Asked by: username_0 on 2022-08-29)
  
  Object detection uses mAP as the metrics. But if we are only interested in classification once the object in a bounding box is extracted, what metrics should we use? Thanks!
  
  **Tags:** classification, object-detection
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2022-08-29. Score: 0
  
  For classification problems, using **crossentropy** and **bce** is always my go-to option. It usually performs best for these types of problems. However, using **MSE** or its variants is also common in some cases. **Hinge loss** is another one that you might want to look at if the previous options didn't work.
  
  > **Comments:**
  > **username_2**: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).  
  
  ---
  
  ### Answer by username_3 on 2023-06-07. Score: 0
  
  You could use top-n accuracy with a couple different n values like is normally done in simple classification tasks.
  
  For a given class prediction, you score it as 1 if the ground truth label is in the top $n$ prediction probabilities, and 0 if it isn't in the top $n$. Then you average all these values over all your relevant predictions. (see <https://stats.stackexchange.com/questions/95391/what-is-the-definition-of-top-n-accuracy> for more on this)
  
  For object detection specifically you could only count boxes towards your accuracy score that have sufficient IOU with a ground truth box so that it is only evaluating class accuracy on accurate bounding boxes.
  
  You can also make a confusion matrix (<https://en.wikipedia.org/wiki/Confusion_matrix>) to see which classes are being commonly confused.
  
  The problem with using class loss as your metric, as suggested in one of the other answers, is that it's one of the parameters you'd want to play with while aiming for a better accuracy so you wouldn't have a consistent way to score your experiments.
  
  
  ---
  
  