Intermediate level · Module 6: Object Detection with YOLO · Lesson 3 of 3
Evaluating Detectors, Licences and Responsible Use
Learners evaluate their detector with precision, recall, AP50 and mAP per class on public and local test sets, analyse errors, and examine licensing and responsible-use limits.
In this lesson you will
- Interpret per-class precision, recall and mAP
- Explain licensing and responsible-use limits of a detector
Key concepts
precision and recall at a confidence thresholdAP50 and mAP50-95per-class resultsAGPL-3.0use restrictions
The lesson
Precision is the share of detections that are correct; recall is the share of real objects that were found. Average precision (AP) summarises the precision-recall curve for one class; AP50 uses an IoU threshold of 0.5, and mAP averages AP over classes (mAP50-95 also averages over stricter IoU thresholds). model.val() reports them.
Report results per class and separately for the local test set. Small, distant or partly hidden objects and classes with few training examples usually perform worst.
Ultralytics YOLO is available under the AGPL-3.0 open-source licence or a paid Enterprise licence. Ultralytics states that models trained with it fall under AGPL-3.0 by default and that an Enterprise licence is required to use it without open-sourcing the whole project. Organisations must check this before deploying. Dataset terms also apply. Detectors used in public spaces must not identify individuals.
Step by step
- Run model.val() on the public validation set and on the local test set.
- Build a per-class results table for both.
- Create an error gallery of missed and false detections.
- Write a licence and responsible-use note for the project.
Evaluating a vehicle and livestock detector
Per-class precision, recall and AP50 on a 400-object validation set show where a fine-tuned YOLO detector needs work.
mAP50
81.0%
Mean of the five class APs
Illustrative validation results
Precision
86.6%
323 of 373 detections correct
Recall
80.8%
323 of 400 objects found
Weakest class
Goat 66.3%
AP50; 21 of 60 goats missed
Show the data behind the chart
| Class | Objects | Precision (%) | Recall (%) | AP50 (%) |
|---|---|---|---|---|
| Car | 120 | 91.5 | 90 | 92.1 |
| Motorcycle | 85 | 81.6 | 72.9 | 74.8 |
| Truck | 40 | 84.6 | 82.5 | 84 |
| Cow | 95 | 90 | 85.3 | 87.6 |
| Goat | 60 | 78 | 65 | 66.3 |
Interpretation
Large, common objects are detected best: cars reach 90.0% recall and 92.1% AP50.
Goats (65.0% recall) and motorcycles (72.9%) are missed most often. Both are small in the frame, often partly hidden, and goats appear in groups that the detector merges.
Precision is high overall (86.6%), so the main problem is missed objects rather than false alarms. For counting, this means the counts are likely to be too low.
Recommendations
- Add labelled images of goats and motorcycles, especially small, distant and grouped examples, and re-evaluate on the untouched local test set.
- Try a larger input size or tiling for distant objects, and measure the cost in speed.
- Report counts with their measured recall per class, and have a person check counts used for decisions.
Practice activity
Write the evaluation report and licence note for the level project.
Expected result: Correct per-class metrics on both sets, an error analysis and an accurate licence note.
Check your understanding
-
What does AP50 measure?
Show answer
Average precision for one class using an IoU threshold of 0.5.
-
What must an organisation check before deploying an Ultralytics-trained model in a closed-source product?
Show answer
The licence: AGPL-3.0 requires open-sourcing the project unless an Enterprise licence is obtained.
Further learning
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.