Datasets:
Add files using upload-large-folder tool
Browse files- README.md +328 -0
- data/inject_global_easy/train-00000-of-00009.parquet +3 -0
- data/inject_global_easy/train-00001-of-00009.parquet +3 -0
- data/inject_global_easy/train-00002-of-00009.parquet +3 -0
- data/inject_global_easy/train-00003-of-00009.parquet +3 -0
- data/inject_global_easy/train-00008-of-00009.parquet +3 -0
- data/inject_relative_easy/train-00000-of-00009.parquet +3 -0
- data/inject_relative_easy/train-00001-of-00009.parquet +3 -0
- data/inject_relative_easy/train-00002-of-00009.parquet +3 -0
- data/inject_relative_easy/train-00003-of-00009.parquet +3 -0
- data/inject_relative_easy/train-00004-of-00009.parquet +3 -0
- data/inject_relative_easy/train-00005-of-00009.parquet +3 -0
- data/inject_relative_easy/train-00006-of-00009.parquet +3 -0
- data/inject_relative_easy/train-00007-of-00009.parquet +3 -0
- data/inject_relative_easy/train-00008-of-00009.parquet +3 -0
- data/removal_az10/train-00000-of-00009.parquet +3 -0
- data/removal_az10/train-00001-of-00009.parquet +3 -0
- data/removal_az10/train-00002-of-00009.parquet +3 -0
- data/removal_az10/train-00003-of-00009.parquet +3 -0
- data/removal_az10/train-00005-of-00009.parquet +3 -0
- data/removal_az10/train-00008-of-00009.parquet +3 -0
- data/removal_az20/train-00000-of-00009.parquet +3 -0
- data/removal_az20/train-00001-of-00009.parquet +3 -0
- data/removal_az20/train-00002-of-00009.parquet +3 -0
- data/removal_az20/train-00003-of-00009.parquet +3 -0
- data/removal_az20/train-00004-of-00009.parquet +3 -0
- data/removal_az20/train-00005-of-00009.parquet +3 -0
- data/removal_az20/train-00006-of-00009.parquet +3 -0
- data/removal_az20/train-00007-of-00009.parquet +3 -0
- data/removal_az20/train-00008-of-00009.parquet +3 -0
- data/removal_az30/train-00000-of-00009.parquet +3 -0
- data/removal_az30/train-00001-of-00009.parquet +3 -0
- data/removal_az30/train-00002-of-00009.parquet +3 -0
- data/removal_az30/train-00003-of-00009.parquet +3 -0
- data/removal_az30/train-00004-of-00009.parquet +3 -0
- data/removal_az30/train-00005-of-00009.parquet +3 -0
- data/removal_az30/train-00006-of-00009.parquet +3 -0
- data/removal_az30/train-00007-of-00009.parquet +3 -0
- data/removal_az30/train-00008-of-00009.parquet +3 -0
- data/removal_az40/train-00008-of-00009.parquet +3 -0
- data/removal_az50/train-00000-of-00009.parquet +3 -0
- data/removal_az50/train-00001-of-00009.parquet +3 -0
- data/removal_az50/train-00002-of-00009.parquet +3 -0
- data/removal_az50/train-00003-of-00009.parquet +3 -0
- data/removal_az50/train-00004-of-00009.parquet +3 -0
- data/removal_az50/train-00005-of-00009.parquet +3 -0
- data/removal_az50/train-00006-of-00009.parquet +3 -0
- data/removal_az50/train-00007-of-00009.parquet +3 -0
- data/removal_az50/train-00008-of-00009.parquet +3 -0
- load_atlas_nuscenes.py +204 -0
README.md
CHANGED
|
@@ -1,3 +1,331 @@
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-sa-4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-sa-4.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- object-detection
|
| 5 |
+
tags:
|
| 6 |
+
- atlas
|
| 7 |
+
- lidar
|
| 8 |
+
- 3d-object-detection
|
| 9 |
+
- adversarial-robustness
|
| 10 |
+
- point-cloud
|
| 11 |
+
- nuscenes
|
| 12 |
+
size_categories:
|
| 13 |
+
- 10K<n<100K
|
| 14 |
+
configs:
|
| 15 |
+
- config_name: inject_global_easy
|
| 16 |
+
data_files:
|
| 17 |
+
- split: train
|
| 18 |
+
path: data/inject_global_easy/train-*
|
| 19 |
+
- config_name: inject_global_medium
|
| 20 |
+
data_files:
|
| 21 |
+
- split: train
|
| 22 |
+
path: data/inject_global_medium/train-*
|
| 23 |
+
- config_name: inject_global_hard
|
| 24 |
+
data_files:
|
| 25 |
+
- split: train
|
| 26 |
+
path: data/inject_global_hard/train-*
|
| 27 |
+
- config_name: inject_relative_easy
|
| 28 |
+
data_files:
|
| 29 |
+
- split: train
|
| 30 |
+
path: data/inject_relative_easy/train-*
|
| 31 |
+
- config_name: inject_relative_medium
|
| 32 |
+
data_files:
|
| 33 |
+
- split: train
|
| 34 |
+
path: data/inject_relative_medium/train-*
|
| 35 |
+
- config_name: inject_relative_hard
|
| 36 |
+
data_files:
|
| 37 |
+
- split: train
|
| 38 |
+
path: data/inject_relative_hard/train-*
|
| 39 |
+
- config_name: removal_az10
|
| 40 |
+
data_files:
|
| 41 |
+
- split: train
|
| 42 |
+
path: data/removal_az10/train-*
|
| 43 |
+
- config_name: removal_az20
|
| 44 |
+
data_files:
|
| 45 |
+
- split: train
|
| 46 |
+
path: data/removal_az20/train-*
|
| 47 |
+
- config_name: removal_az30
|
| 48 |
+
data_files:
|
| 49 |
+
- split: train
|
| 50 |
+
path: data/removal_az30/train-*
|
| 51 |
+
- config_name: removal_az40
|
| 52 |
+
data_files:
|
| 53 |
+
- split: train
|
| 54 |
+
path: data/removal_az40/train-*
|
| 55 |
+
- config_name: removal_az50
|
| 56 |
+
data_files:
|
| 57 |
+
- split: train
|
| 58 |
+
path: data/removal_az50/train-*
|
| 59 |
+
- config_name: removal_az60
|
| 60 |
+
data_files:
|
| 61 |
+
- split: train
|
| 62 |
+
path: data/removal_az60/train-*
|
| 63 |
---
|
| 64 |
+
|
| 65 |
+
# ATLAS-nuScenes
|
| 66 |
+
|
| 67 |
+
Adversarial LiDAR point clouds derived from the nuScenes trainval **validation**
|
| 68 |
+
split (150 scenes, 6019 keyframes).
|
| 69 |
+
|
| 70 |
+
Anonymous release supporting a submission under review; author and affiliation
|
| 71 |
+
details are withheld for the review period.
|
| 72 |
+
|
| 73 |
+
Part of **ATLAS**: `ps3020/atlas-kitti` · `ps3020/atlas-nuscenes`
|
| 74 |
+
|
| 75 |
+
## Configs
|
| 76 |
+
|
| 77 |
+
Injection — a phantom vehicle that does not exist is added:
|
| 78 |
+
|
| 79 |
+
`inject_global_easy`, `inject_global_medium`, `inject_global_hard`,
|
| 80 |
+
`inject_relative_easy`, `inject_relative_medium`, `inject_relative_hard`
|
| 81 |
+
|
| 82 |
+
`global` fixes the phantom in world coordinates, `relative` fixes it relative to
|
| 83 |
+
the ego vehicle. `easy`/`medium`/`hard` are decreasing phantom point densities.
|
| 84 |
+
|
| 85 |
+
Removal — points in an azimuth wedge are deleted to hide a real vehicle:
|
| 86 |
+
|
| 87 |
+
`removal_az10`, `removal_az20`, `removal_az30`, `removal_az40`, `removal_az50`,
|
| 88 |
+
`removal_az60` (suffix = wedge width in degrees)
|
| 89 |
+
|
| 90 |
+
Every row is an attacked frame; there are no clean frames.
|
| 91 |
+
|
| 92 |
+
## Setup
|
| 93 |
+
|
| 94 |
+
**1. Install**
|
| 95 |
+
|
| 96 |
+
```bash
|
| 97 |
+
pip install datasets numpy
|
| 98 |
+
pip install nuscenes-devkit # only for sequence reconstruction (optional)
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
**2. Load a config**
|
| 102 |
+
|
| 103 |
+
```python
|
| 104 |
+
from datasets import load_dataset
|
| 105 |
+
ds = load_dataset("ps3020/atlas-nuscenes", "removal_az20", split="train")
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
Add `streaming=True` to avoid downloading a whole config (each is 2.5–3.7 GB).
|
| 109 |
+
|
| 110 |
+
**That is all that is required to evaluate attacks.** Each row carries the
|
| 111 |
+
complete attacked point cloud and the attacked object's box, so attack success
|
| 112 |
+
rate needs nothing else.
|
| 113 |
+
|
| 114 |
+
**3. nuScenes source data — only for sequence reconstruction**
|
| 115 |
+
|
| 116 |
+
Needed *only* if you want the clean frames this dataset does not ship (see
|
| 117 |
+
*Attacked frames only* below). Download from
|
| 118 |
+
<https://www.nuscenes.org/nuscenes> (free account): `v1.0-trainval_meta.tgz`
|
| 119 |
+
plus the ten `v1.0-trainval{01..10}_blobs_lidar.tgz` (~126 GB). Extract to:
|
| 120 |
+
|
| 121 |
+
```
|
| 122 |
+
<NUSCENES_ROOT>/
|
| 123 |
+
samples/LIDAR_TOP/ 34149 keyframe clouds
|
| 124 |
+
sweeps/LIDAR_TOP/ 297737 intermediate clouds
|
| 125 |
+
v1.0-trainval/ *.json metadata tables
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
> Some nuScenes archives carry trailing bytes that make `tar xzf` abort **silently
|
| 129 |
+
> part-way**, leaving `sweeps/` incomplete. If you hit missing-file errors, use
|
| 130 |
+
> `gzip -dc FILE.tgz | tar -x --ignore-zeros -C <NUSCENES_ROOT>` and confirm
|
| 131 |
+
> `ls sweeps/LIDAR_TOP | wc -l` reports 297737.
|
| 132 |
+
|
| 133 |
+
### Quick check
|
| 134 |
+
|
| 135 |
+
```python
|
| 136 |
+
from datasets import load_dataset
|
| 137 |
+
import numpy as np
|
| 138 |
+
|
| 139 |
+
ds = load_dataset("ps3020/atlas-nuscenes", "removal_az20",
|
| 140 |
+
split="train", streaming=True)
|
| 141 |
+
ex = next(iter(ds))
|
| 142 |
+
pts = np.asarray(ex["points"], np.float32).reshape(ex["num_points"], ex["point_dim"])
|
| 143 |
+
print(ex["segment"], ex["frame_index"], pts.shape)
|
| 144 |
+
# scene-0003 32 (259188, 6)
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
## Usage
|
| 148 |
+
|
| 149 |
+
```python
|
| 150 |
+
from datasets import load_dataset
|
| 151 |
+
import numpy as np
|
| 152 |
+
|
| 153 |
+
ds = load_dataset("ps3020/atlas-nuscenes", "removal_az20", split="train")
|
| 154 |
+
ex = ds[0]
|
| 155 |
+
|
| 156 |
+
# points are stored FLAT -- reshape to recover the cloud
|
| 157 |
+
pts = np.asarray(ex["points"], np.float32).reshape(ex["num_points"], ex["point_dim"])
|
| 158 |
+
# (N, 6) = x, y, z, intensity, time, lag (10-sweep accumulated, N ~ 265k)
|
| 159 |
+
|
| 160 |
+
spoof_gt = np.asarray(ex["spoof_gt"], np.float32) # (7,) injection | (10,) removal
|
| 161 |
+
gt_boxes = np.asarray(ex["gt_boxes"], np.float32).reshape(ex["num_gt"], ex["gt_box_dim"])
|
| 162 |
+
pose = np.asarray(ex["pose"], np.float64).reshape(4, 4) # ref(lidar) -> global
|
| 163 |
+
```
|
| 164 |
+
|
| 165 |
+
Or use the bundled helper:
|
| 166 |
+
|
| 167 |
+
```python
|
| 168 |
+
from load_atlas_nuscenes import load_atlas, points_of, attacked_index
|
| 169 |
+
|
| 170 |
+
ds = load_atlas("removal_az20")
|
| 171 |
+
pts = points_of(ds[0])
|
| 172 |
+
idx = attacked_index(ds) # {segment: {frame_index: row}}
|
| 173 |
+
```
|
| 174 |
+
|
| 175 |
+
## Attack success rate
|
| 176 |
+
|
| 177 |
+
`spoof_gt` is the attacked object. Score each frame by whether a prediction
|
| 178 |
+
overlaps it at IoU >= 0.3:
|
| 179 |
+
|
| 180 |
+
- **injection** — success = a detection *appears* (false positive created)
|
| 181 |
+
- **removal** — success = the detection *is missing* (true positive destroyed)
|
| 182 |
+
|
| 183 |
+
```python
|
| 184 |
+
n_success = 0
|
| 185 |
+
for ex in ds:
|
| 186 |
+
pts = np.asarray(ex["points"], np.float32).reshape(ex["num_points"], ex["point_dim"])
|
| 187 |
+
pred = my_detector(pts)
|
| 188 |
+
hit = overlaps(pred, ex["spoof_gt"], iou_thresh=0.3)
|
| 189 |
+
n_success += hit if "inject" in config else (not hit)
|
| 190 |
+
|
| 191 |
+
asr = n_success / len(ds)
|
| 192 |
+
```
|
| 193 |
+
|
| 194 |
+
**Use `len(ds)`, not 6019.** Only attacked frames are shipped and only they are
|
| 195 |
+
scored. Counts differ per family because removal additionally requires a trackable
|
| 196 |
+
vehicle:
|
| 197 |
+
|
| 198 |
+
| family | configs | attacked frames each |
|
| 199 |
+
|---|---|---|
|
| 200 |
+
| injection | 6 | 1219 |
|
| 201 |
+
| removal | 6 | 869 |
|
| 202 |
+
|
| 203 |
+
## Attacked frames only
|
| 204 |
+
|
| 205 |
+
A nuScenes scene is ~40 keyframes and the attack covers the last 8, so ~80% of
|
| 206 |
+
each split would be a **bit-identical copy of source nuScenes**. Those frames are
|
| 207 |
+
not shipped, for three reasons: they are nuScenes' data rather than ours and
|
| 208 |
+
redistributing them would bypass nuScenes' own registration and license terms;
|
| 209 |
+
they are identical across all 12 configs, so shipping them means 12 duplicate
|
| 210 |
+
copies; and they are never scored, since ASR is defined only on attacked frames.
|
| 211 |
+
|
| 212 |
+
Nothing is lost. The omitted frames are unmodified, so a full sequence is
|
| 213 |
+
recovered by substitution. Every row carries four keys back to the source:
|
| 214 |
+
|
| 215 |
+
| key | meaning |
|
| 216 |
+
|---|---|
|
| 217 |
+
| `segment` | scene name, e.g. `"scene-0003"` |
|
| 218 |
+
| `frame_index` | position within the scene (0-based) |
|
| 219 |
+
| `sample_token` | **nuScenes sample token — the canonical global key** |
|
| 220 |
+
| `frame_id` | source `LIDAR_TOP` filename |
|
| 221 |
+
|
| 222 |
+
Prefer `sample_token`: it is nuScenes' own primary key and does not depend on
|
| 223 |
+
reproducing our scene ordering.
|
| 224 |
+
|
| 225 |
+
### Reconstructing a full sequence
|
| 226 |
+
|
| 227 |
+
This dataset is standalone — it is not a patch layer over nuScenes, and nothing
|
| 228 |
+
substitutes frames automatically. If you want full sequences, mix the two sources
|
| 229 |
+
in your own loader. This example is complete and runnable:
|
| 230 |
+
|
| 231 |
+
```python
|
| 232 |
+
import os
|
| 233 |
+
import numpy as np
|
| 234 |
+
from nuscenes.nuscenes import NuScenes
|
| 235 |
+
from datasets import load_dataset
|
| 236 |
+
|
| 237 |
+
NUSCENES_ROOT = "/path/to/nuscenes"
|
| 238 |
+
nusc = NuScenes(version="v1.0-trainval", dataroot=NUSCENES_ROOT, verbose=False)
|
| 239 |
+
ds = load_dataset("ps3020/atlas-nuscenes", "removal_az20", split="train")
|
| 240 |
+
|
| 241 |
+
attacked = {} # {segment: {frame_index: row}}
|
| 242 |
+
for r in ds:
|
| 243 |
+
attacked.setdefault(r["segment"], {})[r["frame_index"]] = r
|
| 244 |
+
|
| 245 |
+
def clean_cloud(sample_token):
|
| 246 |
+
"""One clean nuScenes keyframe as (N, 5) = x, y, z, intensity, ring."""
|
| 247 |
+
sd = nusc.get("sample_data", nusc.get("sample", sample_token)["data"]["LIDAR_TOP"])
|
| 248 |
+
return np.fromfile(os.path.join(NUSCENES_ROOT, sd["filename"]),
|
| 249 |
+
dtype=np.float32).reshape(-1, 5)
|
| 250 |
+
|
| 251 |
+
scene_name = "scene-0003"
|
| 252 |
+
scene = next(s for s in nusc.scene if s["name"] == scene_name)
|
| 253 |
+
|
| 254 |
+
sequence, tok = [], scene["first_sample_token"]
|
| 255 |
+
for i in range(scene["nbr_samples"]):
|
| 256 |
+
if i in attacked[scene_name]:
|
| 257 |
+
row = attacked[scene_name][i]
|
| 258 |
+
pts = np.asarray(row["points"], np.float32).reshape(
|
| 259 |
+
row["num_points"], row["point_dim"]) # (N, 6), ATTACKED
|
| 260 |
+
sequence.append((pts, True))
|
| 261 |
+
else:
|
| 262 |
+
sequence.append((clean_cloud(tok), False)) # clean, from your copy
|
| 263 |
+
tok = nusc.get("sample", tok)["next"]
|
| 264 |
+
|
| 265 |
+
print(f"{scene_name}: {len(sequence)} frames, "
|
| 266 |
+
f"{sum(a for _, a in sequence)} attacked")
|
| 267 |
+
# scene-0003: 40 frames, 7 attacked
|
| 268 |
+
```
|
| 269 |
+
|
| 270 |
+
For an existing pipeline, one dict lookup is usually enough:
|
| 271 |
+
|
| 272 |
+
```python
|
| 273 |
+
attacked_by_token = {r["sample_token"]: r for r in ds}
|
| 274 |
+
|
| 275 |
+
def get_points(sample_token):
|
| 276 |
+
r = attacked_by_token.get(sample_token)
|
| 277 |
+
if r is not None:
|
| 278 |
+
return np.asarray(r["points"], np.float32).reshape(r["num_points"], r["point_dim"])
|
| 279 |
+
return my_existing_loader(sample_token)
|
| 280 |
+
```
|
| 281 |
+
|
| 282 |
+
Three things to know when doing this:
|
| 283 |
+
|
| 284 |
+
- **Clean and attacked clouds are not the same width.** Ours are `(N, 6)` at ~265k
|
| 285 |
+
points because they are 10-sweep accumulated. A single raw `.pcd.bin` is `(N, 5)`
|
| 286 |
+
at ~35k points with `ring` as the 5th column. If your loader accumulates sweeps
|
| 287 |
+
itself, do **not** re-accumulate ours — they are already assembled.
|
| 288 |
+
- **Reproducing our clean frames exactly needs the detector pipeline, not just
|
| 289 |
+
sweep accumulation.** `load_atlas_nuscenes.clean_cloud()` accumulates 10 sweeps
|
| 290 |
+
and is fine for inspection, but it omits the point-cloud range filter and returns
|
| 291 |
+
~1.3× too many points (~347k vs ~265k). For a numerically matched clean baseline,
|
| 292 |
+
load through the same config used for evaluation (e.g. OpenPCDet
|
| 293 |
+
`NuScenesDataset` with the standard 10-sweep nuScenes config).
|
| 294 |
+
- **`frame_id` is the `.pcd` stem** while nuScenes stores `<stem>.pcd.bin`, so a
|
| 295 |
+
filename equality check fails. Use `sample_token`.
|
| 296 |
+
|
| 297 |
+
For **attack evaluation none of this applies**: ASR uses only the shipped frames.
|
| 298 |
+
|
| 299 |
+
## Fields
|
| 300 |
+
|
| 301 |
+
| field | description |
|
| 302 |
+
|---|---|
|
| 303 |
+
| `segment`, `frame_index`, `num_frames_in_segment` | position within the scene |
|
| 304 |
+
| `sample_token`, `frame_id` | nuScenes identity |
|
| 305 |
+
| `points`, `num_points`, `point_dim` | attacked cloud, flattened; reshape to `(N, 6)` |
|
| 306 |
+
| `spoof_gt`, `spoof_gt_dim` | attacked object — `(7,)` injection, `(10,)` removal |
|
| 307 |
+
| `gt_boxes`, `num_gt`, `gt_box_dim` | clean nuScenes GT `(M, 10)`, last column = 1-indexed class (car = 1) |
|
| 308 |
+
| `pose` | 4×4 ref(lidar) → global, flattened |
|
| 309 |
+
| `atk_*` | attack parameters — 7 fields for injection, 21 for removal |
|
| 310 |
+
|
| 311 |
+
For removal, the realised removal rate is
|
| 312 |
+
`atk_n_points_removed / atk_n_points_in_sector`.
|
| 313 |
+
|
| 314 |
+
## Notes
|
| 315 |
+
|
| 316 |
+
- Point clouds are **10-sweep accumulated** (~265k points/frame), the standard
|
| 317 |
+
nuScenes detection setting. Feature 4 is a timestamp, not elongation.
|
| 318 |
+
- `spoof_gt` has 10 columns for removal (a real GT box: geometry + velocity +
|
| 319 |
+
class) but 7 for injection (a phantom: geometry only).
|
| 320 |
+
- Attacks target the **car** class.
|
| 321 |
+
- Removal follows the A-HFR model, with per-width removal probabilities calibrated
|
| 322 |
+
against physical measurements from Cao et al., USENIX Security 2023. Its
|
| 323 |
+
range-dependent firing gate means not every scheduled frame fires.
|
| 324 |
+
- Phantom intensity is sampled from the diffuse range-conditioned distribution
|
| 325 |
+
rather than saturated; see the paper for the ablation.
|
| 326 |
+
|
| 327 |
+
## License
|
| 328 |
+
|
| 329 |
+
`cc-by-nc-sa-4.0`, inherited from nuScenes. These are derived point clouds, so the
|
| 330 |
+
non-commercial and share-alike terms of the original apply. Please cite nuScenes
|
| 331 |
+
alongside this dataset.
|
data/inject_global_easy/train-00000-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9c3f0f1a0b657c8b1cef5e7facfcd913ee81ad79a7886b378a21fc117d75ac1a
|
| 3 |
+
size 429896695
|
data/inject_global_easy/train-00001-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9be2edf77ba75ecc1bbee4134f6328029467048ac43213a7d1c84dbf44db55c8
|
| 3 |
+
size 401016788
|
data/inject_global_easy/train-00002-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8bcdc50ddd3e29340a8354e5128133dfaad69d47c650b307b8cb94949716a491
|
| 3 |
+
size 428932742
|
data/inject_global_easy/train-00003-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e97ac4982bc542abdc148812ef04e5b228bf3baf1d5ecf4c955f30ffaf4179d5
|
| 3 |
+
size 435614544
|
data/inject_global_easy/train-00008-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:31cbe37c5fff9d35404a2ee4f5c794bc0cd3c7fe2589154554767137ea979594
|
| 3 |
+
size 158359355
|
data/inject_relative_easy/train-00000-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db4cfe90f2a07d1dc74a48782a9d1d58e92ad8251fea6958b6f5c2bb61e03789
|
| 3 |
+
size 429846144
|
data/inject_relative_easy/train-00001-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e256992f8f62712be50c9e97e2f3f2d7e7c12aef130e14b491bbab5e60ef20db
|
| 3 |
+
size 400990294
|
data/inject_relative_easy/train-00002-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7d444b65fd39ed74db97ff88bf8fd431872fc9a5107b9c79cfab7881e1d54dd5
|
| 3 |
+
size 428929621
|
data/inject_relative_easy/train-00003-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fd27d53a4d5e0ccc1c458ad1bc9fb3a055ad84c002d8b90360aedac9a1e54037
|
| 3 |
+
size 435563742
|
data/inject_relative_easy/train-00004-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0bcbaeb38e862fb55ed01ecee9a47dc5f2370e9716557f4d8cdb28f4fb9f4b80
|
| 3 |
+
size 414168429
|
data/inject_relative_easy/train-00005-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:92a3209fa4ab8ae7d4c106d6e9da83e48e4194bafc0f738b152921fd2c0fe441
|
| 3 |
+
size 439856115
|
data/inject_relative_easy/train-00006-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5d72ea6b049c4fcdeeadf4a565295d7866459a4d5b01ebf5c85b3a543270c2b6
|
| 3 |
+
size 476720750
|
data/inject_relative_easy/train-00007-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1b586727d52c1a6465e5620d83ad15b7fdda1cdb0f3b94040919749008b3b53b
|
| 3 |
+
size 481042337
|
data/inject_relative_easy/train-00008-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:536c953c9dd17f371f3b1583481b77489fef90ac52d1775e4d86ad56a0f82f27
|
| 3 |
+
size 158366486
|
data/removal_az10/train-00000-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:74dce64a4f8b7f6a58040fd7e105647ad9f6409537d69072397ce8f26851b902
|
| 3 |
+
size 311177966
|
data/removal_az10/train-00001-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:55afa18699a0c392082c0bb91e21bdb7196f9661f01e6bdd3eedf3fd8fa38c02
|
| 3 |
+
size 356694600
|
data/removal_az10/train-00002-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ac735fb18935221139697f740fb187ade42a4363c732cfbca70ffe82199034b2
|
| 3 |
+
size 321553684
|
data/removal_az10/train-00003-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ea557757579309828c72dbc239db7dac8aa6870c4209677cfa516ef1aaee691a
|
| 3 |
+
size 274077745
|
data/removal_az10/train-00005-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:88e7aca5ed6a948d446298aaa2d166d9b00c6aecf6960f5fad4142f3480877f5
|
| 3 |
+
size 313866493
|
data/removal_az10/train-00008-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:842c83ffc42968d572bfca17d9a13ee4edac15db8650b5400cf1a80f822f1938
|
| 3 |
+
size 81828053
|
data/removal_az20/train-00000-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ab41d8f3370f732815e0ef75004036180927d89f953e1fd7787f3b7da5465302
|
| 3 |
+
size 308699039
|
data/removal_az20/train-00001-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ecf8020eb161f0dc72d5406b8fa5010810c0190dcedaba5c702f4d91dad79712
|
| 3 |
+
size 354555619
|
data/removal_az20/train-00002-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9d4ba7abae410275b4b064a3ce23b7622d7a830f8e817db528434dcf3d6342eb
|
| 3 |
+
size 318326908
|
data/removal_az20/train-00003-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:368633e34a14438d0d001a171e7c6398864f18ad73d9b554fa266998212e5622
|
| 3 |
+
size 271915443
|
data/removal_az20/train-00004-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e4f2d6ad53b4e9d49d5005d2b0dcefc424380100f058513a997951561ddff44
|
| 3 |
+
size 346753401
|
data/removal_az20/train-00005-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a085671151a7531f6f23a839c81a269071890b9c5034f67e1d4a22cde8b8957e
|
| 3 |
+
size 311203419
|
data/removal_az20/train-00006-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8eb750c2d19bd250f6443b4db5f4a8618d6c1d8a4d299e575b7caab3da2790bf
|
| 3 |
+
size 239124154
|
data/removal_az20/train-00007-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5a00ef41be0d6cae00a5c13c963314d8a3a83da62346822904aaed2fe856a6c7
|
| 3 |
+
size 332821415
|
data/removal_az20/train-00008-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:07e767061f0b198e3b0d42b3b1c75fd1b0f6c495f9afd3469e200370d59b4d83
|
| 3 |
+
size 81432205
|
data/removal_az30/train-00000-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f6da399821e8c65105d51be2bfe6c81bffb2c7b9df311cffb4630dc1cbc12d67
|
| 3 |
+
size 305963970
|
data/removal_az30/train-00001-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:463ac4764faf310f9f94c1d9a6c2a4e2290d05560e6a9630daa4e4cae86e577a
|
| 3 |
+
size 352588221
|
data/removal_az30/train-00002-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:214c0b4cc40091533105ede7ad08e3ea37e2b029a69ed3cd69992b1056e0489a
|
| 3 |
+
size 315022341
|
data/removal_az30/train-00003-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1c220ec35f1971fb81ba4c9d0265e605faca5b84cd8c833655d2722920a895be
|
| 3 |
+
size 269890725
|
data/removal_az30/train-00004-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5b405b8883ac5d6e9518061721d98b91de0c39859ed69777f3cad095c7dc8fdc
|
| 3 |
+
size 344654193
|
data/removal_az30/train-00005-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8166d9de85afd59414a7932c1698837ebc7a45b11be5d79c72a9fee4abc031a5
|
| 3 |
+
size 308435769
|
data/removal_az30/train-00006-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6dc5d049cd457429c7f7ce6876071152e2fb58fe9cba04078f31ec98449ba045
|
| 3 |
+
size 237518458
|
data/removal_az30/train-00007-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3c017d18829f0003a5f6fbe491748a61892061ff2c5aad2c5cd723f334904b74
|
| 3 |
+
size 329991012
|
data/removal_az30/train-00008-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6cabffc2903b325cf99b2cf04e2ac46c90e15308e71870371462f85428ad4a50
|
| 3 |
+
size 80968684
|
data/removal_az40/train-00008-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6f6d88e8049ed368e6b661c372af418c12464b0e7a462c361a8d232e7d722caa
|
| 3 |
+
size 80503337
|
data/removal_az50/train-00000-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:293cde14383661eb6f6379234f20c742a37428d07dfe134d031613e33af716a4
|
| 3 |
+
size 301729008
|
data/removal_az50/train-00001-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ad25220f516ba59efbdfa4c0fa7cd7c669488a2fea8674b5e98928b67005e5a0
|
| 3 |
+
size 349150193
|
data/removal_az50/train-00002-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8068aaf882d1e1f3a964155086ce803f676d75ffe8415ac4fab615d760f7c424
|
| 3 |
+
size 310055095
|
data/removal_az50/train-00003-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:102280b4ad906977bc3352e8224a555bc8a8f1b08ccb91e3a59c3455a2bcf2b2
|
| 3 |
+
size 266591079
|
data/removal_az50/train-00004-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:73086c981948890fbf5ca663ee2804428b87a42a0ef8846d7481a78399331ed9
|
| 3 |
+
size 341199099
|
data/removal_az50/train-00005-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b363a1d0ab98cb43f58917b9ea66513e024f3ad717e97cb282dd119bed6c2ae6
|
| 3 |
+
size 304236273
|
data/removal_az50/train-00006-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:45a41116272eae17eec0ef16500c20140066f434e82e15ce299ca79737b128ce
|
| 3 |
+
size 234891249
|
data/removal_az50/train-00007-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:43bccd19e3df98afb85c3a87d51c29eff81e244bdd4d6a7d80ab432865551a57
|
| 3 |
+
size 325361158
|
data/removal_az50/train-00008-of-00009.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7e9aa16520b1e3e4bd1edb24a931d7026046083fed085b522dc3608fe8625f3a
|
| 3 |
+
size 80200462
|
load_atlas_nuscenes.py
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python
|
| 2 |
+
"""Loader + sequence reconstruction for ATLAS-nuScenes.
|
| 3 |
+
|
| 4 |
+
Only the ATTACKED frames are shipped. A nuScenes scene is ~40 frames but the
|
| 5 |
+
attack covers the last 8, so the other ~80% of every split is a bit-identical copy
|
| 6 |
+
of source nuScenes -- shipping it would cost ~242 GB across 12 splits instead of
|
| 7 |
+
~40 GB, of which ~200 GB would be twelve duplicate copies of the same clean clouds.
|
| 8 |
+
|
| 9 |
+
Nothing is lost: attack success rate is defined only on attacked frames, and the
|
| 10 |
+
omitted frames are unmodified, so a full sequence is recovered by substituting our
|
| 11 |
+
frames into your own nuScenes copy. Each row carries four keys back to the source:
|
| 12 |
+
|
| 13 |
+
segment scene name, e.g. "scene-0003"
|
| 14 |
+
frame_index position within the scene (0-based)
|
| 15 |
+
sample_token nuScenes sample token -- the canonical global key
|
| 16 |
+
frame_id source LIDAR_TOP filename
|
| 17 |
+
|
| 18 |
+
Prefer `sample_token`: it is nuScenes' own primary key and does not depend on our
|
| 19 |
+
scene ordering or naming conventions.
|
| 20 |
+
|
| 21 |
+
from load_atlas_nuscenes import load_atlas, points_of, attacked_index
|
| 22 |
+
|
| 23 |
+
ds = load_atlas("removal_az20")
|
| 24 |
+
idx = attacked_index(ds) # {segment: {frame_index: row}}
|
| 25 |
+
pts = points_of(ds[0]) # (N, 6) x,y,z,intensity,time,lag
|
| 26 |
+
"""
|
| 27 |
+
import numpy as np
|
| 28 |
+
|
| 29 |
+
REPO = "ps3020/atlas-nuscenes"
|
| 30 |
+
|
| 31 |
+
INJECT_CONFIGS = [f"inject_{m}_{d}" for m in ("global", "relative")
|
| 32 |
+
for d in ("easy", "medium", "hard")]
|
| 33 |
+
REMOVAL_CONFIGS = [f"removal_az{a}" for a in (10, 20, 30, 40, 50, 60)]
|
| 34 |
+
CONFIGS = INJECT_CONFIGS + REMOVAL_CONFIGS
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def load_atlas(config, split="train", repo=REPO, **kw):
|
| 38 |
+
"""load_dataset wrapper. Pass streaming=True to avoid materialising the split."""
|
| 39 |
+
from datasets import load_dataset
|
| 40 |
+
if config not in CONFIGS:
|
| 41 |
+
raise ValueError(f"unknown config {config!r}; expected one of {CONFIGS}")
|
| 42 |
+
return load_dataset(repo, config, split=split, **kw)
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def points_of(example):
|
| 46 |
+
"""Attacked cloud as (N, 6): x, y, z, intensity, time, lag.
|
| 47 |
+
|
| 48 |
+
nuScenes clouds here are 10-sweep accumulated, so N is ~265k.
|
| 49 |
+
"""
|
| 50 |
+
return np.asarray(example["points"], dtype=np.float32).reshape(
|
| 51 |
+
example["num_points"], example["point_dim"])
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def spoof_gt_of(example):
|
| 55 |
+
"""The attacked object.
|
| 56 |
+
|
| 57 |
+
Injection -> (7,) phantom box [x, y, z, dx, dy, dz, heading].
|
| 58 |
+
Removal -> (10,) the real GT box we tried to erase: the same 7 plus
|
| 59 |
+
(vx, vy, class_label).
|
| 60 |
+
`spoof_gt_dim` records which.
|
| 61 |
+
"""
|
| 62 |
+
return np.asarray(example["spoof_gt"], dtype=np.float32)
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
def gt_boxes_of(example):
|
| 66 |
+
"""Clean nuScenes GT for this frame as (M, 10).
|
| 67 |
+
|
| 68 |
+
Columns are [x, y, z, dx, dy, dz, heading, vx, vy, class_label], where the
|
| 69 |
+
class label is 1-indexed (car = 1).
|
| 70 |
+
"""
|
| 71 |
+
n, dim = example["num_gt"], example["gt_box_dim"]
|
| 72 |
+
return np.asarray(example["gt_boxes"], dtype=np.float32).reshape(n, dim)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def pose_of(example):
|
| 76 |
+
"""4x4 ref(lidar) -> global transform for this frame."""
|
| 77 |
+
return np.asarray(example["pose"], dtype=np.float64).reshape(4, 4)
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
def attacked_index(dataset):
|
| 81 |
+
"""{segment: {frame_index: row}} -- which frames of which scenes are attacked.
|
| 82 |
+
|
| 83 |
+
Use this to drive reconstruction without loading point data twice.
|
| 84 |
+
"""
|
| 85 |
+
out = {}
|
| 86 |
+
for r in dataset:
|
| 87 |
+
out.setdefault(r["segment"], {})[r["frame_index"]] = r
|
| 88 |
+
return out
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
def attacked_tokens(dataset):
|
| 92 |
+
"""{sample_token: row}. The robust join key against your nuScenes copy."""
|
| 93 |
+
return {r["sample_token"]: r for r in dataset}
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
def reconstruct_segment(dataset_or_index, segment, clean_loader,
|
| 97 |
+
num_frames=None):
|
| 98 |
+
"""Rebuild a full scene, substituting attacked frames for clean ones.
|
| 99 |
+
|
| 100 |
+
`clean_loader(frame_index) -> (N, C) array` must return YOUR unmodified
|
| 101 |
+
nuScenes cloud for that position in the scene. Frames we did not attack are
|
| 102 |
+
bit-identical to source, so substitution is lossless.
|
| 103 |
+
|
| 104 |
+
Returns a list of (points, is_attacked, row_or_None), ordered by frame_index.
|
| 105 |
+
"""
|
| 106 |
+
idx = (dataset_or_index if isinstance(dataset_or_index, dict)
|
| 107 |
+
else attacked_index(dataset_or_index))
|
| 108 |
+
frames = idx.get(segment, {})
|
| 109 |
+
if not frames:
|
| 110 |
+
raise KeyError(f"no attacked frames for segment {segment!r}")
|
| 111 |
+
if num_frames is None:
|
| 112 |
+
num_frames = next(iter(frames.values()))["num_frames_in_segment"]
|
| 113 |
+
|
| 114 |
+
out = []
|
| 115 |
+
for i in range(num_frames):
|
| 116 |
+
if i in frames:
|
| 117 |
+
out.append((points_of(frames[i]), True, frames[i]))
|
| 118 |
+
else:
|
| 119 |
+
out.append((clean_loader(i), False, None))
|
| 120 |
+
return out
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
def clean_cloud(nusc, nuscenes_root, sample_token, n_sweeps=10):
|
| 124 |
+
"""A CLEAN 10-sweep nuScenes cloud as (N, 5) = x, y, z, intensity, time.
|
| 125 |
+
|
| 126 |
+
APPROXIMATE, and deliberately so. This reproduces the sweep accumulation but
|
| 127 |
+
NOT the detector pipeline's subsequent point-cloud range filter, so it returns
|
| 128 |
+
roughly 1.3x more points than the clean frames the attacked ones were built
|
| 129 |
+
from (measured: ~347k here vs ~265k in-split). Use it to inspect or visualise
|
| 130 |
+
a sequence, NOT to construct a numerically matched clean baseline.
|
| 131 |
+
|
| 132 |
+
For a matched baseline, load the frame through the same detector config used
|
| 133 |
+
for evaluation (e.g. OpenPCDet `NuScenesDataset` with the standard 10-sweep
|
| 134 |
+
nuScenes config), which applies the range filter. That path is what produced
|
| 135 |
+
the clouds shipped here.
|
| 136 |
+
|
| 137 |
+
A single raw `.pcd.bin` is ~35k points with `ring` as the 5th column -- not
|
| 138 |
+
comparable to the accumulated clouds at all.
|
| 139 |
+
|
| 140 |
+
`nusc` is a nuscenes.nuscenes.NuScenes instance.
|
| 141 |
+
"""
|
| 142 |
+
import os
|
| 143 |
+
sample = nusc.get("sample", sample_token)
|
| 144 |
+
sd_token = sample["data"]["LIDAR_TOP"]
|
| 145 |
+
ref_sd = nusc.get("sample_data", sd_token)
|
| 146 |
+
ref_time = 1e-6 * ref_sd["timestamp"]
|
| 147 |
+
|
| 148 |
+
clouds = []
|
| 149 |
+
tok = sd_token
|
| 150 |
+
for _ in range(n_sweeps):
|
| 151 |
+
if not tok:
|
| 152 |
+
break
|
| 153 |
+
sd = nusc.get("sample_data", tok)
|
| 154 |
+
path = os.path.join(nuscenes_root, sd["filename"])
|
| 155 |
+
if not os.path.exists(path):
|
| 156 |
+
break
|
| 157 |
+
pts = np.fromfile(path, dtype=np.float32).reshape(-1, 5)[:, :4]
|
| 158 |
+
dt = ref_time - 1e-6 * sd["timestamp"]
|
| 159 |
+
clouds.append(np.hstack([pts, np.full((len(pts), 1), dt, np.float32)]))
|
| 160 |
+
tok = sd["prev"]
|
| 161 |
+
return np.concatenate(clouds) if clouds else np.zeros((0, 5), np.float32)
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
def attack_type(config):
|
| 165 |
+
return "inject" if config.startswith("inject") else "removal"
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
def score_frame(config, detected_overlapping_spoof_gt):
|
| 169 |
+
"""Whether the attack SUCCEEDED on this frame.
|
| 170 |
+
|
| 171 |
+
injection: success = a detection overlaps the phantom (false positive created).
|
| 172 |
+
removal : success = NO detection overlaps the erased object (true positive
|
| 173 |
+
destroyed).
|
| 174 |
+
ATLAS reports ASR at IoU 0.3.
|
| 175 |
+
"""
|
| 176 |
+
hit = bool(detected_overlapping_spoof_gt)
|
| 177 |
+
return hit if attack_type(config) == "inject" else (not hit)
|
| 178 |
+
|
| 179 |
+
|
| 180 |
+
def asr(successes, dataset_or_len):
|
| 181 |
+
"""Attack success rate over ATTACKED frames.
|
| 182 |
+
|
| 183 |
+
The denominator is the number of rows in this config -- every row is an
|
| 184 |
+
attacked frame. Do NOT use 6019 (the full val split): only attacked frames
|
| 185 |
+
are shipped, and only they are scored.
|
| 186 |
+
"""
|
| 187 |
+
n = dataset_or_len if isinstance(dataset_or_len, int) else len(dataset_or_len)
|
| 188 |
+
return (successes / n) if n else float("nan")
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
def removal_rate(example):
|
| 192 |
+
"""Realised fraction of in-wedge points deleted (removal configs only)."""
|
| 193 |
+
n_in = example.get("atk_n_points_in_sector") or 0
|
| 194 |
+
return (example["atk_n_points_removed"] / n_in) if n_in else float("nan")
|
| 195 |
+
|
| 196 |
+
|
| 197 |
+
if __name__ == "__main__":
|
| 198 |
+
ds = load_atlas("removal_az20", streaming=True)
|
| 199 |
+
r = next(iter(ds))
|
| 200 |
+
print(f"{r['segment']} frame {r['frame_index']}/{r['num_frames_in_segment']} "
|
| 201 |
+
f"token={r['sample_token'][:12]}...")
|
| 202 |
+
print(f" points {points_of(r).shape} spoof_gt {spoof_gt_of(r).shape} "
|
| 203 |
+
f"gt {gt_boxes_of(r).shape}")
|
| 204 |
+
print(f" realised removal rate {removal_rate(r):.3f}")
|