Machine Learning Foundations9 min read• Published August 07, 2026

Regression & Computer Vision Metrics: MAE, MSE, RMSE, R², IoU, Dice & mAP

Evaluating continuous numeric targets and spatial bounding box predictions in detection and segmentation tasks.

GS
Govindarajan Selvaraj
ML Engineer

⚡ Executive Summary

A practical guide to continuous error metrics (MAE, MSE, RMSE, R²) and computer vision spatial metrics (Intersection over Union, Dice Coefficient, mAP).

Key Takeaways

  • Regression Metrics — covered in depth with practical examples, formulas, and code.
  • Computer Vision Metrics — covered in depth with practical examples, formulas, and code.

Regression & Computer Vision Metrics — Foundations Guide


#1. Regression Metrics

Used when the target is a continuous number (price, temperature, demand, etc.).

1.1 MAE — Mean Absolute Error

MATHEMATICAL FORMULA MAE = (1) / (n) ∑ (i=1 to n) |yᵢ - ŷᵢ|

Interpretation: Average magnitude of error, in the same units as the target. Treats all errors linearly — a 10 error counts as exactly 10x a1 error.

When to use: You want an easily interpretable "average miss," and don't want a few big outliers to dominate the score.

python
from sklearn.metrics import mean_absolute_error
mean_absolute_error(y_true, y_pred)

1.2 MSE — Mean Squared Error

MATHEMATICAL FORMULA MSE = (1) / (n) ∑ (i=1 to n) (yᵢ - ŷᵢ)²

Interpretation: Average of squared errors. Squaring penalizes large errors much more than small ones.

When to use: Large errors are disproportionately bad in your application or as a training loss function.

1.3 RMSE — Root Mean Squared Error

MATHEMATICAL FORMULA RMSE = √(MSE)

Interpretation: Same "penalize big errors more" behavior as MSE, but back in the original units, making it directly comparable to MAE.

1.4 R² — Coefficient of Determination

MATHEMATICAL FORMULA R² = 1 - frac∑ (yᵢ - ŷᵢ)²∑ (yᵢ - ȳ)²

Adjusted R² penalizes for feature count when comparing models:

MATHEMATICAL FORMULA Adjusted R² = 1 - ≤ft[ (1 - R²) × (n - 1) / (n - k - 1) right]

1.5 Quick Comparison Table

MetricPenalizes outliers?UnitsBest for
MAENo (linear)Same as targetRobust, interpretable average error
MSEYes (quadratic)Target²Training loss, punishing big misses
RMSEYes (quadratic)Same as targetInterpretable version of MSE
Depends on residualsUnitless (0–1 typically)"% of variance explained," model comparison

#2. Computer Vision Metrics

2.1 IoU — Intersection over Union

MATHEMATICAL FORMULA IoU = (Area of Overlap) / (Area of Union)

2.2 Dice Coefficient (F1 for pixels)

MATHEMATICAL FORMULA Dice = (2 × |A ∩ B|) / (|A| + |B|)

2.3 mAP — mean Average Precision

Used in object detection benchmarks (mAP@0.5, mAP@0.5:0.95). Mean of AP across all classes.

Tags:#Regression#Computer Vision#MAE#RMSE#IoU#mAP#Dice
ABOUT THE AUTHOR
GS

Govindarajan Selvaraj

ML Engineer

Govindarajan Selvaraj is part of the Junglans Solutions engineering team, specializing in machine learning foundations. Junglans builds a 20-product ecosystem of local-first enterprise software — AI developer tools, encrypted communication, and data infrastructure with zero cloud telemetry.

Meet the full Junglans engineering team ↗
RELATED RESOURCES & REFERENCES

This article is part of the Junglans Research knowledge base, produced alongside the engineering teams that build our production AI tools. Explore related product documentation and research:

Related Research & Articles