Source-linked AI summary

IW-Bench: Evaluating Large Multimodal Models for Converting Image-to-Web

Hongcheng Guo, Wei Zhang, Junhao Chen, Yaonan Gu, Jian Yang, Junjia Du, Shaosheng Cao, Binyuan Hui, Tianyu Liu, Jianxin Ma, Chang Zhou, Zhoujun Li

arXiv:2409.18980v2cs.CLcs.AIcs.CV

TL;DR

Image-to-Web lacks a robust benchmark for evaluating large multimodal models, particularly for element completeness and layout. IW-BENCH provides a 1,200-pair, three-level benchmark with Element Accuracy and Layout Accuracy, alongside a five-hop prompting method. Its evaluations characterize model capabilities and limitations, and ablations demonstrate the effect of the prompting method.

  • Problem

    Image-to-Web lacks a robust benchmark for assessing large multimodal models, while conventional similarity metrics do not precisely capture element completeness and layout amid varied web code and invisible elements.

    Source: §1 · p. 1
  • Method

    IW-BENCH comprises 1,200 image–web-code pairs at three difficulty levels, uses Element Accuracy and Layout Accuracy, and proposes a five-hop multimodal Chain-of-Thought method.

    Source: §1 · p. 2
  • Results

    Extensive evaluation characterizes existing large multimodal models’ capabilities and limitations in Image-to-Web, and ablation demonstrates the effect of the five-hop prompting method.

    Source: §1 · p. 2
  • Takeaways & Limitations

    The paper provides an analysis of large multimodal models’ results in image-to-web conversion and areas for improvement.

    Source: §1 · p. 2, §8 · p. 8

    The benchmark is limited to two languages, and its dataset needs substantially more samples and broader scenario coverage to improve robustness and reliability.

    Source: Limitations · p. 9

Abstract

from arXiv · show

Recently advancements in large multimodal models have led to significant strides in image comprehension capabilities. Despite these advancements, there is a lack of the robust benchmark specifically for assessing the Image-to-Web conversion proficiency of these large models. Primarily, it is essential to ensure the integrity of the web elements generated. These elements comprise visible and invisible categories. Previous evaluation methods (e.g.,BLEU) are notably susceptible to significant alterations due to the presence of invisible elements in Web. Furthermore, it is crucial to measure the layout information of web pages, referring to the positional relationships between elements, which is overlooked by previous work. To address challenges, we have curated and aligned a benchmark of images and corresponding web codes (IW-BENCH). Specifically, we propose the Element Accuracy, which tests the completeness of the elements by parsing the Document Object Model (DOM) tree. Layout Accuracy is also proposed to analyze the positional relationships of elements by converting DOM tree into a common subsequence. Besides, we design a five-hop multimodal Chain-of-Thought Prompting for better performance, which contains five hop: 1) SoM prompt injection. 2) Inferring Elements. 3) Inferring Layout. 4) Inferring Web code. 5) Reflection. Our benchmark comprises 1200 pairs of images and web codes with varying levels of difficulty. We have conducted extensive experiments on existing large multimodal models, offering insights into their performance and areas for improvement in image-to-web domain.

1 Introduction

Image-to-Web requires models to recognize image components, infer their relative positions, and generate web code, but robust evaluation benchmarks for this task are lacking. IW-BENCH introduces a 1,200-pair benchmark, metrics for element completeness and layout, and a five-hop multimodal prompting method.

