For edge detection, the key metrics are Precision and Recall. Precision tells us how many detected edges are actually true edges, avoiding false edges. Recall tells us how many true edges were found, avoiding missed edges. Since edge detection is about finding boundaries accurately, both matter to balance sharpness and completeness.
Edge detection (Canny) in Computer Vision - Model Metrics & Evaluation
| Predicted Edge | Predicted No Edge |
|---------------------|---------------------|
| True Positive (TP) | False Negative (FN) |
| False Positive (FP) | True Negative (TN) |
TP: Pixels correctly detected as edges
FP: Pixels wrongly detected as edges
FN: Pixels missed as edges
TN: Pixels correctly detected as no edge
If you set Canny thresholds too high, you get high precision but low recall. This means edges found are mostly correct but many edges are missed. Good for clean images where false edges confuse.
If thresholds are too low, you get high recall but low precision. Many edges are found but many are false. Good if missing edges is worse than extra noise.
Example: For medical images, missing edges (low recall) can hide important details, so recall is more important. For artistic filters, precision may matter more to avoid noisy edges.
Good: Precision and recall both above 0.8 means edges are mostly correct and most true edges are found.
Bad: Precision below 0.5 means many false edges. Recall below 0.5 means many edges missed. Either hurts the usefulness of edge detection.
- Accuracy paradox: Most pixels are non-edge, so accuracy can be high even if edges are poorly detected.
- Data leakage: Using test images similar to training or tuning thresholds on test data inflates metrics.
- Overfitting: Tuning Canny thresholds too tightly on one image type may fail on others.
- Ignoring context: Edges in noisy areas may be false positives; metrics alone don't capture visual quality.
Your edge detection model has 98% accuracy but 12% recall on true edges. Is it good for production? Why or why not?
Answer: No, it is not good. The high accuracy is misleading because most pixels are non-edge. The very low recall means most true edges are missed, so the model fails to find important edges.