If you like what we're working on, please  star us on GitHub. This enables us to continue to give back to the community.

Average Precision

To comprehend accuracy for object detection, we must first comprehend the detection model findings.
A model is used to predict a positive or negative class in object recognition, and the assumptions can be correct or false. When identifying the presence of cats in a picture, for example, the positive class maybe “Cat,” and the negative category would be “No Cat.” When a forecast is right, it is called a true prediction; when it is erroneous, it is called a false prediction.

  • True positive—the model correctly predicted the presence of a tree.
  • False-positive—The model incorrectly predicted the presence of a tree.
  • False-negative—The model incorrectly anticipated that there is no tree.
  • True negative—The model accurately guessed that there is no tree.

The quality and amount of training sets, the input image, the hyperparameters, and the accuracy requirement threshold all influence the effectiveness of an object identification model.
The IoU- Intersection over Union ratio is used to determine whether a projected result is true or incorrect. The degree of overlap among the bounding box around a predicted item and the bounding box around ground reference data is measured by the IoU ratio.

Open source package for ml validation

Build Test Suites for ML Models & Data with Deepchecks

Get StartedOur GithubOur Github


  • Precision is the proportion of correct positives divided by the number of predictions made. If the model recognized 100 cats and 90 of them were right, the accuracy is 90%.

Precision = (True Positive)/(True Positive + False Positive)

  • The ratio of positive instances to the overall number of genuine (relevant) items is known as recall. The recall is 80% if the model accurately recognizes 80 cats in an image when there are really 100 trees in the picture.

Recall = (True Positive)/(True Positive + False Negative)

  • F1 score— A weighted average of accuracy and recall yields the F1 score. The ranges from 0 to 1, with 1 indicating the highest level of precision.

F1 score = (Precision × Recall)/[(Precision + Recall)/2]

  • Precision-recall curve—A depiction of accuracy (y-axis) and recall (x-axis) that serves as a measure of an object recognition model’s performance. If the precision of the model remains high as the recall grows, it is called a good predictive model.
  • Average Precision- The accuracy averages over all recall ranging from 0 to 1 at varied IoU thresholds to provide Average Precision (AP). AP may be calculated as the area under the precision-recall curve by interpolating over all points.

The average accuracy of your model reveals whether it can accurately identify all positive cases without mistakenly labeling too many negative ones as positive. As a result, if your model can handle positives appropriately, average accuracy is high. The region underneath a curve that shows the trade-off between accuracy and recall at various decision thresholds is used to compute average precision.

  • The average AP over various IoU thresholds is known as the Mean Average Precision (mAP).


Precision refers to the accuracy of a choice at a certain decision threshold. For example, consider any simulation results in less than 0.5 to be negative, and any model output more than 0.5 to be positive. However, you may want to adjust this threshold from time to time (particularly if your classes are unbalanced or if you wish to prioritize accuracy over recall or vice – versa). Average precision is comparable to the region underneath the precision-recall curve in that it offers you average precision at any and all potential thresholds. It’s a good indicator for comparing how effectively models organize predictions without taking any particular decision threshold into account. We have a model with 0.5 average precision if the model delivers “balanced” predictions that don’t tend to be wrong or right.
When a model is “expertly terrible”, it means it frequently chooses the incorrect solution. These models are so adept at selecting the wrong answer that inverting their judgments might convert them into helpful models.