DET-COMPASS / README.md
PAGF's picture
Super-squash branch 'main' using huggingface_hub
8b53b83 verified
---
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},
}
```