← Latest papers
💻 computer science

Vision2Code: A Multi-Domain Benchmark for Evaluating Image-to-Code Generation

The paper introduces Vision2Code, a reference-code-free, multi-domain benchmark and evaluation framework that assesses image-to-code generation by rendering model outputs and scoring them with domain-specific rubrics, revealing significant performance gaps in spatial and complex visual domains while demonstrating that filtered outputs can effectively improve model training.

Original authors: Ajay Vikram Periasami, Junlin Wang, Bhuwan Dhingra

Published 2026-05-13
📖 5 min read🧠 Deep dive

Original authors: Ajay Vikram Periasami, Junlin Wang, Bhuwan Dhingra

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a complex drawing, like a blueprint for a house, a chemistry diagram, or a financial chart. Now, imagine asking a computer to look at that picture and write the exact set of instructions (code) needed to draw it again from scratch.

This is what the paper Vision2Code is about. It's a new "test" (benchmark) designed to see how good AI models are at turning images back into editable code.

Here is a breakdown of the paper's key ideas using simple analogies:

1. The Problem: The "Pixel vs. Blueprint" Gap

Think of an image as a photograph of a cake. If you just look at the photo, you can see the cake, but you can't easily change the flavor of the frosting or move a cherry without editing the pixels (which looks messy).

However, if you have the recipe (the code), you can easily change the frosting to chocolate or move the cherry.

  • Old Tests: Previous tests for AI were like asking, "Can you draw a cake that looks like this photo?" They focused on narrow topics (like only charts) or required the AI to have the original recipe on hand to compare against.
  • The New Test (Vision2Code): This test asks, "Can you look at this photo of a cake and write a new recipe that, when followed, creates a cake that looks and acts exactly like the original?" Crucially, the test doesn't give the AI the original recipe; it only gives the photo.

2. The Challenge: It's Not Just One Type of Drawing

The authors realized that drawing a bar chart is very different from drawing a 3D room or a circuit board.

  • The Analogy: Imagine a test where you have to draw a map.
    • Charts/Graphs: Like drawing a subway map. The lines need to connect, and the station names must be right.
    • Chemistry: Like drawing a molecule. If you swap one atom for another, the whole thing is wrong.
    • Documents: Like copying a dense newspaper page. Every word and column matters.
    • 3D Scenes: Like drawing a room with depth. If the table looks like it's floating or flat, the drawing fails.

Vision2Code covers 15 different types of images across these six categories. It's like a "multi-sport" Olympics for AI drawing, rather than just a sprint for one specific type of image.

3. The Scoring System: The "Strict Art Critic"

How do you grade an AI's drawing?

  • Old Way: Some tests just compared the new image to the old one pixel-by-pixel (like checking if two photos are identical). This is bad because a tiny shift in a line might look perfect to a human but fail a pixel check.
  • The Vision2Code Way: They use a VLM Rater (an AI judge) that acts like a strict art critic.
    • The AI generates code.
    • The code runs and creates a new image.
    • The "Critic" compares the new image to the original.
    • The Twist: The Critic uses different rulebooks for different tasks.
      • For a chemistry diagram, the rulebook says: "If the atoms are wrong, you get a zero, even if the colors look nice."
      • For a chart, the rulebook says: "If the numbers on the axis are wrong, you fail."
    • They also have "guardrails." If the AI makes a huge, obvious mistake (like drawing a molecule upside down), the score is automatically capped low, so the AI can't trick the system with a pretty but wrong drawing.

4. The Results: The AI is Good at Some Things, Bad at Others

The paper tested 9 different AI models (some free, some expensive).

  • The Good News: The best models are getting really good at drawing charts and graphs. They can look at a bar graph and write the code to recreate it almost perfectly.
  • The Bad News: The models struggle with complex, specific tasks.
    • 3D Scenes: They often flatten 3D objects into 2D, losing the sense of depth.
    • Chemistry & Circuits: They mix up symbols or connections.
    • Documents: They miss text or mess up the layout.
  • The Takeaway: Just because an AI is smart at drawing a simple graph doesn't mean it understands the deep structure of a circuit diagram. The skill is "domain-dependent."

5. The "Self-Training" Trick

The paper also tried a clever trick to make the AI better without needing more human teachers.

  • The Idea: The AI tries to draw an image. The "Critic" grades it.
  • The Filter: If the AI gets a good grade on the first try, but then fails to recreate its own drawing when asked to do it again, it means the AI got lucky or memorized a pattern rather than truly understanding the structure.
  • The Result: By training the AI only on the examples where it got a good score but then stumbled on the second try, they helped the model learn the "tricky" parts. This boosted the performance of a smaller model (Qwen3.5-9B) significantly, proving that this "critic" can teach the AI how to draw better.

Summary

Vision2Code is a new, fairer, and more comprehensive test for AI. It stops asking "Does this look like the photo?" and starts asking "Does this code actually rebuild the structure of the image?" It shows that while AI is getting great at simple charts, it still has a long way to go before it can perfectly recreate complex scientific diagrams, 3D scenes, or dense documents.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →