Deep Learning for Classical Japanese Literature

Tarin Clanuwat, Mikel Bober-Irizar, Asanobu Kitamoto, Alex Lamb, Kazuaki Yamamoto, David HaarXiv 2018 · DOI · OpenReview

Abstract: Much of machine learning research focuses on producing models which perform well on benchmark tasks, in turn improving our understanding of the challenges associated with those tasks. From the perspective of ML researchers, the content of the task itself is largely irrelevant, and thus there have increasingly been calls for benchmark tasks to more heavily focus on problems which are of social or cultural relevance. In this work, we introduce Kuzushiji-MNIST, a dataset which focuses on Kuzushiji (cursive Japanese), as well as two larger, more challenging datasets, Kuzushiji-49 and Kuzushiji-Kanji. Through these datasets, we wish to engage the machine learning community into the world of classical Japanese literature. Dataset available at https://github.com/rois-codh/kmnist

Introduction: The "Locked" History of Kuzushiji

For over a millennium, the Japanese language was written in a cursive style known as Kuzushiji. This script was the standard for everything from official records to popular literature. However, following the Meiji Restoration in 1868, the Japanese education system was standardized and modernized, leading to the abandonment of Kuzushiji in favor of modern printed script.

Example of a classical Japanese book page featuring both text and illustrations.

Consequently, documents written just 150 years ago are now essentially "locked" to the general public; it is estimated that over 3 million books and a billion historical documents exist that only a tiny fraction of specialized scholars can read. While many of these have been digitized, the sheer volume makes manual transcription impossible. The authors argue that machine learning research should pivot toward problems with real-world social and cultural utility, using these vast archives as a primary use case.

The Kuzushiji Datasets

To bridge the gap between deep learning and classical literature, three distinct datasets were released, all derived from 35 classical books printed in the 18th century. These datasets are designed as more challenging, culturally significant alternatives to over-saturated benchmarks like MNIST.

Kuzushiji dataset samples alongside original manuscript text.
  • Kuzushiji-MNIST: A balanced dataset of 70,000 28x28 grayscale images across 10 classes (representing the 10 rows of the Hiragana syllabary). It is designed as a "drop-in" replacement for the original MNIST.
  • Kuzushiji-49: A much larger, imbalanced dataset containing 270,000 images across 49 classes (the full Hiragana alphabet plus one iteration mark).
  • Kuzushiji-Kanji: A highly complex dataset of 140,000 images covering 3,832 different Kanji characters. This dataset is extremely imbalanced, reflecting the natural frequency of characters in literature.

Methodology

The paper approaches the problem from two angles: classification and generative domain transfer.

Classification Baselines

To establish the difficulty of the new datasets, several standard models were tested, ranging from simple 4-Nearest Neighbor algorithms to advanced ResNet-18 architectures. The authors utilized "Mixup" regularization, a technique that trains on combinations of images to improve model robustness against the fluid nature of cursive strokes.

Domain Transfer (Cursive to Modern)

The authors developed a pipeline to "translate" cursive Kuzushiji Kanji into modern, readable Kanji using:

  • Variational Autoencoders (VAEs): To compress both Kuzushiji and modern Kanji into latent spaces.
  • Mixture Density Networks (MDN): To map the latent space of the cursive script to the latent space of the modern script.
  • Sketch-RNN: A model used to generate the final modern Kanji as a sequence of pen strokes, mimicking human writing for better interpretability.

Key Insights and Results

A significant challenge in this domain is the existence of Hentaigana (variant kana). Unlike modern Japanese, where one sound corresponds to one character, classical Japanese uses multiple variant characters for a single sound. For a model, this represents a multi-modal distribution, making it significantly harder to learn than standard digits.

Experimental results confirmed this increased difficulty. While the original MNIST is often considered "solved" (accuracies >99.5%), Kuzushiji-MNIST proved more resistant, with the best ResNet-18 model achieving 98.83% accuracy. On the imbalanced Kuzushiji-49 dataset, top accuracy was 97.33%.

Conclusion

The Kuzushiji datasets provide a unique playground for few-shot learning and transfer learning research due to the extreme "long tail" of the Kanji character distribution. By engaging the global machine learning community, the authors hope to solve the transcription bottleneck and reclaim a lost millennium of Japanese history.

Summary updated

Abstract

Much of machine learning research focuses on producing models which perform well on benchmark tasks, in turn improving our understanding of the challenges associated with those tasks. From the perspective of ML researchers, the content of the task itself is largely irrelevant, and thus there have increasingly been calls for benchmark tasks to more heavily focus on problems which are of social or cultural relevance. In this work, we introduce Kuzushiji-MNIST, a dataset which focuses on Kuzushiji (cursive Japanese), as well as two larger, more challenging datasets, Kuzushiji-49 and Kuzushiji-Kanji. Through these datasets, we wish to engage the machine learning community into the world of classical Japanese literature. Dataset available at https://github.com/rois-codh/kmnist
BibTeX
@misc{clanuwat2018deep,
  author = {Tarin Clanuwat and Mikel Bober-Irizar and Asanobu Kitamoto and Alex Lamb and Kazuaki Yamamoto and David Ha},
  title = {{Deep Learning for Classical Japanese Literature}},
  year = {2018},
  eprint = {1812.01718},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1812.01718},
}
Figure