1 Introduction

  • Image-to-Web combines fine-grained component recognition, relative-position assessment, and web-code generation, yet large multimodal models have almost no domain-specific evaluation benchmark.Web pages also combine HTML, CSS, and JavaScript, making their functional and visual properties more complex than conventional programming challenges.Source: §1 · p. 1
  • Conventional similarity metrics such as BLEU can misjudge web pages because different code can produce visually indistinguishable results and invisible elements vary substantially.These metrics therefore do not precisely assess element completeness or layout intricacies.Source: §1 · p. 2
  • Element Accuracy assesses web-element completeness, while Layout Accuracy evaluates layout information; the benchmark describes both as metrics for web elements and layout.The introduction specifies that Element Accuracy uses DOM-tree parsing and examines six dimensions: tag, text content, attribute, style, JavaScript, and children; Layout Accuracy compares a common subsequence of traversed elements.Source: §1 · p. 2
  • IW-BENCH contains 1,200 image–web-code pairs across three difficulty levels, with data curated to assess large multimodal models on Image-to-Web.The benchmark construction contribution describes the pairs as spanning three challenging levels.Source: §1 · p. 2
  • The proposed five-hop multimodal Chain-of-Thought method is reported to enhance Image-to-Web performance, alongside extensive model evaluation and ablation.The five hops are SoM prompt injection, inferring elements, inferring layout, inferring web code, and reflection.Source: §1 · p. 2

2 Related work

Prior multimodal benchmarks assess instruction-following and reasoning, while IW-BENCH targets image-to-web generation across visual contexts. The related-work discussion identifies WebSight as the only related benchmark but characterizes it as closer to a fine-tuning dataset than an evaluation benchmark.

2 Related work

  • Prior multimodal benchmarks assess instruction-following and reasoning, whereas IW-BENCH targets large multimodal models’ generation capabilities for Image-to-Web across diverse visual contexts.The related-work discussion identifies WebSight as the only relevant benchmark to the authors’ knowledge, but says it is more like a fine-tuning dataset than an evaluation benchmark.Source: §2 · p. 2
  • The related-work discussion points to a distinction between evaluation benchmarks and WebSight’s role as a fine-tuning dataset.Table 1 is captioned as a comparison between IW-BENCH and WebSight; the supplied caption does not provide the comparison’s individual values.Source: §2 · p. 2, Table 1 · p. 2
  • IW-BENCH’s wordcloud contains web- and internet-related keywords, including “html” and “header.”Source: Figure 2 · p. 3

3 IW-BENCH

IW-BENCH is a benchmark of image–web-code pairs spanning three complexity levels, built with a pipeline that combines collected and generated pages. It evaluates element fidelity and layout similarity using DOM-based metrics.

3 IW-BENCH

  • IW-BENCH’s pipeline crawls publicly available pages and de-identifies and simplifies them for complex-level data, prompts GPT-4 to generate simple and medium data, then filters low-quality image-code pairs.Source: §3 · p. 3

3.1 Data Collection

  • Real-world websites were too complex, yielding uniformly poor evaluation with minimal model differentiation, so GPT-4 was prompted to create simpler data; 18% of IW-BENCH data came from real web pages.Source: §3.1 · p. 3

3.2 Data Processing

  • Real-page processing de-identifies and simplifies code, then checks whether changes preserve the original page’s visual presentation.The validation process compares screenshots rendered before and after simplification.Source: §3.2 · p. 3

3.3 Expert Review

  • Three engineers cross-validate each data point, resolving disagreements through guidelines, training, and majority consensus.Low-quality examples are re-evaluated until agreement is reached.Source: §3.3 · p. 4

3.4 Metric Design

  • The metrics build DOM trees for generated and reference pages, then compare visible and invisible elements and their attributes and relationships.The traversal collects tags, attributes, styles, JavaScript bindings, and hierarchical relationships.Source: §3.4 · p. 4

3.4.1 Element Accuracy (EA)

  • Element Accuracy averages each test element’s scores across six attributes and counts elements whose score exceeds a threshold.The six attributes are tag, text content, attributes, style, JavaScript, and children.Source: §3.4.1 · p. 4
  • EA compares tag names, text similarity, mapped attributes, selected style properties, JavaScript event bindings, and child structure.Child structure is assessed with a tree-edit distance algorithm.Source: §3.4.1 · pp. 4–5

3.4.2 Layout Accuracy (LA)

  • Layout Accuracy compares linearized label and generated element lists using the longest common subsequence and an element-similarity function.The definition also uses the label-list length to normalize the comparison.Source: §3.4.2 · p. 5

4 Five-hop multimodal Chain-of-Thought

