Abstract
Visual object counting is a fundamental computer vision task in industrial inspection, where accurate, high-throughput inventory tracking and quality assurance are critical. Moreover, manufactured parts are often too light to reliably deduce their count from their weight, or too heavy to move the stack on a scale safely and practically, making automated visual counting the more robust solution in many scenarios. However, existing methods struggle with stacked 3D items in containers, pallets, or bins, where most objects are heavily occluded and only a few are directly visible. To address this important yet underexplored challenge, we propose a novel 3D counting approach that decomposes the task into two complementary subproblems: estimating the 3D geometry of the stack and its occupancy ratio from multi-view images. By combining geometric reconstruction with deep learning-based depth analysis, our method can accurately count identical manufactured parts inside containers, even when they are irregularly stacked and partially hidden. We validate our 3D counting pipeline on large-scale synthetic and diverse real-world data with manually verified total counts, demonstrating robust performance under realistic inspection conditions.
Introduction
In industrial logistics, determining the exact quantity of parts in a bin is a persistent challenge. Traditional methods like weighing are often impractical: parts may be too light for precision scales or too heavy to move safely. While visual counting is a natural alternative, standard 2D computer vision techniques fail when objects are "bulk-stacked" in deep containers. In these scenarios, heavy occlusion is the norm, with only the top layer visible.
Existing 2D methods that regress counts directly from images lack depth awareness, failing to distinguish between a shallow layer and a deep pile. To overcome this, we propose 3DC, a framework that treats counting as a 3D geometric puzzle, inferring the presence of hidden objects through volumetric analysis and surface patterns.
Methodology: The 3DC Pipeline
The core of the 3DC approach is a decomposition of the counting problem into a simple volumetric formula: $$N = \frac{\gamma \mathcal{V}}{V_o}$$ where $N$ is the total count, $\gamma$ is the occupancy ratio, $\mathcal{V}$ is the total volume of the stack, and $V_o$ is the volume of a single object.
The pipeline operates in three main stages:
- Volume Estimation ($\mathcal{V}$): Multi-view images are processed using SAM2 for segmentation and 3D Gaussian Splatting (3DGS) for reconstruction. A voxel carving algorithm then extracts the volume of the contents by removing container boundaries.
- Occupancy Ratio Estimation ($\gamma$): This stage involves an encoder-decoder network (DinoV2 backbone) that analyzes top-down depth maps. It regresses the occupancy ratio—the fraction of space filled by objects versus air gaps—based on visible surface patterns.
- Unit Volume ($V_o$): This is typically known from CAD models or estimated by reconstructing a single template object.
Experimental Validation
To evaluate 3DC, we developed two benchmarks:
- Synthetic Dataset: 400,000 images across 14,000 physically simulated scenes using CAD models from the ABC dataset.
- Real-World Benchmark: 3,229 images from 58 diverse scenes (e.g., bolts, jugs, foam peanuts) with manually verified ground-truth counts.
Key Results and Insights
The 3DC method significantly outperforms traditional 2D counting baselines and human estimators:
- Performance: On synthetic data, 3DC achieved a Symmetric Mean Absolute Percentage Error (sMAPE) of 27.65%, compared to 158.87% for the 2D baseline BMNet+. On real-world data, it maintained a robust 53.31% sMAPE.
- Generalization: By training the occupancy network on depth maps rather than RGB images, the model generalizes across different materials and colors, effectively becoming "material-blind."
- Human Baseline: A study with 33 participants revealed that humans struggle significantly with deep stacks, with 3DC consistently providing more accurate estimates than the human average.
Conclusion
The 3DC framework demonstrates that decomposing counting into volume and occupancy estimation is more effective than end-to-end 2D regression for stacked objects. While challenges remain regarding boundary effects in containers and extreme geometric complexity, this 3D-aware approach provides a mathematically grounded foundation for automated industrial inventory inspection.
Summary updated