File size: 11,616 Bytes
d1e4471
 
d6c6a09
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d1e4471
d6c6a09
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
---
license: cc-by-nc-sa-4.0
task_categories:
- object-detection
tags:
- atlas
- lidar
- 3d-object-detection
- adversarial-robustness
- point-cloud
- nuscenes
size_categories:
- 10K<n<100K
configs:
- config_name: inject_global_easy
  data_files:
  - split: train
    path: data/inject_global_easy/train-*
- config_name: inject_global_medium
  data_files:
  - split: train
    path: data/inject_global_medium/train-*
- config_name: inject_global_hard
  data_files:
  - split: train
    path: data/inject_global_hard/train-*
- config_name: inject_relative_easy
  data_files:
  - split: train
    path: data/inject_relative_easy/train-*
- config_name: inject_relative_medium
  data_files:
  - split: train
    path: data/inject_relative_medium/train-*
- config_name: inject_relative_hard
  data_files:
  - split: train
    path: data/inject_relative_hard/train-*
- config_name: removal_az10
  data_files:
  - split: train
    path: data/removal_az10/train-*
- config_name: removal_az20
  data_files:
  - split: train
    path: data/removal_az20/train-*
- config_name: removal_az30
  data_files:
  - split: train
    path: data/removal_az30/train-*
- config_name: removal_az40
  data_files:
  - split: train
    path: data/removal_az40/train-*
- config_name: removal_az50
  data_files:
  - split: train
    path: data/removal_az50/train-*
- config_name: removal_az60
  data_files:
  - split: train
    path: data/removal_az60/train-*
---

# ATLAS-nuScenes

Adversarial LiDAR point clouds derived from the nuScenes trainval **validation**
split (150 scenes, 6019 keyframes).

Anonymous release supporting a submission under review; author and affiliation
details are withheld for the review period.

Part of **ATLAS**: `ps3020/atlas-kitti` · `ps3020/atlas-nuscenes`

## Configs

Injection — a phantom vehicle that does not exist is added:

`inject_global_easy`, `inject_global_medium`, `inject_global_hard`,
`inject_relative_easy`, `inject_relative_medium`, `inject_relative_hard`

`global` fixes the phantom in world coordinates, `relative` fixes it relative to
the ego vehicle. `easy`/`medium`/`hard` are decreasing phantom point densities.

Removal — points in an azimuth wedge are deleted to hide a real vehicle:

`removal_az10`, `removal_az20`, `removal_az30`, `removal_az40`, `removal_az50`,
`removal_az60` (suffix = wedge width in degrees)

Every row is an attacked frame; there are no clean frames.

## Setup

**1. Install**

```bash
pip install datasets numpy
pip install nuscenes-devkit   # only for sequence reconstruction (optional)
```

**2. Load a config**

```python
from datasets import load_dataset
ds = load_dataset("ps3020/atlas-nuscenes", "removal_az20", split="train")
```

Add `streaming=True` to avoid downloading a whole config (each is 2.5–3.7 GB).

**That is all that is required to evaluate attacks.** Each row carries the
complete attacked point cloud and the attacked object's box, so attack success
rate needs nothing else.

**3. nuScenes source data — only for sequence reconstruction**

Needed *only* if you want the clean frames this dataset does not ship (see
*Attacked frames only* below). Download from
<https://www.nuscenes.org/nuscenes> (free account): `v1.0-trainval_meta.tgz`
plus the ten `v1.0-trainval{01..10}_blobs_lidar.tgz` (~126 GB). Extract to:

```
<NUSCENES_ROOT>/
  samples/LIDAR_TOP/     34149 keyframe clouds
  sweeps/LIDAR_TOP/      297737 intermediate clouds
  v1.0-trainval/         *.json metadata tables
```

> Some nuScenes archives carry trailing bytes that make `tar xzf` abort **silently
> part-way**, leaving `sweeps/` incomplete. If you hit missing-file errors, use
> `gzip -dc FILE.tgz | tar -x --ignore-zeros -C <NUSCENES_ROOT>` and confirm
> `ls sweeps/LIDAR_TOP | wc -l` reports 297737.

### Quick check

