Logo Lanfrica

Misiker101/amharic-handwriting-ocr-using-vit

Domain:

natural language processing

Record type:

projectsoftware
Creator:
Mis
Host:
Master's Thesis Project # Multi-Line Amharic Handwritten Document OCR Using Hybrid Vision Transformers (ViT) An end-to-end, high-performance Client-Server system designed for unconstrained Amharic handwritten text recognition. This project decouples heavy deep learning inference from mobile hardware by utilizing a lightweight mobile client for document acquisition and a GPU-accelerated server backend to execute layout segmentation and sequence transcription. ## πŸ›οΈ System Architecture Overview The system is structured into three discrete execution phases to optimize throughput and preserve mobile device battery efficiency: * **Frontend Acquisition (Flutter):** Captures documents via a specialized camera interface powered by `google_mlkit_document_scanner` which performs native border tracking, perspective deskewing, and contrast normalization. * **Layout Segmentation (FastAPI + Uvicorn):** Processes the image on the server using a **Hybrid A* Path-Planning algorithm** combined with an energy cost map (derived from a Distance Transform). The algorithm snakes dynamically between lines, safely bypassing overlapping ascenders and descenders and extracts isolated line images. * **Sequence Recognition (PyTorch + CUDA):** Leverages a customized **HybridViT** network architecture. A CNN front-end extracts highly detailed, localized spatial character features, which are then serialized and passed directly into a Core **Vision Transformer (ViT)** to model global context across the Ethiopic character sequence. Final strings are decoded using CTC Greedy Decoding. ## Repository Structure ``` lib/ β”œβ”€β”€ main.dart # entrypoint β”œβ”€β”€ app.dart # MaterialApp, theming β”œβ”€β”€ core/ β”‚ β”œβ”€β”€ theme/ # Material 3 light/dark theme, color tokens β”‚ β”œβ”€β”€ constants/ # endpoint paths, pref keys, default URL β”‚ └── utils/result_formatter.dart β”œβ”€β”€ models/ β”‚ β”œβ”€β”€ ocr_state.dart # OcrPhase enum (explicit state machine) β”‚ β”œβ”€β”€ ocr_model …