Skip to content
intermediateimage

RefCOCO - Referring Expression Grounding

Visual grounding task where annotators draw bounding boxes around objects referred to by natural language expressions. Based on the RefCOCO dataset (Yu et al., ECCV 2016), this task links referring expressions to spatial regions in images.

About this dataset

Referring expression comprehension, a form of visual grounding, is the task of taking an image plus a natural-language phrase that names one specific object and locating that object in the image. The RefCOCO and RefCOCO+ datasets were introduced by Licheng Yu, Patrick Poirson, Shan Yang, Alexander C. Berg, and Tamara L. Berg in "Modeling Context in Referring Expressions" at ECCV 2016. The paper studies how visual context, meaning comparison to the other objects in an image, helps both generate and understand these expressions.

The images come from MS COCO. The referring expressions were collected with the ReferItGame two-player interface (Kazemzadeh et al., EMNLP 2014): one player writes an expression for a marked object, and a second player has to click the region it describes, which keeps the expressions unambiguous. RefCOCO+ uses the same setup but forbids absolute spatial words like "left" or "right," so its expressions rely on appearance and attributes and are harder to ground.

RefCOCO contains 142,209 referring expressions for 50,000 objects across 19,994 images. RefCOCO+ contains 141,564 expressions for 49,856 objects across 19,992 images. Because the collection ran as a game where a second player had to identify the target, expressions that did not point clearly to the intended object were filtered out during play.

The Potato config below reproduces the grounding side of this task with an image_annotation scheme using the bbox tool, where the annotator draws a tight bounding box around the object named by the expression, plus an optional text field for rewriting the expression more precisely when it is ambiguous. Each item displays the image with its referring expression and is shown to two annotators. This is useful for building or auditing visual-grounding datasets.

RefCOCO expressions
142,209
RefCOCO objects / images
50,000 objects in 19,994 images
RefCOCO+ expressions
141,564
RefCOCO+ objects / images
49,856 objects in 19,992 images
Image source
MS COCO
Venue / Year
ECCV 2016
Labels:outdoornatureurbanpeopleanimal+

Configuration Fileconfig.yaml

This Potato config reproduces the annotation task. Save it as config.yaml and run potato start config.yaml to try it.

yaml
# RefCOCO - Referring Expression Grounding
# Based on Yu et al., ECCV 2016
# Paper: https://arxiv.org/abs/1608.00272
# Dataset: https://github.com/lichengunc/refer
#
# Visual grounding task: given an image and a referring expression, annotators
# draw a bounding box around the object described by the expression. This tests
# the ability to link natural language to spatial image regions.
#
# Annotation Guidelines:
# 1. Read the referring expression carefully
# 2. Examine the image and identify the object being described
# 3. Draw a tight bounding box around the referred object
# 4. If the expression is ambiguous, optionally write a clarification
# 5. The bounding box should be as tight as possible around the object

annotation_task_name: "RefCOCO - Referring Expression Grounding"
task_dir: "."

data_files:
  - sample-data.json

item_properties:
  id_key: "id"
  text_key: "text"

output_annotation_dir: "annotation_output/"
output_annotation_format: "json"

port: 8000
server_name: localhost

annotation_schemes:
  # Step 1: Draw bounding box around the referred object
  - annotation_type: image_annotation
    name: referred_object
    description: "Draw a bounding box around the object described by the referring expression."
    tools:
      - bbox
    labels:
      - "Referred Object"

  # Step 2: Optionally provide a clarifying expression
  - annotation_type: text
    name: clarification
    description: "If the original expression is ambiguous, write a more precise referring expression."
    textarea: false
    required: false
    placeholder: "Optional: write a clearer referring expression..."

annotation_instructions: |
  You will see an image and a referring expression that describes one specific object in the image.

  For each item:
  1. Read the referring expression below the image.
  2. Identify which object in the image is being described.
  3. Use the bounding box tool to draw a tight box around that object.
  4. If the expression is ambiguous or could refer to multiple objects,
     draw the box around the most likely referent and optionally write
     a clearer expression in the text field.

  Tips:
  - Draw the box as tightly as possible around the entire object.
  - Referring expressions often use spatial relationships (e.g., "the dog on the left").
  - Consider attributes like color, size, and position to disambiguate.

html_layout: |
  <div style="padding: 15px; max-width: 800px; margin: auto;">
    <div style="text-align: center; margin-bottom: 16px; background: #1a1a1a; padding: 12px; border-radius: 8px;">
      <img src="{{image_url}}" style="max-width: 100%; max-height: 500px; border-radius: 4px;" alt="Image for grounding" />
    </div>
    <div style="background: #fef3c7; border: 1px solid #fbbf24; border-radius: 8px; padding: 16px; margin-bottom: 16px;">
      <strong style="color: #92400e;">Referring Expression:</strong>
      <p style="font-size: 18px; line-height: 1.7; margin: 8px 0 0 0; font-style: italic;">{{text}}</p>
    </div>
  </div>

allow_all_users: true
instances_per_annotator: 50
annotation_per_instance: 2
allow_skip: true
skip_reason_required: false

Sample Datasample-data.json

json
[
  {
    "id": "refcoco_001",
    "text": "the woman in the red dress standing near the fountain",
    "image_url": "https://example.com/refcoco/park_scene_001.jpg"
  },
  {
    "id": "refcoco_002",
    "text": "the small brown dog on the left side of the bench",
    "image_url": "https://example.com/refcoco/bench_dogs_002.jpg"
  }
]

// ... and 8 more items

Get This Design

View on GitHub

Clone or download from the repository

Quick start:

git clone https://github.com/davidjurgens/potato-showcase.git
cd potato-showcase/image/visual-grounding/refcoco-expression
potato start config.yaml

Dataset & paper

Yu et al., ECCV 2016

Citation (BibTeX)

bibtex
@inproceedings{yu2016modeling,
    title = {Modeling Context in Referring Expressions},
    author = {Yu, Licheng and Poirson, Patrick and Yang, Shan and Berg, Alexander C. and Berg, Tamara L.},
    booktitle = {European Conference on Computer Vision (ECCV)},
    year = {2016}
}

Details

Annotation Types

image_annotationtext

Domain

Computer VisionNLP

Use Cases

Visual GroundingReferring Expression ComprehensionObject Localization

Tags

refcocovisual-groundingreferring-expressionbounding-boxeccv2016multimodal

Found an issue or want to improve this design?

Open an Issue