File size: 10,021 Bytes
8b53b83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: cc-by-4.0
configs:
- config_name: default
  data_files:
  - split: test
    path: data/test-*
  - split: invisible
    path: data/invisible-*
- config_name: raxo
  data_files:
  - split: test
    path: raxo/test-*
  - split: prototypes
    path: raxo/prototypes-*
dataset_info:
- config_name: default
  features:
  - name: rgb_image
    dtype: image
  - name: rgb_width
    dtype: int64
  - name: rgb_height
    dtype: int64
  - name: xray_images
    list: image
  - name: xray_width
    dtype: int64
  - name: xray_height
    dtype: int64
  - name: objects
    struct:
    - name: rgb_bbox
      list:
        list: float64
    - name: xray_bbox
      list:
        list: float64
    - name: categories
      list: string
    - name: rgb_visible
      list: bool
    - name: xray_visible
      list: bool
    - name: dangerous
      list: bool
    - name: IN_ids
      list: string
    - name: WN_ids
      list: string
  splits:
  - name: test
    num_bytes: 4870749491.831
    num_examples: 1573
  - name: invisible
    num_bytes: 1117400199
    num_examples: 355
  download_size: 5963943954
  dataset_size: 5988149690.831
- config_name: raxo
  features:
  - name: rgb_image
    dtype: image
  - name: rgb_width
    dtype: int64
  - name: rgb_height
    dtype: int64
  - name: xray_images
    list: image
  - name: xray_width
    dtype: int64
  - name: xray_height
    dtype: int64
  - name: objects
    struct:
    - name: rgb_bbox
      list:
        list: float64
    - name: xray_bbox
      list:
        list: float64
    - name: categories
      list: string
    - name: rgb_visible
      list: bool
    - name: xray_visible
      list: bool
    - name: dangerous
      list: bool
    - name: IN_ids
      list: string
    - name: WN_ids
      list: string
  splits:
  - name: test
    num_bytes: 966681256
    num_examples: 307
  - name: prototypes
    num_bytes: 3786846541.402
    num_examples: 1227
  download_size: 4754476276
  dataset_size: 4753527797.402
task_categories:
- object-detection
language:
- en
tags:
- x-ray
- open-vocabulary
- training-free
- benchmark
- xray
- detection
- imagenet
- wordnet
size_categories:
- 1K<n<10K
---



<div align="center">

<h1> <a style="color:white; font-weight:bold;" href="https://pagf188.github.io/RAXO/">Superpowering Open-Vocabulary Object Detectors for X-ray Vision</a></h1>
<h2>ICCV 2025</h2>

