# Equipping Sketch Patches with Context-Aware Positional Encoding for Graphic Sketch Representation

Source: [Equipping Sketch Patches with Context-Aware Positional Encoding for Graphic Sketch Representation](<https://www.sota2.com/research/paper/68fa78841e209131cea78cab>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-26T04:40:15.707Z

Authors: Sicong Zang, Zhijun Fang

Published: 2024-03-26T09:26:12.000Z

## Abstract

When benefiting graphic sketch representation with sketch drawing orders, recent studies have linked sketch patches as graph edges by drawing orders in accordance to a temporal-based nearest neighboring strategy. However, such constructed graph edges may be unreliable, since the contextual relationships between patches may be inconsistent with the sequential positions in drawing orders, due to variants of sketch drawings. In this paper, we propose a variant-drawing-protected method by equipping sketch patches with context-aware positional encoding (PE) to make better use of drawing orders for sketch learning. We introduce a sinusoidal absolute PE to embed the sequential positions in drawing orders, and a learnable relative PE to encode the unseen contextual relationships between patches. Both types of PEs never attend the construction of graph edges, but are injected into graph nodes to cooperate with the visual patterns captured from patches. After linking nodes by semantic proximity, during message aggregation via graph convolutional networks, each node receives both semantic features from patches and contextual information from PEs from its neighbors, which equips local patch patterns with global contextual information, further obtaining drawing-order-enhanced sketch representations. Experimental results indicate that our method significantly improves sketch healing and controllable sketch synthesis. The source codes could be found at https://github.com/SCZang/DC-gra2seq.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Sketch Reconstruction on DS1](<https://www.sota2.com/research/sota/sketch-reconstruction-on-ds1.md>): Sketch Reconstruction; DS1; Rec: 90.41.

- [stroke-level sketch edit on DS2 QuickDraw (test)](<https://www.sota2.com/research/sota/stroke-level-sketch-edit-on-ds2-quickdraw-test.md>): stroke-level sketch edit; DS2 QuickDraw (test); Reconstruction: 81.34.

- [Stroke-Level Sketch Edit on DS1 QuickDraw (test)](<https://www.sota2.com/research/sota/stroke-level-sketch-edit-on-ds1-quickdraw-test.md>): stroke-level sketch edit; DS1 QuickDraw (test); Reconstruction: 63.63.

- [Stroke Replacement on QuickDraw Human Evaluation](<https://www.sota2.com/research/sota/stroke-replacement-on-quickdraw-human-evaluation.md>): Stroke Replacement; QuickDraw Human Evaluation; Human Score: 0.44.

- [Sketch Reconstruction on DS2](<https://www.sota2.com/research/sota/sketch-reconstruction-on-ds2.md>): Sketch Reconstruction; DS2; Reconstruction Score: 85.67.

- [Stroke Erasion on QuickDraw Human Evaluation](<https://www.sota2.com/research/sota/stroke-erasion-on-quickdraw-human-evaluation.md>): Stroke Erasion; QuickDraw Human Evaluation; Human Score: 0.24.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2403.17525>)

[PDF](<https://arxiv.org/pdf/2403.17525.pdf>)
