{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/disentangling-writer-and-character-styles-for","title":"Disentangling Writer and Character Styles for Handwriting Generation","arxiv_id":"2303.14736","date":"2023-03-26","proceeding":"CVPR 2023 1","authors":["Gang Dai","Yifan Zhang","Qingfeng Wang","Qing Du","Zhuliang Yu","Zhuoman Liu","Shuangping Huang"],"abstract":"Training machines to synthesize diverse handwritings is an intriguing task. Recently, RNN-based methods have been proposed to generate stylized online Chinese characters. However, these methods mainly focus on capturing a person's overall writing style, neglecting subtle style inconsistencies between characters written by the same person. For example, while a person's handwriting typically exhibits general uniformity (e.g., glyph slant and aspect ratios), there are still small style variations in finer details (e.g., stroke length and curvature) of characters. In light of this, we propose to disentangle the style representations at both writer and character levels from individual handwritings to synthesize realistic stylized online handwritten characters. Specifically, we present the style-disentangled Transformer (SDT), which employs two complementary contrastive objectives to extract the style commonalities of reference samples and capture the detailed style patterns of each sample, respectively. Extensive experiments on various language scripts demonstrate the effectiveness of SDT. Notably, our empirical findings reveal that the two learned style representations provide information at different frequency magnitudes, underscoring the importance of separate style extraction. Our source code is public at: https://github.com/dailenson/SDT.","url_abs":"https://arxiv.org/abs/2303.14736v2","url_pdf":"https://arxiv.org/pdf/2303.14736v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"disentangling-writer-and-character-styles-for","repo_url":"https://github.com/dailenson/sdt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"disentangling-writer-and-character-styles-for","repo_url":"https://github.com/koninik/htg_evaluation","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"handwriting-generation","task_name":"Handwriting generation"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2303.14736","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2303.14736"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/koninik/htg_evaluation","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dailenson/sdt","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/dailenson/SDT","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":16},"by_repo_kind":{"official":{"samples":10,"ran":0,"repositories":1},"listed":{"samples":6,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"22a46289db28df6d","entry":"affine_transformation","repo":"koninik/htg_evaluation","repo_kind":"listed","path":"utils/auxilary_functions.py","file_url":"https://github.com/koninik/htg_evaluation/blob/HEAD/utils/auxilary_functions.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"22a46289db28df6d"}},{"code_sha256_prefix":"87f89dec0143219f","entry":"assert_and_infer_cfg","repo":"dailenson/SDT","repo_kind":"official","path":"parse_config.py","file_url":"https://github.com/dailenson/SDT/blob/HEAD/parse_config.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"87f89dec0143219f"}},{"code_sha256_prefix":"d3c210804250a1dc","entry":"build_transformer","repo":"dailenson/SDT","repo_kind":"official","path":"models/transformer.py","file_url":"https://github.com/dailenson/SDT/blob/HEAD/models/transformer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d3c210804250a1dc"}},{"code_sha256_prefix":"ae6d12745b44744a","entry":"centered","repo":"koninik/htg_evaluation","repo_kind":"listed","path":"utils/auxilary_functions.py","file_url":"https://github.com/koninik/htg_evaluation/blob/HEAD/utils/auxilary_functions.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ae6d12745b44744a"}},{"code_sha256_prefix":"271b9e1e885936bf","entry":"eval_class_epoch","repo":"koninik/htg_evaluation","repo_kind":"listed","path":"htg_style.py","file_url":"https://github.com/koninik/htg_evaluation/blob/HEAD/htg_style.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"271b9e1e885936bf"}},{"code_sha256_prefix":"3938029b16a8e652","entry":"get_mixture_coef","repo":"dailenson/SDT","repo_kind":"official","path":"models/gmm.py","file_url":"https://github.com/dailenson/SDT/blob/HEAD/models/gmm.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3938029b16a8e652"}},{"code_sha256_prefix":"c3c5ed7bdf6dff50","entry":"get_pen_loss","repo":"dailenson/SDT","repo_kind":"official","path":"models/loss.py","file_url":"https://github.com/dailenson/SDT/blob/HEAD/models/loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c3c5ed7bdf6dff50"}},{"code_sha256_prefix":"0a53368641da7207","entry":"get_seq_from_gmm","repo":"dailenson/SDT","repo_kind":"official","path":"models/gmm.py","file_url":"https://github.com/dailenson/SDT/blob/HEAD/models/gmm.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0a53368641da7207"}},{"code_sha256_prefix":"e8bf18bac8135a3c","entry":"image_resize","repo":"koninik/htg_evaluation","repo_kind":"listed","path":"utils/auxilary_functions.py","file_url":"https://github.com/koninik/htg_evaluation/blob/HEAD/utils/auxilary_functions.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e8bf18bac8135a3c"}},{"code_sha256_prefix":"61789a642c162a1b","entry":"length_to_mask","repo":"dailenson/SDT","repo_kind":"official","path":"models/eval_model.py","file_url":"https://github.com/dailenson/SDT/blob/HEAD/models/eval_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"61789a642c162a1b"}},{"code_sha256_prefix":"977232b5fb66d03c","entry":"mask_avr_pooling","repo":"dailenson/SDT","repo_kind":"official","path":"models/eval_model.py","file_url":"https://github.com/dailenson/SDT/blob/HEAD/models/eval_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"977232b5fb66d03c"}},{"code_sha256_prefix":"8acffa1b60bdf3a3","entry":"mask_avr_pooling_rnn","repo":"dailenson/SDT","repo_kind":"official","path":"models/eval_model.py","file_url":"https://github.com/dailenson/SDT/blob/HEAD/models/eval_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8acffa1b60bdf3a3"}},{"code_sha256_prefix":"67e4aa07555e7628","entry":"performance","repo":"koninik/htg_evaluation","repo_kind":"listed","path":"htg_style.py","file_url":"https://github.com/koninik/htg_evaluation/blob/HEAD/htg_style.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"67e4aa07555e7628"}},{"code_sha256_prefix":"9f7efffab3bafdef","entry":"set_log","repo":"dailenson/SDT","repo_kind":"official","path":"utils/logger.py","file_url":"https://github.com/dailenson/SDT/blob/HEAD/utils/logger.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9f7efffab3bafdef"}},{"code_sha256_prefix":"67b19b6b4b262e2b","entry":"tf_2d_normal","repo":"dailenson/SDT","repo_kind":"official","path":"models/loss.py","file_url":"https://github.com/dailenson/SDT/blob/HEAD/models/loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"67b19b6b4b262e2b"}},{"code_sha256_prefix":"f0595038a8dda9b6","entry":"train_class_epoch","repo":"koninik/htg_evaluation","repo_kind":"listed","path":"htg_style.py","file_url":"https://github.com/koninik/htg_evaluation/blob/HEAD/htg_style.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f0595038a8dda9b6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}