Export Image-Level Tags with Filenames in CSV Format

Hello Roboflow Community,

I’m working on a project where I’m using both annotation classes and image-level tags for my images, and I need to export both types of information into a single CSV file.

My Project Setup:

  • Annotation Classes: I have defined specific “Brand Names” (e.g., kind, dole, kelloggs, etc.) as classes for my object detection annotations. When I download my dataset (e.g., as CSV Multi Label Classification), I can successfully get the filename and the class (brand name) for each detected object in Hot encoded Format.
  • Image-Level Tags: Separately, I’ve used Roboflow’s image tagging feature to apply “Flavor” tags (e.g., chocolate, vanilla, strawberry, original) to images. These are applied at the image level in the dataset view (e.g., visible when Browse individual images or filtering).

The Issue: When I export my dataset to a CSV format (or any other format that generates a CSV-like structure), I only see the Brand Names (classes) associated with the annotations. The Flavor Tags that I’ve applied at the image level do not appear in the exported CSV.

My Desired Output Format: I would like a single CSV file that includes:

  • The filename
  • The Brand Name (Classes) (derived from the annotation classes)
  • The Flavor (Tags) associated with that image

Ideally, something like:

FileName | Brand Name(s) | Flavor Tag(s)
image1.jpg | kind | chocolate, original
image2.jpg | kelloggs | vanilla

(Where Brand Name(s) could be comma-separated if multiple objects of different brands are detected, and Flavor Tag(s) could be comma-separated if an image has multiple flavor tags).

My Question: Is there a straightforward way within Roboflow to export both the annotation classes (brands) and the tags (flavors) into a single CSV? Or, what is the recommended workflow to combine these two pieces of information after export? For example, is there a separate “metadata export” for image tags that I can then merge with an annotation export?

Any guidance on how to achieve this specific data combination would be greatly appreciated.

Thank you!

Hi @Vivek_Singh!
This is a fantastic question! At this moment, the best way to accomplish this task is to create a custom python script to combine the filename, classes, and tags into a single CSV. This is a great suggestion that I will relay to our team.

Here is a prompt you can implement to create a starter script:

I need a Python script that combines two CSV files into one. The first CSV contains
image filenames and annotation classes (brand names), while the second contains 
filenames and image-level tags (flavor tags). The script should merge both files on
 the `filename` column and output a new CSV with columns for `filename`, `classes`, 
and `tags`. The output CSV should include all filenames from the annotation file, 
even if there are no corresponding tags, and save it as `combined_output.csv`.

Thanks again for bringing this to our attention!

1 Like

Hello @Ford

Thank you for the quick reply and the Python script prompt! I appreciate you relaying the suggestion to your team regarding a more direct export.

However, I think there might still be a slight misunderstanding of my core issue. The Python script you provided relies on having two separate CSV files to begin with:

  1. A CSV with filename and annotation classes (which I can get from the Object Detection CSV export under “Versions”).
  2. A CSV with filename and image-level tags (flavors).

My actual issue is that I cannot find a way to export the dataset CSV file (the one with filename and tags) from Roboflow at all.

I have diligently applied tags to my images using the image tagging feature in Roboflow. However, when I look at the “Data” tab or any “Export” options within Roboflow, I haven’t found a dedicated way to download a CSV that specifically lists all my images and their associated image-level tags.

Could you please clarify how I can export a CSV containing just the filename and the image-level tags (my “flavors”) from my Roboflow project? Once I have that CSV, I can certainly use the Python script to combine it with my annotation classes.

Thanks again for your help!

Hi @Vivek_Singh!
Thank you for the clarification, this is a fantastic feature request and I’ll be sure to share it with our team.

To help us understand the request, could you share why this feature is important to you, what exactly you’re trying to accomplish, and how it would improve your experience with Roboflow?

Thank you again for your feedback and contributing to the Roboflow community!

1 Like

Hello @Ford,

Thank you for confirming this is a valuable feature request and for forwarding it to the team. I’m happy to provide more context on why this functionality is important to my workflow.

Why this feature is important to me (the ‘why’):

Currently, I’m using Roboflow for a project involving food item recognition. Besides identifying the brand of the item (which I’m doing via annotation classes), I also need to categorize each image by its specific flavor profiles (e.g., ‘chocolate’, ‘vanilla’, ‘spicy’, ‘original’, etc.). The image-level tagging feature in Roboflow is perfectly suited for this, as a single image can have multiple flavor tags, and these tags describe the image as a whole, not just a specific object bounding box.

The challenge arises when I need to analyze my dataset. I require a comprehensive CSV output that includes:

  1. The filename
  2. The brand name(s) (from object detection classes)
  3. The flavor tag(s) (from image-level tags)

Without a direct way to export image-level tags, I’m left with a critical gap in my dataset analysis.

What exactly I’m trying to accomplish (the ‘what’):

I’m trying to create a unified dataset manifest. This single CSV file would serve as my master record for all images, allowing me to quickly see:

  • Which brands are present in an image.
  • Which flavors are associated with that image.
  • This combined information is essential for downstream tasks like:
    • Data exploration and quality control: Easily auditing my dataset to ensure all relevant information (brand and flavor) is captured for each image.
    • External analysis: Performing analytics on the combined brand and flavor distribution across my entire dataset using tools outside of Roboflow.
    • Reporting: Generating comprehensive reports that include both object-level classifications and image-level attributes.

How it would improve my experience with Roboflow (the ‘how it helps’):

  • Streamlined Workflow: Currently, I have to manually manage this data or develop custom scripts to combine multiple exports. Having a direct export for image-level tags would eliminate this time-consuming, error-prone manual step.
  • Data Integrity: A direct export ensures that the tags I apply in Roboflow are readily accessible for my analysis without needing complex data merging, reducing the risk of discrepancies.
  • Full Utilization of Roboflow Features: It allows me to fully leverage the robust tagging feature for dataset organization and metadata, knowing that this information is easily extractable for my specific analytical needs. It makes the tagging feature much more powerful for data management.

Screenshot:

Final Solution as I was searching for:

While I await potential future developments from Roboflow, I wanted to let you know that I have developed a custom Streamlit application to address this exact problem for my current needs.

This app allows me to generate the combined CSV output I require by leveraging Roboflow’s existing export formats.

App Link: https://brand-flavor-dataextractor-roboflow.streamlit.app

Here’s a brief explanation of how my app works:

  1. Input: My Streamlit app takes the COCO JSON export directly from my Roboflow Object Detection project as input. This JSON file contains all the necessary annotation data (filenames, bounding boxes, and class names for my brands).

  2. Processing:

  • The app parses this COCO JSON to extract the filename and associated class name(s) (my brand names) for each image.
  • Crucially, for the image-level tags (flavors), the app expects these to be present within the image objects in the COCO JSON metadata. While not explicitly part of the standard COCO annotation, Roboflow often embeds additional image metadata (like source file names, tags, etc.) in the images section of the COCO JSON. My app specifically looks for these tag-related fields.
  • It then combines this extracted information, mapping each image to its detected brand classes and its assigned flavor tags.
  1. Output: The app generates a clean CSV file in my desired format: FileName | Brand Name(s) | Flavor Tag(s).

This custom solution helps me bridge the current gap, allowing me to fully utilize both my object detection annotations and my image-level tags for my analysis and reporting.

I hope this provides further insight into the importance and utility of this feature.

Thank you for your continued support!

Hi @Vivek_Singh!
This is absolutely fantastic feedback, thank you very much for the detail.

This is a great feature request, thank you again for contributing to Roboflow!!

1 Like