```python
from datasets import load_dataset
import numpy as np

ds = load_dataset("ps3020/atlas-nuscenes", "removal_az20",
                  split="train", streaming=True)
ex = next(iter(ds))
pts = np.asarray(ex["points"], np.float32).reshape(ex["num_points"], ex["point_dim"])
print(ex["segment"], ex["frame_index"], pts.shape)
# scene-0003 32 (259188, 6)
```

## Usage

```python
from datasets import load_dataset
import numpy as np

ds = load_dataset("ps3020/atlas-nuscenes", "removal_az20", split="train")
ex = ds[0]

# points are stored FLAT -- reshape to recover the cloud
pts = np.asarray(ex["points"], np.float32).reshape(ex["num_points"], ex["point_dim"])
# (N, 6) = x, y, z, intensity, time, lag   (10-sweep accumulated, N ~ 265k)

spoof_gt = np.asarray(ex["spoof_gt"], np.float32)   # (7,) injection | (10,) removal
gt_boxes = np.asarray(ex["gt_boxes"], np.float32).reshape(ex["num_gt"], ex["gt_box_dim"])
pose     = np.asarray(ex["pose"], np.float64).reshape(4, 4)   # ref(lidar) -> global
```

Or use the bundled helper:

```python
from load_atlas_nuscenes import load_atlas, points_of, attacked_index

ds  = load_atlas("removal_az20")
pts = points_of(ds[0])
idx = attacked_index(ds)        # {segment: {frame_index: row}}
```

## Attack success rate

`spoof_gt` is the attacked object. Score each frame by whether a prediction
overlaps it at IoU >= 0.3:

- **injection** — success = a detection *appears* (false positive created)
- **removal** — success = the detection *is missing* (true positive destroyed)

```python
n_success = 0
for ex in ds:
    pts  = np.asarray(ex["points"], np.float32).reshape(ex["num_points"], ex["point_dim"])
    pred = my_detector(pts)
    hit  = overlaps(pred, ex["spoof_gt"], iou_thresh=0.3)
    n_success += hit if "inject" in config else (not hit)

asr = n_success / len(ds)
```

**Use `len(ds)`, not 6019.** Only attacked frames are shipped and only they are
scored. Counts differ per family because removal additionally requires a trackable
vehicle:

| family | configs | attacked frames each |
|---|---|---|
| injection | 6 | 1219 |
| removal | 6 | 869 |

## Attacked frames only

A nuScenes scene is ~40 keyframes and the attack covers the last 8, so ~80% of
each split would be a **bit-identical copy of source nuScenes**. Those frames are
not shipped, for three reasons: they are nuScenes' data rather than ours and
redistributing them would bypass nuScenes' own registration and license terms;
they are identical across all 12 configs, so shipping them means 12 duplicate
copies; and they are never scored, since ASR is defined only on attacked frames.

Nothing is lost. The omitted frames are unmodified, so a full sequence is
recovered by substitution. Every row carries four keys back to the source:

| key | meaning |
|---|---|
| `segment` | scene name, e.g. `"scene-0003"` |
| `frame_index` | position within the scene (0-based) |
| `sample_token` | **nuScenes sample token — the canonical global key** |
| `frame_id` | source `LIDAR_TOP` filename |

Prefer `sample_token`: it is nuScenes' own primary key and does not depend on
reproducing our scene ordering.

### Reconstructing a full sequence

This dataset is standalone — it is not a patch layer over nuScenes, and nothing
substitutes frames automatically. If you want full sequences, mix the two sources
in your own loader. This example is complete and runnable:

