Logo Lanfrica

daryne01/tifinagh-ocr

Domain:

natural language processing

Record type:

software
Creator:
dar
Host:
OCR for Tifinagh, the script used to write Amazigh — full page-to-character pipeline plus a benchmark of six architectures. MSc dissertation work at UWE Bristol. # Tifinagh OCR Optical character recognition for Tifinagh, the script used to write Amazigh (Berber) languages. Full pipeline from page image to character sequence, plus a benchmark of six architectures on the recognition step. Based on my MSc dissertation at UWE Bristol (Data Science, Distinction). The original work used a collected dataset of handwritten Tifinagh and Latin-Amazigh characters, which is not redistributed here; this version generates a synthetic dataset from the 33 letters of the IRCAM standard alphabet so the pipeline runs end to end for anyone who clones it. --- ## Why this script Amazigh is spoken by tens of millions of people across North Africa. Tifinagh is an official script in Morocco and Algeria, taught in schools and used on public signage. It has almost no OCR support: none of the general-purpose engines cover it, so the ordinary route from a scanned page to searchable text does not exist. That absence is the point. Digitising Amazigh text at any scale — archives, textbooks, signage, handwriting — needs a recogniser that does not yet exist in any usable form, and the low-resource setting shapes every decision in the project. Structurally, Tifinagh is unusually well suited to a classical OCR approach. Its letters are geometric, non-cursive and well separated, which makes segmentation tractable in a way that Arabic script, for instance, is not. ## Pipeline ``` page image │ ├─ binarise Gaussian blur + Otsu threshold, ink normalised to white ├─ deskew minimum-area-rectangle angle estimate, rotate ├─ find lines horizontal ink projection, grouped into bands ├─ segment characters connected components, ordered by line then x ├─ extract glyph square-padded crop, resized to 28×28 └─ classify CNN over 33 classes ``` ### The segmentation mistake, and the fix The original implementation used Tesseract to find character bounding boxes, then passed the crops to the CNN. That cannot work. Tesser …