Research Article

Converting graphs to ASCII art with convolutional neural network

Jiongyi Li*
Department of Engineering, Pennsylvania State University, State College, PA 16802, USA

* Corresponding author: [email protected]

Abstract

In an era marked by data's rapid proliferation, novel data representation and analysis methods have become increasingly significant. However, translating complex graphical structures into character-based representations remains a largely unexplored territory. This problem holds considerable importance due to its potential applications in fields like data compression and the development of innovative graphical interfaces. This study seeks to address this gap by proposing a unique methodology that uses a Convolutional Neural Network (CNN) model to translate graphical images into corresponding character arrangements. The approach involves preprocessing graphical inputs using edge detection techniques, slicing the pre-processed graph into specific columns, and feeding the resulting slices into the trained Convolutional Neural Network (CNN) model for character prediction. I interpret the SoftMax output of the model to determine the most probable character for each slice. The results indicate that the granularity of slicing impacts the accuracy of the generated character-laden graph, with higher granularity producing more precise translations. This finding demonstrates the model's ability to effectively translate graphical data into character-based representations, offering promising prospects for future study in this domain.

Keywords: convolutional neural network (CNN); graph-to-character translation; image preprocessing
Published: February 4, 2024
DOI: 10.54254/2755-2721/33/20230231
Volume: ACE Vol.33
pp. 57-64
Download PDF

References

  1. Jordan, M. I., & Mitchell, T. M. (2015). Machine learning: Trends, perspectives, and prospects. Science, 349(6245), 255-260.
  2. Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). ImageNet classification with deep convolutional neural networks. Advances in Neural Information Processing Systems, pp. 1097-1105.
  3. LeCun Y, Bengio Y, Hinton G. Deep learning. Nature. 2015 May;521(7553):436-444.
  4. He K, Zhang X, Ren S, Sun J. Deep Residual Learning for Image Recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition 2016. p. 770-778.
  5. Mayer-Schönberger, V., & Cukier, K. (2013). Big Data: A Revolution That Will Transform How We Live, Work, and Think. Houghton Mifflin Harcourt.
  6. Kingma DP, Ba J. (2014). Adam: A Method for Stochastic Optimization. arXiv preprint arXiv:1412.6980.
  7. Gatys, L. A., Ecker, A. S., & Bethge, M. (2015). A neural algorithm of artistic style. ArXiv, arXiv:1508.06576.
  8. Selvaraju, R. R., Cogswell, M., Das, A., Vedantam, R., Parikh, D., & Batra, D. (2017). Grad-cam: Visual explanations from deep networks via gradient-based localization. Proceedings of the IEEE International Conference on Computer Vision, pp. 618-626.
  9. Johnson J, Alahi A, Li FF. Perceptual losses for real-time style transfer and super-resolution. In European conference on computer vision 2016 Oct 8 (pp. 694-711). Springer, Cham.
  10. Ulyanov D, Vedaldi A, Lempitsky V. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022. 2016 Jul 27.
  11. Schmidhuber, J. (2015). Deep learning in neural networks: An overview. Neural networks, 61, 85-117.
  12. Canny J. A computational approach to edge detection. IEEE Transactions on Pattern Analysis and Machine Intelligence. 1986;PAMI-8(6):679-698.
  13. Szegedy C, Vanhoucke V, Ioffe S, Shlens J, Wojna Z. (2016). Rethinking the Inception Architecture for Computer Vision. arXiv preprint arXiv:1512.00567.