```python
import os
import numpy as np
from nuscenes.nuscenes import NuScenes
from datasets import load_dataset

NUSCENES_ROOT = "/path/to/nuscenes"
nusc = NuScenes(version="v1.0-trainval", dataroot=NUSCENES_ROOT, verbose=False)
ds   = load_dataset("ps3020/atlas-nuscenes", "removal_az20", split="train")

attacked = {}                      # {segment: {frame_index: row}}
for r in ds:
    attacked.setdefault(r["segment"], {})[r["frame_index"]] = r

def clean_cloud(sample_token):
    """One clean nuScenes keyframe as (N, 5) = x, y, z, intensity, ring."""
    sd = nusc.get("sample_data", nusc.get("sample", sample_token)["data"]["LIDAR_TOP"])
    return np.fromfile(os.path.join(NUSCENES_ROOT, sd["filename"]),
                       dtype=np.float32).reshape(-1, 5)

scene_name = "scene-0003"
scene = next(s for s in nusc.scene if s["name"] == scene_name)

sequence, tok = [], scene["first_sample_token"]
for i in range(scene["nbr_samples"]):
    if i in attacked[scene_name]:
        row = attacked[scene_name][i]
        pts = np.asarray(row["points"], np.float32).reshape(
            row["num_points"], row["point_dim"])          # (N, 6), ATTACKED
        sequence.append((pts, True))
    else:
        sequence.append((clean_cloud(tok), False))        # clean, from your copy
    tok = nusc.get("sample", tok)["next"]

print(f"{scene_name}: {len(sequence)} frames, "
      f"{sum(a for _, a in sequence)} attacked")
# scene-0003: 40 frames, 7 attacked
```

For an existing pipeline, one dict lookup is usually enough:

```python
attacked_by_token = {r["sample_token"]: r for r in ds}

def get_points(sample_token):
    r = attacked_by_token.get(sample_token)
    if r is not None:
        return np.asarray(r["points"], np.float32).reshape(r["num_points"], r["point_dim"])
    return my_existing_loader(sample_token)
```

Three things to know when doing this:

- **Clean and attacked clouds are not the same width.** Ours are `(N, 6)` at ~265k
  points because they are 10-sweep accumulated. A single raw `.pcd.bin` is `(N, 5)`
  at ~35k points with `ring` as the 5th column. If your loader accumulates sweeps
  itself, do **not** re-accumulate ours — they are already assembled.
- **Reproducing our clean frames exactly needs the detector pipeline, not just
  sweep accumulation.** `load_atlas_nuscenes.clean_cloud()` accumulates 10 sweeps
  and is fine for inspection, but it omits the point-cloud range filter and returns
  ~1.3× too many points (~347k vs ~265k). For a numerically matched clean baseline,
  load through the same config used for evaluation (e.g. OpenPCDet
  `NuScenesDataset` with the standard 10-sweep nuScenes config).
- **`frame_id` is the `.pcd` stem** while nuScenes stores `<stem>.pcd.bin`, so a
  filename equality check fails. Use `sample_token`.

For **attack evaluation none of this applies**: ASR uses only the shipped frames.

## Fields

| field | description |
|---|---|
| `segment`, `frame_index`, `num_frames_in_segment` | position within the scene |
| `sample_token`, `frame_id` | nuScenes identity |
| `points`, `num_points`, `point_dim` | attacked cloud, flattened; reshape to `(N, 6)` |
| `spoof_gt`, `spoof_gt_dim` | attacked object — `(7,)` injection, `(10,)` removal |
| `gt_boxes`, `num_gt`, `gt_box_dim` | clean nuScenes GT `(M, 10)`, last column = 1-indexed class (car = 1) |
| `pose` | 4×4 ref(lidar) → global, flattened |
| `atk_*` | attack parameters — 7 fields for injection, 21 for removal |

For removal, the realised removal rate is
`atk_n_points_removed / atk_n_points_in_sector`.

## Notes

- Point clouds are **10-sweep accumulated** (~265k points/frame), the standard
  nuScenes detection setting. Feature 4 is a timestamp, not elongation.
- `spoof_gt` has 10 columns for removal (a real GT box: geometry + velocity +
  class) but 7 for injection (a phantom: geometry only).
- Attacks target the **car** class.
- Removal follows the A-HFR model, with per-width removal probabilities calibrated
  against physical measurements from Cao et al., USENIX Security 2023. Its
  range-dependent firing gate means not every scheduled frame fires.
- Phantom intensity is sampled from the diffuse range-conditioned distribution
  rather than saturated; see the paper for the ablation.

## License

`cc-by-nc-sa-4.0`, inherited from nuScenes. These are derived point clouds, so the
non-commercial and share-alike terms of the original apply. Please cite nuScenes
alongside this dataset.