The five-hop prompting process moves from marked-image analysis through element and layout inference to code generation and reflection. Reflection re-renders generated HTML and feeds screenshot-based feedback into another code-generation pass.

4 Five-hop multimodal Chain-of-Thought

  • The five hops are SoM prompt injection, element inference, layout inference, web-code inference, and reflection.Source: §4 · p. 5

4.1 SoM Prompt Injection

  • SoM cues—text labels, arrows, and highlights—direct models' attention to key image details to improve comprehension and precision.Source: §4.1 · p. 5

4.2 Inferring Elements

  • Element inference categorizes elements by type and function, including visible and invisible elements and their contextual contributions.Source: §4.2 · p. 5

Content

  • The prompts ask models to identify numbered, bounding-box-marked elements, describe their spatial relationships, and generate code from those descriptions without assigning boxes anew.Source: Content · p. 5

4.3 Inferring Layout

  • Layout inference analyzes elements' spatial arrangement, alignment, proximity, and hierarchy to understand UI structure and interaction flow.Source: §4.3 · p. 5

4.4 Inferring Web Code

  • Web-code inference generates HTML reflecting the analyzed interface's layout, style, and interactive features.Source: §4.4 · p. 5

4.5 Reflection

  • Reflection re-renders generated HTML, compares screenshots for element completeness and layout, and feeds analysis back into code generation for up to N iterations.The process is intended to improve code accuracy and visual consistency with the original design.Source: §4.5 · p. 6

5 Evaluation

The evaluation compares models' element and layout accuracy across three complexity levels, with and without five-hop prompting. WebSight leads overall, and five-hop prompting improves results across models; the metrics also correlate strongly with human rankings.

5.1 Experiment setting

  • The evaluation tests direct model-generated code and five-hop results for element identification and layout arrangement at simple, medium, and complex levels.The experiments use recent multimodal models as baselines; N defaults to 3, and Five-hop MCoT is not run on WebSight because it cannot accommodate simultaneous image and text input.Source: §5.2 · p. 6, §5.1 · p. 6

5.2.1 Overall Performance Comparison

  • 48.9% Element Accuracy and 47.9% Layout Accuracy make WebSight the overall leader; GPT4V with Five-hop MCoT scores 45.8% and 44.5%, versus 30.4% and 29.4% without enhancement, respectively.Source: §5.2.1 · p. 6

5.2.2 Performance by Complexity Level

  • Across complexity levels, all models' performance decreases as tasks grow harder; WebSight leads both metrics, while Gemini Pro and Qwen-VL-Max drop more as complexity rises.LLaVA-LLaMA-2-13B exhibits a more substantial decrease, which the authors suggest may indicate greater suitability for simple tasks.Source: §5.2.2 · p. 7

5.2.3 Element vs. Layout Accuracy

  • Element Accuracy tends to exceed Layout Accuracy, and the gap widens as task complexity increases.WebSight is reported as the top performer in balancing the two metrics.Source: §5.2.3 · p. 7

5.2.4 Impact of Enhancements

  • Every model improves on both metrics with Five-hop MCoT, with the largest reported impact at simple and medium complexity levels.Source: §5.2.4 · p. 7

5.2.5 Human-in-the-loop Evaluation

  • Metric-based and human-evaluation rankings have a Pearson correlation of 0.8 (P-value 0.104), based on ratings of 100 pages by 20 front-end professionals.Source: §5.2.5 · p. 7

6 Ablation

Ablations on GPT4V examine the effects of SoM prompt injection and repeated reflection. Removing SoM lowers both accuracy measures, while reflection iterations improve element accuracy before it stabilizes and leave layout accuracy comparatively stable.

6 Ablation

  • The ablation experiments evaluate the five-hop multimodal Chain-of-Thought method using GPT4V.Source: §6 · p. 7

6.1 Ablation on SoM prompt injection

  • Removing SoM lowers GPT4V’s average element accuracy by 4.2% and average layout accuracy by 5.1%.Accuracy also declines as task complexity increases; performance is better on simple and medium levels.Source: §6.1 · p. 7, Table 7 · p. 8

