File size: 5,335 Bytes
26abcfd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f96ae9c
 
 
 
 
 
 
 
 
 
26abcfd
f96ae9c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
dataset_info:
  features:
  - name: image
    dtype: image
  - name: text
    dtype: string
  - name: mask
    sequence:
      sequence: bool
  - name: image_id
    dtype: string
  - name: ann_id
    dtype: string
  - name: img_height
    dtype: int64
  - name: img_width
    dtype: int64
  splits:
  - name: test
    num_bytes: 369809589.0
    num_examples: 200
  download_size: 283290154
  dataset_size: 369809589.0
configs:
- config_name: default
  data_files:
  - split: test
    path: data/test-*
task_categories:
- image-segmentation
license: cc-by-nc-4.0
tags:
- reasoning
- reinforcement-learning
- zero-shot
- multimodal
language:
- en
---

# ReasonSeg-Test Dataset

This repository contains the test split of the ReasonSeg benchmark dataset, an evaluation benchmark used in the paper "[Seg-Zero: Reasoning-Chain Guided Segmentation via Cognitive Reinforcement](https://huggingface.co/papers/2503.06520)".

## Paper Abstract

Traditional methods for reasoning segmentation rely on supervised fine-tuning with categorical labels and simple descriptions, limiting its out-of-domain generalization and lacking explicit reasoning processes. To address these limitations, we propose Seg-Zero, a novel framework that demonstrates remarkable generalizability and derives explicit chain-of-thought reasoning through cognitive reinforcement. Seg-Zero introduces a decoupled architecture consisting of a reasoning model and a segmentation model. The reasoning model interprets user intentions, generates explicit reasoning chains, and produces positional prompts, which are subsequently used by the segmentation model to generate precious pixel-level masks. We design a sophisticated reward mechanism that integrates both format and accuracy rewards to effectively guide optimization directions. Trained exclusively via reinforcement learning with GRPO and without explicit reasoning data, Seg-Zero achieves robust zero-shot generalization and exhibits emergent test-time reasoning capabilities. Experiments show that Seg-Zero-7B achieves a zero-shot performance of 57.5 on the ReasonSeg benchmark, surpassing the prior LISA-7B by 18%. This significant improvement highlights Seg-Zero's ability to generalize across domains while presenting an explicit reasoning process.

## Code

The official code for Seg-Zero is available on GitHub: [https://github.com/dvlab-research/Seg-Zero](https://github.com/dvlab-research/Seg-Zero)

## Overview of Seg-Zero

Seg-Zero employs a decoupled architecture, including a reasoning model and a segmentation model. It is trained exclusively using reinforcement learning with GRPO and without explicit reasoning data.

<div align=center>
<img width="98%" src="https://github.com/dvlab-research/Seg-Zero/raw/main/assets/overview.png"/>
</div>

Seg-Zero demonstrates the following features:
1.  Seg-Zero exhibits emergent test-time reasoning ability. It generates a reasoning chain before producing the final segmentation mask.
2.  Seg-Zero is trained exclusively using reinforcement learning, without any explicit supervised reasoning data.
3.  Compared to supervised fine-tuning, our Seg-Zero achieves superior performance on both in-domain and out-of-domain data.

## Examples

<div align=center>
<img width="98%" src="https://github.com/dvlab-research/Seg-Zero/raw/main/assets/examples.png"/>
</div>

## Sample Usage (Inference)

To run inference using a pretrained Seg-Zero model, you first need to download the models. Make sure you have `git-lfs` installed.

```bash
mkdir pretrained_models
cd pretrained_models
git lfs install
git clone https://huggingface.co/Ricky06662/VisionReasoner-7B
```

Then run inference using:
```bash
python inference_scripts/infer_multi_object.py
```
The default question is:
> "What can I have if I'm thirsty?"

You will get the thinking process in the command line, like:
> "The question asks for items that can be consumed if one is thirsty. In the image, there are two glasses that appear to contain beverages, which are the most likely candidates for something to drink. The other items, such as the salad, fruit platter, and sandwich, are not drinks and are not suitable for quenching thirst."

And the mask will be presented in the **inference_scripts** folder.

<div align=center>
<img width="98%" src="https://github.com/dvlab-research/Seg-Zero/raw/main/assets/test_output_multiobject.png"/>
</div>

You can also provide your own `image_path` and `text` by:
```bash
python inference_scripts/infer_multi_object.py --image_path "your_image_path" --text "your question text"
```

## Citation

If you find Seg-Zero or VisionReasoner useful for your research, please cite the following papers:

```bibtex
@article{liu2025segzero,
  title        = {Seg-Zero: Reasoning-Chain Guided  Segmentation via Cognitive Reinforcement},
  author       = {Liu, Yuqi and Peng, Bohao and Zhong, Zhisheng and Yue, Zihao and Lu, Fanbin and Yu, Bei and Jia, Jiaya},
  journal      = {arXiv preprint arXiv:2503.06520},
  year         = {2025}
}

@article{liu2025visionreasoner,
  title        = {VisionReasoner: Unified Visual Perception and Reasoning via Reinforcement Learning},
  author       = {Liu, Yuqi and Qu, Tianyuan and Zhong, Zhisheng and Peng, Bohao and Liu, Shu and Yu, Bei and Jia, Jiaya},
  journal = {arXiv preprint arXiv:2505.12081},
  year         = {2025}
}
```