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ppointnet-exp6
|
| 15 |
+
|
| 16 |
+
PointNet++ 6DoF object pose estimator for the fifteen LineMOD objects,
|
| 17 |
+
trained on masked RGB-D point clouds. This is the **exp6** checkpoint, the
|
| 18 |
+
variant trained on a **diameter-normalised ADD objective**. It is the most
|
| 19 |
+
accurate configuration on synthetic validation and the most evenly balanced
|
| 20 |
+
across object classes.
|
| 21 |
+
|
| 22 |
+
Produced for a Deep Learning for Robot Vision project at Hochschule
|
| 23 |
+
Bonn-Rhein-Sieg.
|
| 24 |
+
|
| 25 |
+
## The idea behind it
|
| 26 |
+
|
| 27 |
+
The ADD benchmark accepts a pose when the average model point distance falls
|
| 28 |
+
below 0.1 x the object's diameter. The threshold therefore scales with the
|
| 29 |
+
object, but a loss computed on absolute ADD distance does not. Training on
|
| 30 |
+
raw distance consequently favours physically large objects, whose thresholds
|
| 31 |
+
are the most forgiving: under that objective the lamp reaches 92.5% and the
|
| 32 |
+
ape 7.0%.
|
| 33 |
+
|
| 34 |
+
Dividing the loss by the object diameter aligns the objective's scale with
|
| 35 |
+
the metric's. Across the twelve asymmetric objects this leaves mean accuracy
|
| 36 |
+
essentially unchanged while cutting per-class standard deviation from
|
| 37 |
+
30.4 to 6.3 percentage points, a factor of 4.8, and lifting the weakest class
|
| 38 |
+
from 7.0% to 45.2%.
|
| 39 |
+
|
| 40 |
+
The mechanism is confirmed by a counterintuitive observation: this model has
|
| 41 |
+
a **higher** mean absolute ADD error than the unnormalised one (69 mm against
|
| 42 |
+
34.6 mm) while being more accurate. That is only possible if error moved from
|
| 43 |
+
objects with tight thresholds to objects with loose ones.
|
| 44 |
+
|
| 45 |
+
## Architecture
|
| 46 |
+
|
| 47 |
+
| | |
|
| 48 |
+
|---|---|
|
| 49 |
+
| Backbone | `PointNetPlusPlus`, SA1 to SA3, 1024 input points |
|
| 50 |
+
| Head | `PoseEstimationHead`, 512-d feature, separate rotation and translation branches |
|
| 51 |
+
| Parameters | 0.86 M |
|
| 52 |
+
| Input | 1024 points, metres, centroid-centred |
|
| 53 |
+
|
| 54 |
+
Rotation is regressed in the continuous 6D representation of Zhou et al.;
|
| 55 |
+
translation as a residual from the observed point cloud centroid.
|
| 56 |
+
|
| 57 |
+
## Results
|
| 58 |
+
|
| 59 |
+
Trained on the synthetic PBR split only, with no domain adaptation.
|
| 60 |
+
|
| 61 |
+
| Split | ADD(-S)@0.05d | ADD(-S)@0.1d | ADD(-S)@0.2d | Mean | Median |
|
| 62 |
+
|---|---|---|---|---|---|
|
| 63 |
+
| Synthetic validation | | **58.41%** | | | |
|
| 64 |
+
| Real BOP test, 3,000 images | 6.37% | 33.33% | 57.33% | 45.99 mm | 30.13 mm |
|
| 65 |
+
|
| 66 |
+
## Read this before choosing between exp6 and exp5
|
| 67 |
+
|
| 68 |
+
Normalisation wins on synthetic data by 1.05 points and **loses on real data
|
| 69 |
+
by 2.90 points**. Directing capacity toward small objects helps in
|
| 70 |
+
distribution, but small objects are exactly the ones whose real depth
|
| 71 |
+
observations are sparsest, so the gain does not survive the domain shift.
|
| 72 |
+
|
| 73 |
+
Reducing per-class variance in distribution is not the same thing as
|
| 74 |
+
robustness. If you want the better model on real images, use
|
| 75 |
+
[jan024/dlrv-pointnet-exp5](https://huggingface.co/jan024/dlrv-pointnet-exp5)
|
| 76 |
+
at 36.23%. Use this one if you care about balanced per-class behaviour on
|
| 77 |
+
data that matches the training distribution.
|
| 78 |
+
|
| 79 |
+
## Training
|
| 80 |
+
|
| 81 |
+
```
|
| 82 |
+
--experiment exp6_normadd --loss_type normalized_add --epochs 30
|
| 83 |
+
--batch_size 32 --lr 0.001 --backbone_lr 0.0005
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
The backbone learning rate matches exp5 so that the objective is the only
|
| 87 |
+
variable between the two.
|
| 88 |
+
|
| 89 |
+
## Usage
|
| 90 |
+
|
| 91 |
+
The checkpoint is a dict with keys `epoch`, `val_add`, `backbone` and
|
| 92 |
+
`pose_head`. Load it with the model definitions from the project repository:
|
| 93 |
+
|
| 94 |
+
```python
|
| 95 |
+
import torch
|
| 96 |
+
from pointnet.model import PointNetPlusPlus
|
| 97 |
+
from pose.head import PoseEstimationHead
|
| 98 |
+
|
| 99 |
+
ckpt = torch.load('exp6_normadd_best.pth', map_location='cuda')
|
| 100 |
+
|
| 101 |
+
backbone = PointNetPlusPlus(n_classes=15, n_points=1024).cuda()
|
| 102 |
+
backbone.load_state_dict(ckpt['backbone'])
|
| 103 |
+
|
| 104 |
+
pose_head = PoseEstimationHead(feature_dim=512).cuda()
|
| 105 |
+
pose_head.load_state_dict(ckpt['pose_head'])
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
To reproduce the 33.33% figure end to end:
|
| 109 |
+
|
| 110 |
+
```bash
|
| 111 |
+
python -u src/pose/eval_test_set.py \
|
| 112 |
+
--checkpoint exp6_normadd_best.pth \
|
| 113 |
+
--data_root /path/to/lm \
|
| 114 |
+
--output_json results.json
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
Roughly two minutes on an RTX A5000. LineMOD in BOP format is required and is
|
| 118 |
+
not distributed here; get it from https://bop.felk.cvut.cz/datasets/.
|
| 119 |
+
|
| 120 |
+
## Limitations
|
| 121 |
+
|
| 122 |
+
- Trained on synthetic data only, and loses more to the domain shift than the
|
| 123 |
+
surrogate-trained exp5 does.
|
| 124 |
+
- Requires a ground-truth object mask. No detection or segmentation stage is
|
| 125 |
+
included.
|
| 126 |
+
- Evaluation subsamples the point cloud and the CAD vertices without a seed,
|
| 127 |
+
so per-object figures move by a few points between runs.
|