anhrisn commited on
Commit
d2c33e3
·
verified ·
1 Parent(s): ec67363

Add AffKernel IIT-AFF checkpoint (R50vd stride-2 + deep supervision, seed 42) and model card

Browse files
README.md ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: pytorch
4
+ pipeline_tag: image-segmentation
5
+ tags:
6
+ - affordance-segmentation
7
+ - instance-segmentation
8
+ - object-detection
9
+ - robotics
10
+ - manipulation
11
+ - rt-detr
12
+ - real-time
13
+ metrics:
14
+ - name: Weighted F-measure (beta^2=1)
15
+ type: f-measure
16
+ value: 0.8685
17
+ ---
18
+
19
+ # AffKernel: IIT-AFF affordance segmentation (R50vd, stride-2 + deep supervision)
20
+
21
+ Single-pass, NMS-free affordance segmentation. AffKernel couples RT-DETR object
22
+ queries with a CondInst-style per-query dynamic-convolution kernel that decodes
23
+ per-object affordance masks from one shared high-resolution affordance map. A
24
+ detector tells a robot *what* an object is; AffKernel also tells it *where* to
25
+ act on it, at a latency a control loop can afford.
26
+
27
+ - **Code:** https://github.com/anh0001/affkernel
28
+ - **Architecture:** RT-DETR-R50vd + affordance branch with stride-2 readout and deep supervision
29
+ - **Training data:** IIT-AFF (Nguyen et al., IROS 2017), 6,184 train images
30
+ - **Weights:** last-epoch (epoch 72) EMA parameters, fp32, 174 MB
31
+
32
+ ## Results
33
+
34
+ Evaluated on the IIT-AFF test split (2,651 images) with the Margolin weighted
35
+ F-measure.
36
+
37
+ | Metric | Value |
38
+ |---|---:|
39
+ | `F_beta^w` (beta^2 = 1), this checkpoint | **0.8685** |
40
+ | `F_beta^w` (beta^2 = 0.3), this checkpoint | 0.8582 |
41
+ | `F_beta^w` (beta^2 = 1), mean of 3 seeds | 0.8675 ± 0.0009 |
42
+ | Mask quality on detected instances | 0.8933 |
43
+ | Latency, 640x640, fp32, RTX 6000 Ada | 23.8 ms median |
44
+ | Throughput | 41.7 img/s (42 FPS) |
45
+
46
+ Against published baselines on the same benchmark: Mask R-CNN 0.844 at 45 ms,
47
+ deterministic Swin-T 0.883 at 42 ms, Bayesian Swin-T deep ensemble 0.906 at
48
+ roughly 1015 ms. AffKernel beats the Mask R-CNN baseline at about half its
49
+ latency and trails the deterministic Swin-T by 1.55 points at 57% of its
50
+ latency, with fully deterministic single-pass inference.
51
+
52
+ **On seed selection.** This is seed 42, which is both the primary anchor seed
53
+ used throughout the paper and the highest scoring of the three seeds trained
54
+ (seed 7: 0.8668, seed 123: 0.8673). IIT-AFF provides no validation split, so
55
+ the epoch was fixed a priori (last epoch, EMA weights) rather than selected on
56
+ the test set.
57
+
58
+ **On the beta convention.** Two conventions circulate in this literature. The
59
+ AffordanceNet lineage reports `beta^2 = 0.3`; recent transformer baselines
60
+ report `beta^2 = 1`. Both are given above so that comparisons can be made at a
61
+ matched convention. Do not compare a `beta^2 = 1` number against a
62
+ `beta^2 = 0.3` number.
63
+
64
+ ## Usage
65
+
66
+ ```bash
67
+ git clone https://github.com/anh0001/affkernel.git
68
+ cd affkernel
69
+ pip install -r requirements.txt
70
+
71
+ pip install huggingface_hub
72
+ hf download anhrisn/affkernel-iit-aff \
73
+ affkernel_iit_r50vd_stride2_deepsup_seed42.pth --local-dir weights/
74
+
75
+ python tools/infer.py \
76
+ -c configs/rtdetr/rtdetr_r50vd_6x_iit_v3_stride2_deepsup.yml \
77
+ -r weights/affkernel_iit_r50vd_stride2_deepsup_seed42.pth \
78
+ --input path/to/image.jpg \
79
+ --output outputs/prediction.png
80
+ ```
81
+
82
+ Reproduce the reported metric (requires the IIT-AFF dataset; see
83
+ [`docs/datasets.md`](https://github.com/anh0001/affkernel/blob/main/docs/datasets.md)):
84
+
85
+ ```bash
86
+ python tools/decompose_fbw_gap.py \
87
+ -c configs/rtdetr/rtdetr_r50vd_6x_iit_v3_stride2_deepsup.yml \
88
+ -r weights/affkernel_iit_r50vd_stride2_deepsup_seed42.pth --beta2 1.0
89
+ ```
90
+
91
+ ### Checkpoint format
92
+
93
+ A single file containing the EMA weights only:
94
+
95
+ ```python
96
+ {"ema": {"module": <OrderedDict of 760 tensors>, "updates": 111312}}
97
+ ```
98
+
99
+ The evaluation path uses the EMA parameters, so the raw (non-EMA) weights and
100
+ the optimizer state from training are not included. Do not repack this into a
101
+ bare `{"model": ...}` dict: under an EMA-enabled config the solver would then
102
+ evaluate a freshly initialised EMA module and score near zero.
103
+
104
+ The first run downloads ImageNet-pretrained ResNet-50vd backbone weights from
105
+ the RT-DETR release artefacts, so it needs network access. For an offline
106
+ deployment, set `PResNet.pretrained: False` in the config.
107
+
108
+ ## Classes
109
+
110
+ **Objects (10):** bowl, tvm, pan, hammer, knife, cup, drill, racket, spatula, bottle
111
+
112
+ **Affordances (9):** contain, cut, display, engine, grasp, hit, pound, support, w-grasp
113
+
114
+ ## Intended use and limitations
115
+
116
+ Intended for research on affordance perception and perception-guided grasping.
117
+
118
+ - Trained on a closed vocabulary of 10 object and 9 affordance classes; it will
119
+ not generalise to unseen categories.
120
+ - IIT-AFF is a tabletop dataset. Performance under other viewpoints, lighting
121
+ or clutter regimes is untested.
122
+ - The residual error is dominated by **missed detections**, not by mask quality.
123
+ On instances the detector does fire on, mask quality (0.893) already exceeds
124
+ the deterministic Swin-T baseline's overall score.
125
+ - Latency was measured at fp32 on an RTX 6000 Ada. fp16 and TensorRT are
126
+ untested; they would be expected to help but are not characterised here.
127
+ - Not validated for safety-critical deployment. A predicted grasp region is a
128
+ perception cue, not a guarantee of a safe grasp.
129
+
130
+ ## License and attribution
131
+
132
+ These weights are released under Apache-2.0, matching the licence of the
133
+ RT-DETR components and the ImageNet-pretrained backbone they were initialised
134
+ from. The AffKernel repository's own source contributions are MIT licensed; see
135
+ [`THIRD_PARTY_LICENSES.md`](https://github.com/anh0001/affkernel/blob/main/THIRD_PARTY_LICENSES.md).
136
+
137
+ The **IIT-AFF dataset is not redistributed** here or in the code repository. It
138
+ states no licence; its authors request citation of the original paper. Obtain
139
+ it from https://sites.google.com/site/iitaffdataset/.
140
+
141
+ ## Citation
142
+
143
+ ```bibtex
144
+ @article{risnumawan2026affkernel,
145
+ title = {AffKernel: Single-Pass Affordance Segmentation with Per-Query
146
+ Dynamic Convolution for Real-Time Robotic Manipulation},
147
+ author = {Risnumawan, Anhar},
148
+ journal = {IEEE Access},
149
+ year = {2026},
150
+ note = {Under review}
151
+ }
152
+
153
+ @inproceedings{nguyen2017object,
154
+ title = {Object-Based Affordances Detection with Convolutional Neural
155
+ Networks and Dense Conditional Random Fields},
156
+ author = {Nguyen, Anh and Kanoulas, Dimitrios and Caldwell, Darwin G. and
157
+ Tsagarakis, Nikos G.},
158
+ booktitle = {IEEE/RSJ International Conference on Intelligent Robots and
159
+ Systems (IROS)},
160
+ year = {2017}
161
+ }
162
+
163
+ @inproceedings{lv2024detrs,
164
+ title = {DETRs Beat YOLOs on Real-time Object Detection},
165
+ author = {Lv, Wenyu and Zhao, Yian and Xu, Shangliang and Wei, Jinman and
166
+ Wang, Guanzhong and Cui, Cheng and Du, Yuning and Dang, Qingqing
167
+ and Liu, Yi},
168
+ booktitle = {CVPR},
169
+ year = {2024}
170
+ }
171
+ ```
affkernel_iit_r50vd_stride2_deepsup_seed42.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e32f2412f1218a02ea084aae385a9d28a1f6dea5ac6d82fd4f092c4234eba6b
3
+ size 174431423