[Pablo Garcia-Fernandez](https://scholar.google.es/citations?user=xbtLSCcAAAAJ),
[Lorenzo Vaquero](https://scholar.google.es/citations?user=G0ZcGDYAAAAJ),
[Mingxuan Liu](https://scholar.google.com/citations?user=egL5-LsAAAAJ),
[Feng Xue](https://scholar.google.com/citations?user=66SeiQsAAAAJ),
[Daniel Cores](https://scholar.google.com/citations?user=pJqkUWgAAAAJ),
[Nicu Sebe](https://scholar.google.com/citations?user=stFCYOAAAAAJ),
[Manuel Mucientes](https://scholar.google.com/citations?user=raiz6p4AAAAJ),
[Elisa Ricci](https://scholar.google.com/citations?user=xf1T870AAAAJ)


[![arXiv](https://img.shields.io/badge/cs.CV-2410.07752-b31b1b?logo=arxiv&logoColor=red)](https://arxiv.org/abs/2503.17071)
[![GitHub](https://img.shields.io/badge/GitHub-RAXO-blue?logo=github)](https://github.com/PAGF188/RAXO)
[![Static Badge](https://img.shields.io/badge/website-RAXO-8A2BE2)](https://pagf188.github.io/RAXO/)
</div>


### DET-COMPASS

This is the official repository of [Superpowering Open-Vocabulary Object Detectors for X-ray Vision](https://pagf188.github.io/RAXO/) (ICCV'25)

<div align="center">
  <img src="./figs/compass_qualitative.png" alt="Qualitative DET-COMPASS" width="60%">
</div>


### Dataset Summary

Object detection in security X-ray scans has advanced significantly in recent years. However, evaluating Open-vocabulary Object Detectors (OvOD) detectors in this modality remains challenging due to the limited number of annotated object categories in existing X-ray benchmarks. This limitation severely constrains the comprehensive evaluation of OvOD methods, which require a broad and diverse category set to assess generalization to unseen object semantics. To address this gap, we introduce DET-COMPASS, a novel benchmark that repurposes the COMPASS-XP classification dataset for object detection through meticulous bounding box annotation. DET-COMPASS comprises 370 distinct object classes, offering an order-of-magnitude increase in vocabulary size over previous X-ray detection benchmarks. Additionally, it provides pixel-aligned RGB images, ensuring precise spatial correspondence across modalities and facilitating the development of multimodal models. Each object is also labeled with a visibility attribute, indicating whether it produces a discernible signature in the X-ray spectrum. 

### Dataset Structure

DET-COMPASS is provided in two configurations:

- **default**: The entire dataset is used in a zero-shot setting, where only text labels are available for each object. This configuration is suitable for evaluating open-vocabulary object detectors without access to any visual prototypes.
- **raxo**: This configuration replicates the setting in the RAXO paper, where a subset of x-ray prototypes for the objects is available. It is intended for experiments that leverage a small number of visual examples per class.

Each sample in the dataset has the following structure:

```json
{
  "rgb_image": PIL.Image,                        // loaded RGB image
  "rgb_width": int,
  "rgb_height": int,
  "xray_images": [                               // list of 5 loaded images, order: Colour, Grey, High, Low, Density
    PIL.Image, PIL.Image, PIL.Image, PIL.Image, PIL.Image
  ],
  "xray_width": int,
  "xray_height": int,
  "objects": {
    "rgb_bbox": [ [float, float, float, float], ... ],   // list of [x_min, y_min, width, height]
    "xray_bbox": [ [float, float, float, float], ... ],  // list of [x_min, y_min, width, height]
    "categories": [ string, ... ],                       // list of text labels
    "rgb_visible": [ bool, ... ],                        // list of booleans
    "xray_visible": [ bool, ... ],                       // list of booleans
    "dangerous": [ bool, ... ],                          // list of booleans
    "IN_ids": [ string, ... ],                           // list of ImageNet IDs (may be empty)
    "WN_ids": [ string, ... ]                            // list of WordNet synset IDs (may be empty)
  }
}
```

- The `xray_images` list always follows this order: **Colour, Grey, High, Low, Density**.
- All bounding boxes are in `[x_min, y_min, width, height]` format.
- The `categories` field contains the text label for each object.
- The `IN_ids` and `WN_ids` fields provide ImageNet and WordNet synset IDs when available.
- **All lists within the `objects` field are aligned by index:** for any index `i`, the elements `rgb_bbox[i]`, `xray_bbox[i]`, `categories[i]`, `rgb_visible[i]`, `xray_visible[i]`, `dangerous[i]`, `IN_ids[i]`, and `WN_ids[i]` all correspond to the same object instance in the image.

**The repository also includes a `classes.csv` file listing all classes present in the dataset. This file has the following columns:**

- `class`: Class name (string)
- `IN_id`: ImageNet class ID (string, may be empty)
- `WN_id`: WordNet synset ID (string, may be empty)
- `dangerous`: Whether the class is considered dangerous (boolean)

This structure supports both zero-shot and prototype-based open-vocabulary object detection experiments.

### Usage

```python
from datasets import load_dataset
import matplotlib.pyplot as plt
import matplotlib.patches as patches

# 1. Load the dataset
ds = load_dataset("PAGF/DET-COMPASS", name="default", split="test")

# 2. Select a sample
sample = ds[739]

# 3. Get the images
rgb_img = sample["rgb_image"]
xray_colour_img = sample["xray_images"][0]
xray_grey_img = sample["xray_images"][1]
xray_high_img = sample["xray_images"][2]
xray_low_img = sample["xray_images"][3]
xray_density_img = sample["xray_images"][4]

# 4. Get the bounding boxes ([x_min, y_min, width, height])
rgb_bboxes = sample["objects"]["rgb_bbox"]
xray_bboxes = sample["objects"]["xray_bbox"]

# 5. Get the classes
classes = sample["objects"]["categories"]

# 6. Draw bounding boxes
def plot_image(ax, img, bboxes, classes, name=""):
    ax.imshow(img)
    for bbox, cls in zip(bboxes, classes):
        rect = patches.Rectangle(
            (bbox[0], bbox[1]),
            bbox[2], bbox[3],
            linewidth=2, edgecolor='r', facecolor='none'
        )
        ax.add_patch(rect)
        # Draw class name at the top-left corner of the bbox
        ax.text(
            bbox[0], bbox[1] - 5,  # Slightly above the bbox
            cls,
            color='yellow', fontsize=10, weight='bold',
            bbox=dict(facecolor='black', alpha=0.5, edgecolor='none', pad=1)
        )
    ax.set_title(name)
    ax.axis("off")

fig, axs = plt.subplots(3, 2, figsize=(12, 6))

plot_image(ax=axs[0,0], img=rgb_img, bboxes=rgb_bboxes, classes=classes, name="RGB")
plot_image(ax=axs[0,1], img=xray_colour_img, bboxes=xray_bboxes, classes=classes, name="X-ray Colour")
plot_image(ax=axs[1,0], img=xray_grey_img, bboxes=xray_bboxes, classes=classes, name="X-ray Grey")
plot_image(ax=axs[1,1], img=xray_high_img, bboxes=xray_bboxes, classes=classes, name="X-ray High")
plot_image(ax=axs[2,0], img=xray_low_img, bboxes=xray_bboxes, classes=classes, name="X-ray Low")
plot_image(ax=axs[2,1], img=xray_density_img, bboxes=xray_bboxes, classes=classes, name="X-ray Density")

plt.tight_layout()
plt.show()
```

<div align="center">
  <img src="./figs/side_by_side_bbox.png" alt="DET-COMPASS Sample" width="80%">
</div>

### Citation

If you use DET-COMPASS in your research, please cite:

```bibtex
@inproceedings{garcia2025superpowering,
      title={Superpowering Open-Vocabulary Object Detectors for X-ray Vision}, 
      author={Pablo Garcia{-}Fernandez and Lorenzo Vaquero and Mingxuan Liu and Feng Xue and Daniel Cores and Nicu Sebe and Manuel Mucientes and Elisa Ricci},
      booktitle={Int. Conf. Comput. Vis. ({ICCV})},
      year={2025},
}
```