6.2 Ablation on Reflection

  • Element accuracy rises substantially from N=0 to N=2 reflections, then stabilizes; layout accuracy varies minimally across reflection counts.Element accuracy is higher than layout accuracy for most of the tested range.Source: Figure 6 · p. 7, §6.2 · p. 7

7 Visualization

The renderings show successive refinements over three reflections, improving text fidelity and page alignment toward the reference design.

  • Across three reflections, text fidelity and navigation layout improve, with the third pass tightening page layout and bringing color and contrast closer to the original.The first pass captures the navigation structure but not all text; the second improves text fidelity and makes the navigation more compact.Source: §7 · p. 8, Figure 7 · p. 8

8 Conclusion

The paper introduces IW-BENCH for evaluating image-to-web conversion, with metrics for element completeness and layout relationships and a five-hop multimodal Chain-of-Thought method. It evaluates large multimodal models and analyzes their results.

  • IW-BENCH pairs Element Accuracy for element completeness and Layout Accuracy for positional relationships with a five-hop multimodal Chain-of-Thought method for image-to-web conversion.Source: §8 · p. 8

Limitations

The authors identify limited language coverage and dataset size as limitations of IW-BENCH.

  • IW-BENCH currently covers only two languages, and adding languages would broaden its applicability to diverse audiences.Source: Limitations · p. 9
  • The dataset needs more samples and broader scenario and context coverage to support robustness, reliability, and validity of benchmark results.Source: Limitations · p. 9

A Data De-identification

The appendix describes measures to de-identify real web pages, the crowdsourcing study, and background on image-to-web and multimodal model research.

A Data De-identification

  • Real-page images are replaced and brand-associated content is modified to reduce direct identification and address copyright and trademark concerns.The authors describe these measures as protecting copyright holders and keeping the project legal and ethical.Source: A Data De-identification · p. 12

B Crowdsourcing

  • Participants are web engineers; the study addresses privacy and psychological risks through anonymization, secure storage, debriefing, and voluntary withdrawal.Participants receive $20 per hour, and the study monitors distress and offers support.Source: B Crowdsourcing · p. 12

C.1 Image-to-Web

  • Prior image-to-web work includes mock-up-to-HTML generation and screenshot-to-code approaches, while WebSight is described as lacking public performance evaluations.The authors call for a benchmark to evaluate large multimodal models in this domain.Source: §C.1 · p. 12

C.2 Multimodal Large Language Model

  • The related-work discussion situates the benchmark among text and vision-language foundation models and existing instruction-following and reasoning benchmarks.The authors plan to evaluate image-to-web capabilities across diverse visual contexts.Source: §C.2 · p. 12

C.3 Chain-of-Thought

The paper proposes a five-hop multimodal Chain-of-Thought approach for image-to-web evaluation and includes prompt materials and a web-page quality questionnaire.

C.3 Chain-of-Thought

  • The authors propose five-hop multimodal Chain-of-Thought prompting to evaluate multimodal large models on image-to-web tasks and compare them with other multimodal baselines.Source: §C.3 · p. 13

Content

  • The appendix provides domain prompts, element sets for simple and medium difficulty, and lists of events and CSS properties used in the web-generation materials.The domain prompts cover varied site types, including portfolios, news pages, enterprise portals, stores, blogs, and social platforms.Source: Content · pp. 13–14

G Web Page Quality and User Experience Questionnaire

  • The questionnaire uses a 1-to-5 scale to assess content clarity, layout, functionality, and overall user experience.Its items ask about comprehensibility, organization, interactive behavior, responsiveness, and satisfaction.Source: G Web Page Quality and User Experience… · pp. 15–16

I More examples in IW-BENCH

The appendix presents examples labeled as simple, medium, and complex, alongside HTML attribute lists for comparison.

I More examples in IW-BENCH

Content

  • The attribute lists mark selected HTML attributes as strong or weak comparison features across elements such as links, images, buttons, and form controls.Source: Content · pp. 17–18
Loading 2409.18980v2…