A deep learning pipeline for the palaeographical dating of ancient G reek papyrus fragments (2024)

Abstract: In this paper we present a deep learning pipeline for automatically dating ancient Greek papyrus fragments based solely on fragment images. The overall pipeline consists of several stages, including handwritten text recognition (HTR) to detect and classify characters, filtering and grouping of detected characters, 24 character-level date prediction models, and a fragment-level date prediction model that utilizes the per-character predictions. A new dataset (containing approximately 7,000 fragment images and 778,000 character images) was created by scraping papyrus databases, extracting fragment images with known dates, and running them through our HTR models to obtain labeled character images. Transfer learning was then used to fine-tune separate ResNets to predict dates for individual characters which are then used, in aggregate, to train the fragment-level date prediction model. Experiments show that even though the average accuracies of character-level dating models is low, between 35%-45%, the fragment-level model can achieve up to 79% accuracy in predicting a broad, two-century date range for fragments with many characters. We then discuss the limitations of this approach and outline future work to improve temporal resolution and further testing on additional papyri. This image-based deep learning approach has great potential to assist scholars in the palaeographical analysis and dating of ancient Greek manuscripts.

## introduction with the meteoric rise in deep learning technologies, many fields are rapidly adopting these tools and incorporating them into their workflow. palaeography, the study of the handwriting in ancient and medieval manuscripts, is one such discipline that has benefited from these methods. projects such as read ( https://eadh.org/projects/read ) and digipal ( https://eadh.org/projects/digipal ), for example, have focused on applying these methods to issues of writer identification, layout analysis, and frameworks for digital palaeographical content, especially via handwritten text recognition (htr). one important project of note is ithaca @xcite which, among other uses, can attribute a date range to an inscription. our approach differs in that while ithaca takes digital transcriptions as input, our pipeline relies solely on images. in this paper, we present our latest contribution to this research effort, consisting of a dataset and deep learning pipeline for dating ancient greek papyrus fragments. this pipeline takes as input an image of an ancient greek papyrus fragment and outputs a predicted date range. we describe the training methodologies used to create the various models constituting the pipeline as well as a number of performance metrics. ## a dataset for palaeographical dating the development of the palaeographical dating pipeline necessitated the construction of a dataset containing images of papyrus fragments, their constituent characters, and their dates of composition. three large papyrus databases were scraped for their fragment images and metadata (including dates of composition). the databases chosen were the berlin papyrus database, papiri della società italiana (psi), and the duke papyrus archive. for the first iteration of this dataset, we focused only on documentary papyri that preserve an exact date or are reliably dated within a range of a century or two. since the format of the dates varied, the dates were processed and converted to a common format containing only the century or range of two centuries of composition. to reduce the difficulty of the dating task, we decreased the temporal resolution of the date classes from the one-century level to the two-century level: 4th-3rd bce, 2nd-1st bce, 1st-2nd ce, 3rd-4th ce, and 5th-6th ce (future work will consist of increasing the temporal resolution). the fragment images were then passed through our htr models, thus obtaining cropped and classified images of each fragment's constituent characters. these character images are assigned the same date classes as the fragment on which they were written. the character and fragment counts for each timeperiod in the dataset are detailed in tables 1 and 2 . as can be seen, we have examples of all 24 greek characters from the 4th bce to the 6th ce. there is also significant imbalance in both the characters and the dates. concerning the characters, there are only 1,060 psis (ψ, ψ) but 108,453 omicrons (o, o). fortunately, transfer learning permits one to use a smaller dataset while still getting useful results since the majority of the layers have already been trained. concerning the dates, 1st-2nd ce contains the largest number of characters and fragments (373,151 and 3,418, respectively) while 4th-3rd bce contains the least (68,993 and 299, respectively). it should be noted that this dataset is actually a subset of all that was scraped from the papyrus archives and run through the htr pipeline. many of the characters in the full dataset are of poor quality and were filtered out to create the final dataset. filtering was done based on two factors: 1) image saturation entropy and 2) resnet prediction entropy. the first is done in order to eliminate yolo false positives which often consist of images with few ink pixels. consequently, false positives of this type tend to have a low entropy in the distribution of their pixel saturation and can be reliably (though, not completely) eliminated by applying a simple threshold. the second filter removes images which were unreliably classified by the resnet. again, these can be fairly reliably eliminated by applying a threshold to the entropy of the resnet's predicted class probabilities. ## a pipeline for palaeographical dating given the goal of producing a deep learning pipeline which can take an image of an ancient greek papyrus fragment as input and output a predicted date of composition, the primary task is to determine the proper architecture for such a pipeline. figure 3 depicts the chosen architecture, which consists of five core stages: htr, filtering/grouping of characters, character dating, feature engineering, and fragment dating. ## model evaluation in this section, we will discuss the performance of the models which comprise the palaeographical dating pipeline. ## conclusions while this research is still in its early stages, our results suggest that deep learning can perform the task of palaeographically dating ancient greek papyri based solely on image input. this initial dataset and pipeline thus has the potential to further enhance the field of digital palaeography. future work will pertain to increasing that temporal resolution and to leveraging the large number of individual characters in the dataset for analyzing handwriting features across time. additionally, we plan to investigate the use of similar techniques for the location attribution of greek papyri. more importantly, as noted above, this pipeline focuses on documentary papyri. although these kinds of manuscripts constitute the ground truth for assigning dates to other papyri, literary and sub-literary papyri, which never preserve their date of production, have unique features of their own. how these models perform on and/or adapt to these manuscripts will also be a critical next step.