Abstract
Marginalized Generalized IoU (MGIoU) is a novel, efficient loss function designed to unify the optimization of arbitrary convex shapes, such as rotated boxes, ellipses, and 3D cuboids. By projecting these shapes onto their unique surface normals, MGIoU provides a fully differentiable approximation of Intersection over Union (IoU) that is 10–40x faster than existing methods. This paper demonstrates that MGIoU consistently improves accuracy across 2D/3D detection and trajectory prediction tasks while maintaining scale invariance and computational efficiency.
Introduction
In computer vision, Intersection over Union (IoU) is the gold standard for measuring the overlap between predicted and ground-truth shapes. However, directly optimizing IoU is mathematically complex for anything beyond axis-aligned boxes. For shapes like rotated rectangles, 3D cuboids, or ellipsoids, the analytical IoU is often non-differentiable or computationally expensive, leading to unstable training gradients.
To circumvent these issues, researchers often rely on "proxy" losses like $L_1/L_2$ regression or task-specific Gaussian approximations. These proxies frequently lack essential properties like scale invariance and fail to generalize across different geometric domains. MGIoU addresses this fragmentation by providing a single, unified objective function applicable to any convex parametric shape.
The MGIoU Framework
The core innovation of MGIoU is dimensionality reduction via projection. Instead of calculating complex $D$-dimensional volume overlaps, the method leverages the Separating Axis Theorem (SAT) logic to project shapes onto their unique surface normals.
The optimization process follows four primary steps:
- Identify Normals: Extract unique normal directions (e.g., two for a 2D rectangle, three for a 3D cuboid).
- 1D Projection: Project the vertices of the predicted ($P$) and ground-truth ($G$) shapes onto these normal vectors, transforming the problem into 1D interval overlaps.
- 1D GIoU: Compute a simplified 1D version of the Generalized IoU for each normal.
- Marginalization: The final MGIoU is the average of these 1D GIoU values across all unique normals.
This framework eliminates the need for manual "loss balancing" between position, size, and rotation parameters, as the projection-based loss handles all geometric aspects holistically.
Experimental Evaluation
The authors evaluated MGIoU across several standard benchmarks, including DOTAv1.5 (2D oriented detection), ICDAR2017 (text detection), and the massive Omni3D benchmark for monocular 3D recognition.
Key Results
- Computational Efficiency: MGIoU is significantly faster than existing IoU-based losses. On the DOTA dataset, it proved to be 17x to 51x faster than KFIoU, GWD, or KLD, performing nearly as fast as simple $L_1$ regression.
- 3D Detection Performance: On the Omni3D benchmark, MGIoU outperformed the state-of-the-art "Distangled-L1 + Chamfer" loss across all sub-datasets, yielding a 9.01% overall relative improvement in $AP_{3D}$.
- Collision Avoidance: A specialized variant, MGIoU-, was applied to trajectory prediction on the Waymo Open Dataset. By minimizing overlap, it reduced collisions by 14% without requiring changes to the underlying model architecture.
Conclusion and Future Work
MGIoU provides a mathematically sound, scale-invariant, and highly efficient objective function for convex shape optimization. While currently limited to convex geometries, its ability to unify disparate detection tasks under a single loss function represents a significant step forward in geometric deep learning. Future research may extend this projection-based logic to non-convex shapes and more complex spatio-temporal optimization problems.
Summary updated