The relationship between the expansion of literacy in Judah and composition of biblical texts has attracted scholarly attention for over a century. Information on this issue can be deduced from Hebrew inscriptions from the final phase of the first Temple period. We report our investigation of 16 inscriptions from the Judahite desert fortress of Arad, dated ca. 600 BCE-the eve of Nebuchadnezzar's destruction of Jerusalem. The inquiry is based on new methods for image processing and document analysis, as well as machine learning algorithms. These techniques enable identification of the minimal number of authors in a given group of inscriptions. Our algorithmic analysis, complemented by the textual information, reveals a minimum of six authors within the examined inscriptions. The results indicate that in this remote fort literacy had spread throughout the military hierarchy, down to the quartermaster and probably even below that rank. This implies that an educational infrastructure that could support the composition of literary texts in Judah already existed before the destruction of the first Temple. A similar level of literacy in this area is attested again only 400 y later, ca. 200 BCE. biblical exegesis | literacy level | Arad ostraca | document analysis | machine learning B ased on biblical exegesis and historical considerations scholars debate whether the first major phase of compilation of biblical texts in Jerusalem took place before or after the destruction of the city by the Babylonians in 586 BCE (e.g., ref. 1). A related-and also disputed-issue is the level of literacy, that is, the basic ability to communicate in writing, especially in the Hebrew kingdoms of Israel and Judah (2). The best way to answer this question is to look at the material evidence: the corpus of inscriptions that originated from archaeological excavations (e.g., ref. 3). Inscriptions citing biblical texts, or related to them, are rarely found (for two Jerusalem amulets possibly dating to this period, echoing the priestly blessing in Numbers 6:23-26, see refs. 4 and 5), probably because papyrus and parchment are not well preserved in the climate of the region. However, ostraca (inscriptions in ink on ceramic sherds) that deal with more mundane issues can also shed light on the volume and quality of writing and on the recognition of the power of the written word in the society. To explore the degree of literacy and stage setting for compilation of literary texts in monarchic Judah, we turned to Hebrew ostraca from the final days of the kingdom, before its destruction by Nebuchadnezzar in 586 BCE and the deportation of its elite to Babylonia. Several corpora of inscriptions exist for this period. We focused on the corpus of over 100 Hebrew ostraca found at the fortress of Arad, located in arid southern Judah, on the border of the kingdom with Edom (see ref. 6 and Fig. 1 ). The inscriptions contain military commands regarding movement of troops and provision of supplies (wine, oil, and flour) set against the background of the stormy events of the final years before the fall of Judah. They include orders that came to the fortress of Arad from higher echelons in the Judahite military system, as well as correspondence with neighboring forts. One of the inscriptions mentions "the King of Judah" and another "the house of YHWH," referring to the Temple in Jerusalem. Most of the provision orders that mention the Kittiyimapparently a Greek mercenary unit (7)-were found on the floor of a single room. They are addressed to a person named Eliashib, the quartermaster in the fortress. It has been suggested that most of Eliashib's letters involve the registration of about one month's expenses (8) . Of all of the corpora of Hebrew inscriptions, Arad provides the best set of data for exploring the question of literacy at the end of the first Temple period: (i) The lion's share of the corpus represents a short time span of a few years ca. 600 BCE; (ii) it comes from a remote region of the kingdom, where the spread of literacy is more significant than its dissemination in the capital; and (iii) it is connected to Judah's military administration and hence bureaucratic apparatus. Identifying the number of "hands" (i.e., authors) involved in this corpus can shed light on the Significance Scholars debate whether the first major phase of compilation of biblical texts took place before or after the destruction of Jerusalem in 586 BCE. Proliferation of literacy is considered a precondition for the creation of such texts. Ancient inscriptions provide important evidence of the proliferation of literacy. This paper focuses on 16 ink inscriptions found in the desert fortress of Arad, written ca. 600 BCE. By using novel image processing and machine learning algorithms we deduce the presence of at least six authors in this corpus. This indicates a high degree of literacy in the Judahite administrative apparatus and provides a possible stage setting for compilation of biblical texts. After the kingdom's demise, a similar literacy level reemerges only ca. 200 BCE. Author contributions: S.F.-G., A.S., and B. Sober designed research; S.F.-G., A.S., and B. Sober performed research; S.F.-G., A.S., and B. Sober contributed new reagents/analytic tools; D.L. and E.T. supervised the development of the algorithms; N.N., B. Sass, and I.F. provided archaeological and epigraphical analysis and historical reconstruction; E.P. supervised the development of the algorithms; S.F.-G., A.S., and B. Sober analyzed data; S.F.-G., A.S., B. Sober, D.L., N.N., B. Sass, E.T., E.P., and I.F. wrote the paper; and E.P. and I.F. headed the research team.  One might try to use existing computerized algorithms for automatic handwriting comparison purposes. However, an algorithmic analysis of the Arad corpus via readily available means is hampered by several factors. First, the poor state of preservation of the ostraca (Fig. 2) could not be remedied by existing image acquisition methods (9, 10). Second, the imperfect digital images present a challenge for image segmentation and enhancement methods (11, 12) . Finally, recognizing hands via document analysis algorithms is a tantalizing problem even in a modern writing setting (13). Consequently, we developed new methods for image processing and document analysis, as well as machine learning algorithms. These techniques allow us to identify the minimal number of authors represented in a given group of ostraca. Our algorithmic sequence consisted of three consecutive stages, operating on digital images of the ostraca (see Supporting Information). All of the stages are fully automatic, with the exception of the first, which is a semiautomatic step. i) Restoring characters (see example in Fig. 3 ; also see Supporting Information and ref. 14) ii) Extraction of characters' features, describing their different aspects (e.g., angles between strokes and character profiles), and measuring the similarity ("distances") between the characters' feature vectors. iii) Testing the null hypothesis H 0 (for each pair of ostraca), that two given inscriptions were written by the same author. A corresponding P value (P) is deduced, leveraging the data from the previous step. If P ≤ 0.2, we reject H 0 and accept the competing hypothesis of two different authors; otherwise, we remain undecided. The end product is a table containing the P for a comparison of each pair of ostraca. Before implementing our methodology on the Arad corpus, it was thoroughly tested on modern Hebrew handwritings and found solid (see Supporting Information for details). Using this computerized procedure we analyzed 16 inscriptions from the Arad fortress (namely, ostraca 1, 2, 3, 5, 7, 8, 16, 17, 18, , 24, 31, 38, 39, 40, and 111), which are relatively legible and have a sufficient number of characters for examination. Two of the inscriptions (ostraca 17 and 39) are inscribed on both sides of the sherd, bringing the number of texts under investigation to 18. The results are summarized in Table 1 . The ostraca numbers head the rows and columns of the table, with the intersection cells providing the comparisons' P. The cells with P ≤ 0.2 are marked in red, indicating that the two ostraca are considered to be written by different authors. We reiterate that when P > 0.2 we cannot claim that they were written by a single author. The results allow us to estimate the minimal number of writers in the tested inscriptions. For example, the examination of ostraca 7, 18, 24, and 40 reveals that their authors are pairwise distinct; in fact, six such "quadruplets" can be identified in Table 1 , rendering the existence of at least four authors as highly likely; see Supporting Information for details. Therefore, based on the statistical analysis, it can be deduced that there are at least four unique hands in the tested corpus. Our algorithmic observations can be further supplemented by the textual and archaeological context of the ostraca, deliberately avoided until this point. In particular, the prosaic lists of names in ostraca 31 and 39* were most likely composed at Arad, as opposed to ostraca 7, 18, 24, and 40, which were probably dispatched from other locations. † As per the table, ostracon 31 differs from both sides of ostracon 39; we can thus conjecture an existence of two additional authors, totaling at least six distinct writers. Identifying the military ranks of the authors can provide information regarding the spread of literacy within the Judahite army. Our proposed reconstruction of the hierarchical relations between the signees and the addressees of the examined inscriptions is as follows ‡ (see Fig. 4 ): i) The King of Judah: mentioned in ostracon 24 as dictating the overall military strategy ii) An unnamed military commander: the author of ostracon 24 iii) Malkiyahu, the commander of the Arad fortress: mentioned in ostracon 24 and the recipient of ostracon 40 § iv) Eliashib, the quartermaster of the Arad fortress: the addressee of ostraca 1-16 and 18; mentioned in ostracon 17a; the writer of ostracon 31 v) Eliashib's subordinate: addressing Eliashib as "my lord" in ostracon 18 Following this reconstruction, it is reasonable to deduce the proliferation of literacy among the Judahite army ranks ca. 600 BCE. A contending claim that the ostraca were written by professional scribes can be dismissed with two arguments: the existence of two distinct writers in the tiny fortress of Arad (authors of ostraca 31 and 39) and the textual content of the inscriptions: Ostracon 1 orders the recipient (Eliashib) "write the name of the day," ostracon 7 commands "and write it before you. . .," and in ostracon 40 (reconstructions in refs. 6 and 18) the author mentions that he had written the letter. Thus, rather than implying the existence of scribes accompanying every Judahite official, the written evidence suggests a high degree of literacy in the entire Judahite chain of command. The dissemination of writing within the Judahite army around 600 BCE is also confirmed by the existence of other militaryrelated corpora of ostraca, at Horvat 'Uza (19) and Tel Malh . ata (20) in the vicinity of Arad, and at Lachish { in the Shephelah (summary in ref. 3)-all located on the borders of Judah (Fig. 1) . We assume that in all these locations the situation was similar to Arad, with even the most mundane orders written down occasionally. In other words, the entire army apparatus, from highranking officials to humble vice-quartermasters of small desert outposts far from the center, was literate, in the sense of the ability to communicate in writing. To support this bureaucratic apparatus, an appropriate educational system must have existed in Judah at the end of the first Temple period (2, 21-23). Additional evidence supporting writing awareness by the lowest echelons of society seems to come from the Mez . ad Hashavyahu ostracon (24), which contains a complaint by a corvée worker against one of his overseers (most scholars agree that it was composed with the aid of a scribe). Extrapolating the minimum of six authors in 16 Arad ostraca to the entire Arad corpus, to the whole military system in the southern Judahite frontier, to military posts in other sectors of the kingdom, to central administration towns such as Lachish, and to We conjecture that the status of the officers who commanded the supplies to the Kittiyim (the Greek or Cypriot mercenary unit), who wrote ostraca 1-8 and 17a, was similar to that of Malkiyahu (the commander of the fortress at Arad), and in any case they were Eliashib's superiors. Also note that Gemaryahu and Nehemyahu (ostracon 40) are Malkiyahu's subordinates, whereas Hananyahu (author of ostracon 16, also mentioned in ostracon 3) is probably Eliashib's counterpart in Beer Sheba. The textual content of the ostraca also suggests differentiation between combatant and logistics-oriented officials (Fig. 4) The spread of literacy in late-monarchic Judah provides a possible stage setting for the compilation of literary works. True, biblical texts could have been written by a few and kept in seclusion in the Jerusalem Temple, and the illiterate populace could have been informed about them in public readings and verbal messages by these few (e.g., 2 Kings 23:2, referring to the period discussed here). However, widespread literacy offers a better background for the composition of ambitious works such as the Book of Deuteronomy and the history of Ancient Israel in the Books of Joshua to Kings (known as the Deuteronomistic History), which formed the platform for Judahite ideology and theology (e.g., ref. 25). Ideally, to deduce from literacy on the composition of literary (to differ from mundane) texts, we should have conducted comparative research on the centuries after the destruction of Jerusalem, a period when other biblical texts were written in both Jerusalem and Babylonia according to current textual research (e.g., refs. 1 and 26). However, in the Babylonian, Persian, and early Hellenistic periods, Jerusalem and the southern highlands show almost no evidence in the form of Hebrew inscriptions. In fact, not a single securely dated Hebrew inscription has been found in this territory for the period between 586 and ca. 350 BCE # -not an ostracon or a seal, a seal impression, or a bulla [the little that we know of this period is in Aramaic, the script of the newly present Persian empire (27)]. This should come as no surprise, because the destruction of Judah brought about the collapse of the kingdom's bureaucracy and deportation of many of the literati. Still, for the centuries between ca. 600 and 200 BCE, the tension between current biblical exegesis (arguing for massive composition of texts) and the negative archaeological evidence remains unresolved. This research was conducted on two datasets of written material. The main document assemblage was a corpus of 16 Hebrew ostraca inscriptions found at the Arad fortress (ca. 600 BCE). The research was performed on digital Table 1 . Comparison between different Arad ostraca A P ≤ 0.2, highlighted in red, indicates rejection of "single writer" hypothesis, hence accepting a "two different authors" alternative. Note that ostraca 17 and 39 contain writing on both sides of the sherd (marked as "a" and "b"). images of these inscriptions. A second dataset, used to validate the algorithm, contained handwriting samples collected from 18 present-day writers of Modern Hebrew. The aim of our main algorithm was to differentiate between writers in a given set of texts. This algorithm consisted of several stages. In the first step, character restoration, the image of the inscription was segmented into (often noisy) characters that were restored via a semiautomatic reconstruction procedure. The method was based on the representation of a character as a union of individual strokes that were treated independently and later recombined. The purpose of stroke restoration was to imitate a reed pen's movement using several manually sampled key points. An optimization of the pen's trajectory was performed for all intermediate sampled points. The restoration was conducted via the minimization of image energy functional, which took into account the adherence to the original image, the smoothness of the stroke, as well as certain properties of the reed radius. The minimization problem was solved by performing gradient descent iterations on a cubic-spline representation of the stroke. The end product of the reconstruction was a binary image of the character, incorporating all its strokes (see Figs. S1 and S2) . The second stage of the algorithm, letter comparison, relied on features extracted from the characters' binary images, used to automatically compare characters from different texts. Several features were adapted, referring to aspects such as the character's overall shape, the angles between strokes, the character's center of gravity, as well as its horizontal and vertical projections. The features in use were SIFT (28), Zernike (29), DCT, K d -tree (30), Image projections (31), L 1 , and CMI (32). Additionally, for each feature, a respective distance was defined. Later on, all these distances were combined into a single, generalized feature vector. This vector described each character by the degree of its proximity to all of the characters, using all of the features. Finally, a distance between any two characters was calculated according to the Euclidean distance between their generalized feature vectors (see Table  S1 for details concerning various features in use). The final stage of the algorithm addressed the main question, What is the probability that two given texts were written by the same author? This was achieved by posing an alternative null hypothesis H 0 ("both texts were written by the same author") and attempting to reject it by conducting a relevant experiment. If its outcome was unlikely (P ≤ 0.2), we rejected the H 0 and concluded that the documents were written by two individuals. Alternatively, if the occurrence of H 0 was probable (P > 0.2), we remained agnostic. The experiment testing the H 0 performed a clustering on a set of letters from the two tested inscriptions (of specific type, e.g., alep jj ), disregarding their affiliation to either of the inscriptions. The clustering results should have resembled the original inscriptions if two different writers were present, while being random if this was not the case. Although this kind of test could have been performed on one specific letter, we could gain additional statistical significance if several different letters (e.g., alep, he, waw, etc.) were present in the compared documents. Subsequently, several independent experiments were conducted (one for each letter), and their P values were combined via the well-established Fisher's method (33). The combination represented the probability that H 0 was true based on all of the evidence at our disposal (see Fig. S3 for an illustration of the procedure's flow). See Supporting Information for additional details regarding the methods in use and their results on both Ancient and Modern Hebrew datasets (available at www-nuclear.tau.ac.il/∼eip/ostraca/DataSets/Arad_Ancient_Hebrew.zip and www-nuclear.tau.ac.il/∼eip/ostraca/DataSets/Modern_Hebrew.zip, respectively). In particular, see Figs. S4 and S5 for samples taken from Modern and Ancient Hebrew datasets, respectively. Additionally, Table S2 summarizes the results of the Modern Hebrew experiment, while Table S3 provides , bet, gimel, dalet, he, vav, zayin, het, tet, yod, kaf, lamed, mem, nun, samekh, ayin, pe, tsadi, qof, resh, shin, tav
Faigenbaum et al. used novel image processing and machine learning algorithms for authorship detection REF .
Algorithmic handwriting analysis of Judah's military correspondence sheds light on composition of biblical texts.
Proceedings of the National Academy of Sciences of the United States of America
Proceedings of the National Academy of Sciences of the United States of America
Geography Medicine