| 研究生: |
蘇彥彰 Su, Yen-Jhang |
|---|---|
| 論文名稱: |
基於生成對抗網路之名家書法字體生成 Using Generative Adversarial Network to Generate Calligraphy Fonts of Chinese Famous Calligrapher |
| 指導教授: |
王宗一
Wang, Tzone-I |
| 學位類別: |
碩士 Master |
| 系所名稱: |
工學院 - 工程科學系 Department of Engineering Science |
| 論文出版年: | 2021 |
| 畢業學年度: | 109 |
| 語文別: | 中文 |
| 論文頁數: | 50 |
| 中文關鍵詞: | 字體風格遷移 、深度學習 、生成對抗網路 |
| 外文關鍵詞: | Font style transferring, Deep learning, Generative Adversarial Network |
| 相關次數: | 點閱:168 下載:94 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
字體在文書處理上非常重要,不同字體可讓平面媒體產生不同風格,而字體的設計則有賴專業美術人員的努力,依據教育部異體字字典正字表,目前共計收錄兩萬九千九百二十一個字,要設計出一套新字體庫,將耗費可觀的人力及物力。幸而目前人工智慧已可完成大部分工作,只需給予類神經網路字體的一部分作為訓練資料集,類神經網路即可生成出來字體其餘的字。而書法應用場合也非常多元,各種書法字體風格眾所偏好亦有不同,如果應用時能套用書法名家之字體風格,不失為有趣之想法。假設類神經網路可以書法名家的字體訓練之,使其學習該名家書法字體之風格,是否可給予訓練後之神經網路一文本,並令其生成一篇具該書法名家書寫風格之字體書法,並且能無中生有,讓未經訓練之字,亦能輸出為具有該書法名家書寫風格之書法字體,形成有趣之應用。
本研究先以自製之王羲之行書字體資料集訓練一神經網路,實做出一個王羲之行書字體生成系統,能重現王羲之的行書字體風格。自製之字體資料集為故宮博物院的書畫典藏系統內之王羲之的行書體作品圖片,經過裁切成256x256畫素之大小固定單獨字體圖片,由於故宮博物院的作品是以墨拓方式之黑底白字圖片,本研究先進行前處理後,訓練資料集則成為白底黑字的格式。由於本研究的資料集收集上有先天數量少的限制,必須思考如何增加訓練資料集數量,在多方嘗試後,利用生成對抗網路所生成之字體圖片,經過人工判斷其較接近書法名家書寫風格後,再加入訓練資料集中,來擴增資料集,以此方式,反覆訓練以提升網路模型的表現。本研究利用修改後之zi2zi模型來進行書法字體風格之特徵辨識訓練,模型經訓練完成後,即可生成非常接近王羲之風格之書法字體。模型並經其他書法名家字體驗證,證明確實能有效遷移至其他字體風格之生成。
Text fonts are very important for word processing. Different fonts can produce different styles in print media. The design of fonts requires lots of efforts from professional artists. According to the Variant Dictionary Orthographic Table of the Ministry of Education, Taiwan, there are totally 29921 Chinese characters. This means designing a new font library will cost so much time, manpower, and material resources. Fortunately, artificial intelligence now can do most of the work. Given part of the fonts of a style as a training dataset, a well-trained neural network can generate the rest of the fonts of the same style. Calligraphy is one of the popular arts that can be used on many occasions and preferences of various calligraphy font styles differ from person to person. Imagine an occasion when applying the font style of popular calligraphy master to specific media text fonts; would not that be an interesting idea. Suppose a neural network is trained on the calligraphy fonts of a famous calligrapher to learn the style of the fonts and, when given a text, maybe it can generate a piece of calligraphy with the writing style of famous calligraphers. Or maybe when it encounters characters not found in training data, it can still output corresponding calligraphy fonts with the writing style of the famous calligraphers.
This research uses a self-made dataset of Wang Xizhi’s semi-cursive calligraphy fonts to train a neural network as a Wang Xizhi’s semi-cursive calligraphy font generating system, which, when given a text script, can reproduces corresponding calligraphy script with Wang Xizhi’s semi-cursive style. The self-made font dataset is from digitalized photo of Wang Xizhi’s works, calligraphy with semi-cursive style, in the calligraphy collection division of the Palace Museum, Taiwan. A work photo is cut into 256x256 pixel size pictures with an individual font in each picture. The works of the Palace Museum are pictures with white characters on black background in ink rubbing edition, which requires preprocessing to turn the training dataset to the format of black characters on a white background. Due to the limited number of data collected, this study uses a generative adversarial network to generate font images, which, when manually judged closer to the human writing style of the targeted calligrapher, are added to expand the training datasets. Such a recursive training way can finally improve the performance of model. A modified zi2zi model is used for calligraphic font style feature recognition training on the dataset in this study. The well-trained model can generate calligraphic fonts that are very close to Wang Xizhi’s style. The model has been verified by font styles of other famous calligraphers, which confirms that it can be effectively transferred to the generation of other font styles.
[1] Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017.
[2] A. K. Boyat, B. K. Joshi. A REVIEW PAPER: NOISE MODELS IN DIGITAL IMAGE PROCESSING, 2015.
[3] G. Bradski, A. Kaehler. Learning OpenCV: Computer vision with the OpenCV library, 2008.
[4] Y. Choi, Y. Uh, J. Yoo, and J.W. Ha. StarGAN v2: Diverse image synthesis for multiple domains. In CVPR, 2020.
[5] B. Chang,Q. Zhang, S. Pan, L. Meng. Generating Handwritten Chinese Characters using CycleGAN. In WACV,2018.
[6] Y. Choi, M. Choi, M. Kim, J.W. Ha, S. Kim, and J. Choo. StarGAN: Unified generative adversarial networks for multi-domain image-to-image translation. In CVPR, 2018.
[7] J. Chang and Y. Gu, Chinese typography transfer. arXiv preprint arXiv:1707.04904, 2017.
[8] X. Chen, Z. Lian, Y. Tang, and J. Xiao. 2017. An automatic stroke extraction method using manifold learning. In Proc. Eurographics, 2017.
[9] Aurélien Géron, Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow,2nd Edition, O’Reilly, pages569-574, Copyright 2019.
[10] L. A. Gatys, A. S. Ecker, M. Bethge. Image Style Transfer Using Convolutional Neural Networks. 2016.
[11] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets,2014.
[12] X. Huang and S. Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In ICCV, 2017.
[13] Z. Hu, Z. Yang, X. Liang, R. Salakhutdinov, and E. P Xing. Controllable text generation. 2017.
[14] P. Isola, J. Y. Zhu, T. H. Zhou, A. A. Efros. Image-to-Image Translation with Conditional Adversarial Networks. In CVPR,2017.
[15] Y. Jiang, Z. Lian, Y. Tang, and J. Xiao. SCFont: Structure-guided Chinese font generation via deep stacked networks. In AAAI, 2019.
[16] Z. Lian, B. Zhao, X. Chen, and J. Xiao. EasyFont: A Style Learning-Based System to Easily Build Your Large-Scale Handwriting Fonts. In ACM Trans. Graph, 2018.
[17] P. Lyu, X. Bai, C. Yao, Z. Zhu, T Huang, W. Liu. Auto-Encoder Guided GAN for Chinese Calligraphy Synthesis,2017.
[18] T. Miyato, T. Kataoka, M. Koyama, and Y. Yoshida. Spectral normalization for generative adversarial networks. In ICLR, 2018.
[19] M. Mirza, S. Osindero. Conditional Generative Adversarial Nets. arXiv preprint arXiv:1411.1784, 2014.
[20] A. Odena, C. Olah, J. Shlens. Conditional Image Synthesis With Auxiliary Classifier GANs,2017.
[21] A. Radford, L. Metz, S. Chintala. Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks,2016.
[22] O. Ronneberger, P. Fischer, T. Brox. U-Net: Convolutional Networks for Biomedical Image Segmentation. In MICCAI,2015.
[23] A. Srivatsan, J. Barron, D. Klein, and T. B. Kirkpatrick. A deep factorization of style and structure in fonts. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), 2019.
[24] D. Sun, T. Ren, C. Li, H. Su, and J. Zhu. Learning to write stylized Chinese characters by reading a handful of examples. In IJCAI, 2018.
[25] K. Simonyan, A. Zisserman. Very Deep Convolutional Networks for Large-Scale Image Recognitio,2015.
[26] Y. Taigman, A. Polyak, L. Wolf. Unsupervised Cross-Domain Image Generation,2016.
[27] Y. Tian. Rewrite: Neural Style Transfer For Chinese Fonts. Retrieved from https://github.com/kaonashi-tyc/Rewrite, 2016.
[28] Y. Tian. zi2zi: Master Chinese calligraphy with conditional adversarial networks. https://kaonashi-tyc.github.io/2017/04/06/zi2zi.html, 2017.
[29] S.J. Wu, C.Y. Yang, J. Y.j. Hsu. CalliGAN: Style and Structure-aware Chinese Calligraphy Character Generator. In CVPR,2020.
[30] C. Wen, J. Chang, and Y. Zhang. Handwritten Chinese font generation with collaborative stroke refinement. arXiv preprint arXiv:1904.13268, 2019.
[31] J.Y. Zhu, T. Park, P. Isola, A. A. Efros. Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks. In ICCV, 2017.
[32] H. Zhao, O. Gallo, I. Frosio, J. Kautz. Loss Functions for Neural Networks for Image Processing
[33] 故宮博物院書畫典藏資料檢索系統 檢自https://painting.npm.gov.tw/
[34] 陳忠建字庫 檢自http://163.20.160.14/~word/modules/myalbum/
[35] 永字八法詳解 檢自 https://kknews.cc/zh-tw/culture/mkjx5z.html