Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →

Segmentation Is 99.9% Accurate (IoU), but the Box Dimensions Are Off by 5–25 cm

The box mask matched the reference at 99.9% (IoU), but a single stray pallet point 8 cm past the edge of the cargo stretches the dimensions by the same 8 cm. Across 200 synthetic boxes, the length error stayed within 5–25 cm even at an IoU of 99.7–99.9%. An outlier filter brought 95% of measurements within 3 cm, while trimming the 1% extreme points left misses of up to 18 cm. For warehouse use, validate dimensional error in centimeters, not IoU.

AI-processed from Хабр: Машинное обучение; edited by Hamidun News
Segmentation Is 99.9% Accurate (IoU), but the Box Dimensions Are Off by 5–25 cm
Source: Хабр: Машинное обучение. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceХабр: Машинное обучение ↗
Editor-in-Chief
Key metric #1IoU measures how much of the mask overlaps the reference; it cannot tell where a stray point sits
Key metric #2Switching to an oriented bounding box cut the mean absolute error (MAE) by only 2.4 cm
Key metric #3The remaining ~2 cm comes from 2–5 mm sensor noise: the bounding box snaps to the extreme points

Imagine a neural network segments a box in a 3D scan, and the check returns an IoU of 99.9%. IoU is the share of overlap between the found mask and the reference mask: nearly everything the model labeled as a box really is a box.

For ordinary segmentation, that is an excellent result. But in a warehouse, where you need to measure the length, width and height of cargo from a point cloud, the same number can hide a dimensional error of 8–12 centimeters. A single extra point from a pallet or a neighboring parcel that slips into the mask past the edge of the cargo is enough.

The author of the Habr analysis tested this on 200 synthetic point clouds: even at an IoU of 99.7–99.9%, the length error stayed within 5–25 cm.

The takeaway for anyone validating such systems: look at the dimensional error in centimeters, not at IoU.

Why IoU Doesn't See Where the Error Is

IoU divides the number of correctly found points by the size of the union of the reference and predicted masks. If a box consists of 1,000 points and one extra point from a pallet board lands in the mask, the metric barely changes. But the meaning of that point depends on its coordinates. If it sits beneath the middle of a face, the length stays correct. If it protrudes 8 cm beyond the end of the box, the dimensions grow by exactly those 8 cm. And dimensions drive billing, pallet load planning and volume records in the inventory system.

Where do these points come from? When a system is assembled from scratch on stereo cameras (for example, Intel RealSense D400) or time-of-flight ToF sensors (for example, Basler blaze), clouds from several viewpoints are stitched into a single coordinate system. Stereo pairs struggle to match uniform cardboard, ToF sensors pick up glare from stretch film, and a small calibration error splits the box edges into doubled lines. Noise of 2–5 mm consistently remains on the surface. Even with masks from SAM 2, individual points from the pallet or a neighboring parcel leak into the cloud during segmentation.

Experiment: 200 Boxes and Four Ways to Measure

The author generated 200 synthetic boxes ranging from 20×20×15 to 80×60×50 cm. Each sits on a pallet plane and is rotated around the vertical axis by up to ±25°. The five visible faces carried 1,800–2,500 points with 2–5 mm noise. The masks were then deliberately corrupted: between 1 and 32 false points were added (a protruding pallet board, the edge of a neighboring parcel, volumetric glare 5–12 cm from a face), and up to 5 true points were removed. The Python code is published in the article.

Four methods were compared:

  • Axis-aligned bounding box (AABB): the simplest option, which also inflates the size when the box is rotated;
  • Oriented bounding box (OBB): the minimum-area rectangle around the convex hull of the floor projection. The author rejected classic 3D PCA because the principal axes of nearly square boxes wander along the diagonal;
  • Percentile trimming: before building the OBB, the 1% most extreme points along each axis are discarded;
  • Statistical outlier removal (SOR) plus OBB: for each point, the mean distance to its 20 nearest neighbors is computed, and points exceeding a threshold of two standard deviations are removed. This is an analog of remove_statistical_outlier from Open3D without the heavy dependency.

Results

At an IoU of 99.7–99.9%, the error for both AABB and OBB still ranged from 5 to 25 cm. Switching from AABB to OBB cut the mean absolute error (MAE, the average deviation in centimeters) by only 2.4 cm, because the rectangle still stretches to the most distant outlier.

Trimming the 1% extreme points is fast but uneven. The median error is around 2 cm, yet the tail of misses reaches 18 cm. These are cases where more than 1% of the points on an end face were stray, and trimming along the global axes before rotation does not remove them.

SOR eliminated the tail completely: 95% of measurements came within 3 cm. The author attributes the remaining MAE of about 2 cm not to segmentation but to sensor physics. The bounding box is built from the extreme points, and on each face those are the outermost 2–3σ of the 2–5 mm Gaussian noise. Added up from both sides, this comes to roughly 1.5–2.5 cm.

The practical takeaway: add the 95th-percentile error (P95), in centimeters, to the report. It shows how the system behaves in the worst 5% of cases, which the average and IoU conceal.

Limitations

The data is synthetic, so the figures do not transfer one-to-one to a real warehouse. The author names the limits of the approach. The filter will not save you if the film is glossy and the camera misses half of a face: the resulting size will be underestimated. It also will not help when a neighboring parcel sits flush against the box and forms a single dense point cluster with it. In those cases, more precise 3D segmentation or removing the conveyor plane with RANSAC is required.

For a team preparing a dimensioning model for production, the rule is simple: test it on deliberately corrupted masks and measure the dimensional error in centimeters. A cheap outlier filter at the output of the segmentation stage delivers more than a few extra fractions of a percent of IoU.

Story

Key Questions Answered

Why IoU Doesn't See Where the Error Is?

IoU divides the number of correctly found points by the size of the union of the reference and predicted masks. If a box consists of 1,000 points and one extra point from a pallet board lands in the mask, the metric barely changes. But the meaning of that point depends on its coordinates. If it sits beneath the middle of a face, the length stays correct. If it protrudes 8 cm beyond the end of the box, the dimensions grow by exactly those 8 cm.

What are the key details on Experiment: 200 Boxes and Four Ways to Measure?

The author generated 200 synthetic boxes ranging from 20×20×15 to 80×60×50 cm. Each sits on a pallet plane and is rotated around the vertical axis by up to ±25°. The five visible faces carried 1,800–2,500 points with 2–5 mm noise. The masks were then deliberately corrupted: between 1 and 32 false points were added (a protruding pallet board, the edge of a neighboring parcel, volumetric glare 5–12 cm from a face), and up to 5 true points were removed. The Python code is published in the article.

What are the key details on Results?

At an IoU of 99.7–99.9%, the error for both AABB and OBB still ranged from 5 to 25 cm. Switching from AABB to OBB cut the mean absolute error (MAE, the average deviation in centimeters) by only 2.4 cm, because the rectangle still stretches to the most distant outlier. Trimming the 1% extreme points is fast but uneven. The median error is around 2 cm, yet the tail of misses reaches 18 cm.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — Segmentation Is 99.9% Accurate (IoU), but the Box Dimensions Are Off by 5–25 cm https://news.hamidun.com/en/news/18749/segmentation-is-99-9-accurate-iou-but-the-box-dimensions-are

What do you think?
Loading comments…