[Paper Review] Sketch2code: Generating a website from a paper mockup
This paper presents Sketch2code, a system that automatically generates HTML websites from hand-drawn wireframes using two approaches: classical computer vision and deep semantic segmentation. The deep learning method outperformed classical techniques, demonstrating the potential of deep learning for wireframe-to-code translation, and the authors released a dataset and evaluation framework to advance future research in this domain.
An early stage of developing user-facing applications is creating a wireframe to layout the interface. Once a wireframe has been created it is given to a developer to implement in code. Developing boiler plate user interface code is time consuming work but still requires an experienced developer. In this dissertation we present two approaches which automates this process, one using classical computer vision techniques, and another using a novel application of deep semantic segmentation networks. We release a dataset of websites which can be used to train and evaluate these approaches. Further, we have designed a novel evaluation framework which allows empirical evaluation by creating synthetic sketches. Our evaluation illustrates that our deep learning approach outperforms our classical computer vision approach and we conclude that deep learning is the most promising direction for future research.
Motivation & Objective
- Address the gap in automated wireframe-to-code translation by developing a system that converts paper sketches into working websites.
- Compare classical computer vision techniques with deep learning-based semantic segmentation for wireframe element detection and code generation.
- Create a publicly available dataset of wireframes and corresponding HTML code to support future research in design-to-code automation.
- Design a repeatable empirical evaluation framework using synthetic sketches to objectively assess performance across multiple metrics.
- Enable non-developers to prototype websites independently by automating boilerplate GUI code generation.
Proposed method
- Developed a dual-approach framework: one using classical computer vision (edge detection, color segmentation, text detection) and another using a deep semantic segmentation network fine-tuned on synthetic sketches.
- Constructed a dataset of 10,000 website wireframes and their corresponding HTML code, with sketches generated via a controlled sketching procedure to ensure consistency.
- Applied preprocessing to convert camera-captured images into clean, normalized sketches suitable for input to both models.
- Used a U-Net-style deep learning architecture for semantic segmentation, trained on synthetic wireframe sketches to improve generalization.
- Implemented post-processing to normalize layouts, correct alignment errors, and map detected elements to semantic HTML tags.
- Deployed generated websites in real time and enabled live collaboration via hosted web deployment.
Experimental results
Research questions
- RQ1RQ1: Can a classical computer vision pipeline effectively detect and classify wireframe elements (e.g., text, buttons, inputs) from hand-drawn sketches?
- RQ2RQ2: Does a deep learning-based semantic segmentation approach outperform classical computer vision in detecting and classifying wireframe elements and generating correct HTML structure?
- RQ3RQ3: How do users perceive the quality and usability of websites generated from sketches using each method, in terms of visual fidelity and structural correctness?
- RQ4RQ4: Can a synthetic sketching procedure enable reliable, repeatable evaluation of wireframe-to-code systems?
Key findings
- The deep learning-based semantic segmentation approach significantly outperformed the classical computer vision method in element detection and classification accuracy.
- Micro-performance evaluation showed that the deep learning model achieved higher F1-scores across all element types, particularly for complex components like inputs and buttons.
- In visual comparison tasks, users preferred the output of the deep learning model, citing better layout alignment and more accurate representation of intended design.
- Structural comparison revealed that the deep learning model produced more semantically correct HTML with fewer layout and nesting errors.
- User studies confirmed that the deep learning-generated websites were perceived as more usable and closer to the original sketch intent than those from the classical approach.
- Despite strong performance in evaluation, neither system achieved production-ready reliability, indicating room for improvement in robustness and generalization.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.