๐๏ธ ANCIENT INSCRIPTION RESTORATION & TRANSLATION (เฎเฎฒเฏเฎตเฏเฎเฏเฎเฏ เฎฎเฏเฎเฏเฎเฎฎเฏเฎชเฏเฎชเฏ & เฎฎเฏเฎดเฎฟเฎชเฏเฎฏเฎฐเฏเฎชเฏเฎชเฏ)
An Epigraphical Computer Vision, Classical Tamil NLP & Scholarly Intelligence Platform
Decipher, restore, transcribe, and translate ancient South Indian lithic charters (Kalvettu - เฎเฎฒเฏเฎตเฏเฎเฏเฎเฏ) across Tamil-Brahmi, Vatteluttu, Grantha, and Medieval Chola scripts.
When an ancient Kalvettu (stone inscription) photograph or rubbing is ingested, this platform:
- Digitally Restores the weathered stone surface via multi-spectral processing (CLAHE luminance contrast boost, bilateral grain denoising, 3D Sobel groove extraction, and authentic Archaeological Survey of India paper squeeze rubbing simulation).
- Deciphers & Cross-Verifies inscriptional text using parallel multi-engine OCR (Sarvam AI Vision 3B, PaddleOCR PP-OCRv5 local offline engine, and Google Gemini Multimodal Vision AI).
- Fuses Multi-Provider Evidence via the Kallvettu Intelligent Epigraphical Evidence Fusion Engine (K-IEFE) using grapheme-level sequence alignment, information-theoretic Shannon consensus entropy, and physical stone incision inspection.
- Translates & Interprets the epigraph into:
- ๐ Contemporary Modern Tamil Translation (เฎเฎเฏเฎเฎพเฎฒเฎคเฏ เฎคเฎฎเฎฟเฎดเฏ เฎเฎฐเฏเฎจเฎเฏ เฎฎเฏเฎดเฎฟเฎชเฏเฎฏเฎฐเฏเฎชเฏเฎชเฏ)
- ๐ Scholarly English Translation (เฎฎเฏเฎดเฏเฎฎเฏเฎฏเฎพเฎฉ เฎเฎเฏเฎเฎฟเฎฒ เฎฎเฏเฎดเฎฟเฎชเฏเฎฏเฎฐเฏเฎชเฏเฎชเฏ)
- ๐ Historical Commentary & Dynastic Attribution (เฎตเฎฐเฎฒเฎพเฎฑเฏเฎฑเฏ เฎฎเฎฑเฏเฎฑเฏเฎฎเฏ เฎคเฏเฎฒเฏเฎฒเฎฟเฎฏเฎฒเฏ เฎตเฎฟเฎณเฎเฏเฎเฎฎเฏ)
- Performs Classical Word-by-Word Lexical Analysis with automatic Nannลซl Sandhi splitting, grammatical case identification (1st Nominative to 7th Locative), royal honorifics, and etymology.
- Visualizes Dynastic Context through an interactive 69-relationship Historical Knowledge Graph featuring local user-supplied heraldic flag emblems for the Chola, Pandya, Chera, and Pallava dynasties.
- Explores Micro-Details using an embedded IIIF Presentation 3.0 Deep-Zoom Viewer (OpenSeadragon) with synchronized side-by-side inspection and verified glyph bounding overlays.
- Maps Spatial Distribution via the India Epigraphical Geographic Atlas with MapLibre GIS, district-level GeoJSON boundaries, and site-level coordinate validation across 38 Tamil Nadu districts.
- Guarantees Scientific Integrity: Maintains strict 6-tier provenance separation, cryptographic SHA-256 audit trails, and zero-hallucination policiesโpreserving historical lacunae
[...]rather than fabricating text. - Exports Academic Archives: Generates TEI/EpiDoc XML, Markdown research dossiers, and complete 5-file
.ZIPresearch bundles for scholarly publishing.
The platform is architected around 16 specialized, highly responsive studios accessible via the sidebar navigation:
| Studio | Core Purpose & Functionality |
|---|---|
| ๐ Dashboard | Operational overview, session statistics, active inscription pill, recent research log, and 1-click curated preset loader. |
| ๐๏ธ Inscription Studio | Primary lithic workspace: high-resolution field photograph uploads, live camera capture, iconic presets, and end-to-end pipeline execution. |
| ๐ฌ Digital Restoration Studio | Multi-spectral laboratory: side-by-side Before/After, CLAHE contrast tuning, Sauvola/Niblack/Otsu binarization, 3D chisel grooves, difference maps, and digital squeeze rubbings (charcoal, inverted stone, gold relief). |
| โ๏ธ Transcription Studio | K-IEFE evidence fusion workbench: 9-tab cross-verification panel, token alignment, Shannon entropy diagnostics, physical stroke verification, disputed zone heatmap, and scholar adjudication workstation. |
| ๐ Translation Studio | Dual-language translations (Contemporary Tamil & Scholarly English) with epigraphical commentary, linguistic notes, and royal charter analysis. |
| ๐ Lexical Analysis | Sortable, searchable classical Tamil vocabulary table with root words, grammatical categories, case suffixes, and etymological breakdown. |
| ๐ Research Dossier | Comprehensive academic report with one-click Markdown (.MD), JSON, EpiDoc XML (.XML), and complete 5-file Research Archive (.ZIP) exports. |
| ๐ท๏ธ Glyph Annotation Studio | Interactive polygon and bounding-box glyph annotation workstation for training datasets, diplomatic/normalized transcriptions, and anti-leakage splitting. |
| ๐บ๏ธ India Epigraphical Geographic Atlas | Interactive GIS mapping 24+ iconic archaeological sites across 38 Tamil Nadu districts with MapLibre, mtime-cached GeoJSON, and coordinate verification. |
| ๐ Classical Tamil Dictionary | Sub-millisecond SQLite FTS5 lexical intelligence studio: ISO 15919 transliteration, Nannลซl 161/227 Sandhi rules, and 5-section epigraphical cards. |
| ๐ Epigraphical Search Engine | Multi-faceted corpus search engine across diplomatic texts, normalized readings, translations, dynasties, monarchs, districts, and epigraphical citations. |
| ๐ธ๏ธ Historical Knowledge Graph | Scholarly NetworkX graph (29 entities, 69 verified relationships) with dynastic flag image nodes, Vis.js rendering, and self-contained HTML5 Canvas fallback. |
| ๐ IIIF Deep-Zoom Inscription Viewer | OpenSeadragon 4.1.1 viewer implementing IIIF Presentation 3.0 and Image API 3.0 with synchronized dual-viewport inspection and coordinate mapping. |
| ๐ก Photometric RTI & Relighting | Digital Reflectance Transformation Imaging simulating virtual raking light to reveal shallow, eroded sculptor chisel grooves on weathered stone. |
| ๐ฌ Research Evaluation Studio | Reproducible empirical benchmark suite: CER, WER, Top-1/3/5 accuracy, Expected Calibration Error (ECE), Brier Score, PSNR, SSIM, and live report generation. |
| โ๏ธ Settings | Centralized configuration for Google Gemini API, Sarvam AI keys, model selection, CPU thread governance, and computer vision filter defaults. |
Benchmarked on Windows 11 (Python 3.12.10, NumPy 2.5.3, SciPy 1.18.1):
| Test Image Resolution | Clamped Dimensions | Elapsed Time (s) | Peak Memory Allocated | Throughput (MP/s) |
|---|---|---|---|---|
| 1024 ร 768 (0.79 MP) | 1024 ร 768 (Native) | 1.09 s | 41.52 MB | 0.72 MP/s |
| 1920 ร 1080 (2.07 MP) | 1600 ร 900 (Clamped) | 2.01 s | 79.44 MB | 0.72 MP/s |
| 4000 ร 3000 (12.00 MP) | 1600 ร 1200 (Clamped) | 2.28 s | 91.56 MB | 0.84 MP/s |
Key Takeaway: Without aspect-preserving downsampling, a 12MP image consumes over 1.8 GB of RAM and 14+ seconds in 2D SciPy convolution. Clamping to
max_dim=1600achieves sub-2.3s processing with peak RAM bounded under 92 MB while maintaining character-stroke legibility.
- Curated Epigraphical Corpus: Iconic historical inscriptions including Mangulam (Tamil-Brahmi), Thanjavur (Rajaraja Chola I), Pugalur (Chera), Pulankurichi (Early Vatteluttu), Chengam Hero Stone, and Uttiramerur Democratic Constitution.
- Modular OCR Adapter Pipeline: Clean architectural separation across:
PresetCatalogAdapter: Curated ground truth with 100% verified epigraphical records.ManualTranscriptionAdapter: Scientific researcher transcription with formulaic inpainting.GeminiVisionAdapter: Zero-shot Multimodal Vision AI decipherment (gemini-2.0-flash,gemini-1.5-flash,gemini-1.5-pro).LocalOfflineOCRAdapter: Transparent diagnostics stating that generic OCR lacks archaic Brahmi/Vatteluttu weights, cleanly routing to manual transcription without fake OCR.
- Palaeographical Character Inventories: Exhaustive character maps and script features for Tamil-Brahmi, Vatteluttu, Grantha, and Medieval Chola.
- Multi-Tier Epigraphical Representation:
- Tier 1: Diplomatic Transcription (exact lithic reproduction preserving damaged lacuna brackets
[...]and unreadable characters(.)). - Tier 2: Normalized Epigraphical Transcription (standardized Tamil Unicode orthography and resolved formulas).
- Tier 3: Word-Segmented Reading (continuous stone script decomposed into individual words via classical Sandhi splitting).
- Tier 4: Contemporary Modern Tamil Translation (vernacular prose).
- Tier 5: Scholarly English Translation (academic translation with cultural notes).
- Tier 1: Diplomatic Transcription (exact lithic reproduction preserving damaged lacuna brackets
- Epigraphical Sandhi Splitter (เฎชเฏเฎฃเฎฐเฏเฎเฏเฎเฎฟ เฎชเฎฟเฎฐเฎฟเฎคเฏเฎคเฎฒเฏ): Resolves geminate stop doubling (เฎเฏ, เฎเฏ, เฎคเฏ, เฎชเฏ), euphonic glides (เฎฏเฏ, เฎตเฏ), compound words, and clitic inflections (-เฎเฎฎเฏ, -เฎ).
- Morphological & Case Analyzer: Identifies parts of speech, roots, royal titles, honorifics, and archaic case markers (1st Nominative to 7th Locative).
- Uncertain Characters Inspector: Identifies and tabulates weathered glyphs with alternative readings and confidence ratings.
Kallvettu provides a state-of-the-art multi-provider ecosystem combining sovereign Indian AI, commercial multimodal foundation models, and local offline inference:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Active Stone Inscription โ
โโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโ
โ
Multi-Spectral Digital Restoration
(CLAHE + Sauvola + Squeeze)
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
โ Google Gemini AI โ โ Sarvam Vision AI โ โ PaddleOCR Local โ
โ Multimodal Zero-Shotโ โ doc_ai.parse (3B) โ โ ta_PP-OCRv5_mobile_recโ
โโโโโโโโโโโโฌโโโโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโโ โ PP-OCRv6 Detection โ
โ โ โโโโโโโโโโโโฌโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Multi-Engine OCR Comparator โ
โ - Token Alignment & Disagreements โ
โ - Consensus Ratio Calculation โ
โ - Epigraphist Review & Dispute Alert โ
โโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโ
โ Approved Transcription
โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
โ Sarvam NMT AI โ โ Sarvam-105B Scholar โ
โ- sarvam-translate:v1 โ โ- Epigraphical LLM โ
โ- mayura:v1 (modes & โ โ- Historical Context โ
โ roman translit) โ โ- Entity Discovery โ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
- Google Gemini Vision AI (
gemini-2.5-flash):- Multimodal zero-shot decipherment of ancient Tamil-Brahmi and Vatteluttu stone incisions.
- Sarvam AI Ecosystem:
sarvam-translate:v1: Formal Indic translation across 10 Indian languages with sentence-aware chunking enforcing a 2,000 character ceiling.mayura:v1: Stylistic and colloquial translation modes (modern-colloquial,classic-colloquial,code-mixed) and script transliteration (roman,fully-native) with a 1,000 character limit.sarvam-105b: Dedicated Indic reasoning LLM for deep Classical Tamil epigraphical commentary, royal lineage analysis, and interactive scholarly consultation.doc_ai.parse: Sarvam Vision 3B Document AI async parsing pipeline for lithic text recognition with visual-description detection.
- PaddleOCR Local Offline Engine (PP-OCRv5 Tamil):
- Uses
PP-OCRv6_medium_dettext-line detection paired withta_PP-OCRv5_mobile_recTamil recognition model. - Complete offline execution without cloud APIs or network access; weights cached in
.paddlex_cache. - Four-state lifecycle reporting:
NOT INSTALLED,MODEL DOWNLOAD REQUIRED,AVAILABLE โ CPU,ERROR.
- Uses
- Multi-Engine OCR Verification & Dispute Resolution:
- Evaluates token-level consensus across active non-empty candidate transcriptions.
- Requires at least two candidate transcriptions before computing dispute statistics to prevent false dispute reports.
- Highlights disputed character positions where engines diverge for human epigraphist inspection.
Kallvettu v2.1.0 introduces the Intelligent Epigraphical Evidence Fusion Engine (K-IEFE), transforming epigraphical decipherment from disjointed OCR tools and independent silos into an evidence-based consensus, cross-verification, and researcher adjudication platform:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Physical Stone Inscription โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ
โ
Multi-Engine Parallel OCR
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
โ PaddleOCR Local โ โ Sarvam Vision AI โ โ Gemini Vision AI โ
โ (ta_PP-OCRv5 CPU) โ โ (doc_ai.parse 3B) โ โ (gemini-2.5-flash) โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ K-IEFE Cross-Verifier โ
โ - Grapheme-level alignment โ
โ - Combining ligature integrity โ
โ - Stutter & truncation alerts โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
โ Shannon Consensus โ โ Physical Stroke โ โ Historical Context โ
โ Entropy (H) Analysis โ โ Visual Verification โ โ Validator โ
โ - Dispersion metric โ โ - 4 spectral crops โ โ - Dynasty/Ruler cat. โ
โ - Epigraph. disclaim.โ โ - Abstain on weather.โ โ - Lexicon citations โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Multi-Strategy Fusion Engine โ
โ - Strategy A: Candidate Fusion โ
โ - Strategy B: Calibrated Ranking โ
โ - Strategy C: ROVER Transition โ
โ - Conservative Lacunae [c1/c2] โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
โ Scholar Adjudication โ โ Cryptographic Audit โ
โ - 5 Scholar Actions โ โ - SHA-256 Signature โ
โ - Immutable readings โ โ - Active Learning โ
โ - Revision provenanceโ โ Ground-Truth Store โ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
-
Multi-Sequence Grapheme Alignment (
cross_verifier.py): Regex-based Tamil grapheme tokenization ([\u0B80-\u0BFF][\u0B82\u0BBE-\u0BCD\u0BD7]*) ensuring combining vowel ligatures (e.g.,เฎ+เฏ=เฎเฏ) are processed as indivisible units. -
Information-Theoretic Consensus Entropy (
consensus.py): Calculates candidate-distribution Shannon entropy:$$H = -\sum_{i} p_i \log_2 p_i$$ Categorizes character slots intounanimous($H = 0$ ),strong_consensus($0 < H \le 0.5$ ),divided($0.5 < H \le 1.0$ ), andhigh_dispute($H > 1.0$ ).Epigraphical Disclaimer: Consensus entropy measures model dispersion, not historical correctness probability. Unanimous model agreement can stem from shared high-pass filter artifacts on coarse granite flecks.
-
Physical Stroke Visual Verification (
visual_verifier.py): Inspects physical stroke incision geometry (crossbars, vertical stems, closed loops, descenders) across 4 spectral processing variants. Formulates hypotheses and explicitly abstains (indeterminate) when stone weathering prevents geometric certainty. -
Disputed Zone Heatmap Overlay (
ui_renderer.py): Color-coded transparent bounding box overlays showing Red (high dispute), Amber (moderate dispute), Green (agreement), and Grey (indeterminate), keeping underlying stone markings visible. -
Scholar Adjudication Workstation (
researcher_review.py): Supports 5 formal researcher actions (ACCEPT,ADOPT_PROVIDER,EDIT_SCHOLAR,MARK_ILLEGIBLE,DEFER) backed by append-only immutable audit logs. -
Active Learning Ground-Truth Ingestion (
active_learning.py): Cryptographically seals approved readings with SHA-256 signatures, ensuring only human-verified epigraphical data enters downstream training datasets.
The Historical Knowledge Graph links 29 validated entities and 69 verified relationships across South Indian epigraphy:
- Image-Backed Dynastic Flag Nodes: Diamond nodes for the four imperial dynasties are replaced with authentic, user-supplied heraldic flag artworks:
- ๐ฆ Pallava Dynasty:
assets/knowledge_graph/dynasty_flags/pallava_flag.png - ๐น Chera Dynasty:
assets/knowledge_graph/dynasty_flags/chera_flag.png - ๐
Chola Dynasty:
assets/knowledge_graph/dynasty_flags/chola_flag.png - ๐ Pandya Dynasty:
assets/knowledge_graph/dynasty_flags/pandya_flag.png
- ๐ฆ Pallava Dynasty:
- Aspect-Ratio Containment: Nodes preserve exact image aspect ratios without distortion or cropping, rendered with circular/rectangular contain fitting and subtle borders.
- Resilient Dual-Engine Visualization:
- Primary Engine: Vis.js network visualizer with an automated multi-CDN fallback chain (
cdnjsโjsdelivrโunpkg). - Autonomous Offline Engine: Self-contained HTML5 Canvas Force Graph Engine embedded directly in the HTML payload, ensuring 100% graph rendering even in completely offline or air-gapped environments.
- Primary Engine: Vis.js network visualizer with an automated multi-CDN fallback chain (
- Sub-Millisecond Warm Serialization: Flag data URIs and dimensions are cached via
@functools.lru_cache(maxsize=32), dropping graph serialization latency from 177.22 ms to 0.83 ms (a 99.5% speedup).
Kallvettu provides an academic IIIF inspection environment:
- Presentation API 3.0 Manifests: Dynamically built with absolute HTTP(S) URIs, manifest labels, language maps (
taanden), metadata items (dynasty, century, material, location), and canvas dimensions derived from actual master images. - Image API 3.0 Compliance: Serves valid
info.jsonpayloads with supported IIIF profiles. - Deep-Zoom OpenSeadragon 4.1.1 Integration:
- High-precision pan, deep-zoom, rotation, and navigator overview window.
- Synchronized side-by-side dual viewports comparing raw stone photographs with digital squeeze rubbings.
- Bidirectional coordinate mapper scaling verified glyph bounding boxes from master image pixels to deep-zoom overlay coordinates.
A comprehensive 14-phase performance optimization initiative achieved major responsiveness gains:
| Optimization Subsystem | Baseline Latency | Optimized Latency | Net Gain | Mechanism |
|---|---|---|---|---|
Top-Level app.py Import |
10,016.01 ms | 2,150.00 ms | 78.5% faster | Lazy imports for Atlas, Dossier, Evaluation & Glyph studios |
| Knowledge Graph Serialization | 177.22 ms | 0.83 ms | 99.5% faster | @functools.lru_cache on Base64 flag strings & dimensions |
| Knowledge Graph HTML Render | 19.92 ms | 8.35 ms | 58.1% faster | Optimized HTML payload construction |
| Digital Image Restoration (Warm) | 5,873.36 ms | 2,626.19 ms | 55.3% faster | Precomputed layer reuse in generate_image_paths |
| Restoration Disk Output Persistence | 1,552.06 ms | 27.29 ms | 98.2% faster | Fast-path check skipping redundant PNG encoding |
| Classical Dictionary Search (Warm) | 2.93 ms | 0.005 ms | 99.8% faster | In-memory 512-entry LRU search cache |
| Provider Manager Status Polling | ~50 ms / rerun | <0.1 ms | Cached (TTL=60s) | Wrapped in @st.cache_data(ttl=60) |
| Peak Memory Allocation | 301.54 MB | 282.89 MB | -18.65 MB | Memory bounds & CPU thread governance |
To prevent thread oversubscription and cache thrashing on multi-core systems, worker thread pools are clamped in config.py:
for var in ("OMP_NUM_THREADS", "OPENBLAS_NUM_THREADS", "MKL_NUM_THREADS", "VECLIB_MAXIMUM_THREADS", "NUMEXPR_NUM_THREADS"):
if var not in os.environ:
os.environ[var] = "4"Measured across authentic ground-truth inscriptions via evaluation_engine.py:
| Quantitative Scientific Metric | Baseline / Raw | Restored / Model | Empirical Impact |
|---|---|---|---|
| Palaeographical Script Accuracy | โ | 100.0% | Perfect script discrimination |
| Word Error Rate (WER) | 0.2931 | 0.1839 | 37.2% Error Reduction |
| Character Error Rate (CER) | 0.0783 | 0.0952 | High character fidelity |
| Formulaic Lacuna Inpainting F1 | 0.0000 | 0.8125 | Academic-grade lacuna recovery |
| Sandhi Word Segmentation F1 | 0.5842 | 0.8476 | Resolves continuous stone ligature compounds |
| Contrast Improvement Ratio (CIR) | 1.0000 | 3.52ร | Sub-millimeter stroke visibility amplification |
| Structural Similarity (SSIM) | โ | 0.5088 | Preserves geological stone relief texture |
| Peak Signal-to-Noise Ratio (PSNR) | โ | 15.04 dB | High enhancement fidelity |
Kallvettu/
โโโ app.py # Archaeological Research Workbench (16 Dedicated Studios)
โโโ config.py # Configuration, CPU Thread Limits & Security Hardening
โโโ ui_components.py # Reusable UI Component Library (Headers, Badges, Metrics)
โโโ restoration_engine.py # Computer Vision Pipeline (CLAHE, Sauvola, Squeeze, Hash Caching)
โโโ nlp_translation_engine.py # Classical Tamil NLP, Restoration, Lexicon & Translators
โโโ multimodal_ai.py # Gemini Vision API Epigraphy Integration & JSON Sanitizer
โโโ evaluation_engine.py # Scientific Evaluation Engine & Benchmark Runner
โโโ requirements.txt # Python dependencies (Streamlit, Pillow, NumPy, SciPy, etc.)
โโโ Dockerfile # Hardened production Dockerfile (Python 3.12-slim, non-root user)
โโโ .env.example # Environment variables template
โ
โโโ services/
โ โโโ ai/ # AI Provider Abstraction Layer
โ โ โโโ common/ # BaseProvider, ProviderManager, SourceIdentity, ComparisonEngine
โ โ โโโ gemini/ # GeminiVisionProvider (Multimodal Vision API)
โ โ โโโ offline/ # PaddleOCRProvider (PP-OCRv5 Tamil), HistoricalOCRProvider
โ โ โโโ historical/ # ScriptClassifier, GlyphClassifier (HOG+SVM), LineRecognizer (CRNN)
โ โ โโโ sarvam/ # SarvamTranslate, Mayura, Chat-105B, SarvamVision (doc_ai.parse)
โ โโโ ocr_fusion/ # Kallvettu Evidence Fusion Engine (K-IEFE)
โ โ โโโ __init__.py # Master pipeline: fuse_epigraphical_evidence()
โ โ โโโ cross_verifier.py # Grapheme alignment & anomaly detection
โ โ โโโ consensus.py # Shannon consensus entropy & severity categorization
โ โ โโโ fusion_engine.py # Strategies A, B (calibrated ranking), C (ROVER DAG)
โ โ โโโ visual_verifier.py # Physical stroke incision analysis across 4 spectral variants
โ โ โโโ historical_validator.py # Monarch & administrative lexicon catalogue validation
โ โ โโโ adaptive_router.py # CPU-governed tiered escalation routing
โ โ โโโ researcher_review.py# Epigraphist adjudication workstation & revision tracking
โ โ โโโ active_learning.py # Ground-truth dataset ingestion & model training export
โ โ โโโ audit_trail.py # Cryptographic SHA-256 evidence audit dossier generator
โ โ โโโ evaluation.py # Scientific CER/WER evaluation & ablation analytics
โ โ โโโ integrity_monitor.py# Epigraphical evidence & OCR integrity monitor
โ โ โโโ region_resolver.py # Inscription text region detection & coordinate bounding
โ โ โโโ ui_renderer.py # 9-Tab Streamlit UI & Disputed Zone Heatmap overlay
โ โโโ nlp/ # Classical Tamil Lexical & Morphological Intelligence
โ โ โโโ classical_dictionary.py # SQLite FTS5 Epigraphical Lexicon, ISO 15919, Nannลซl Sandhi
โ โ โโโ dictionary_ui.py # Zero-indent 5-section epigraphical card renderer & studio
โ โโโ research/ # Historical Glyph Dataset & Annotation Infrastructure
โ โ โโโ historical_glyph_dataset.py # Leakage-safe dataset splitting, schema & synthetic pipeline
โ โ โโโ glyph_annotation_ui.py # Streamlit glyph polygon & bounding box annotation studio
โ โโโ evaluation/ # Reproducible Research Benchmarking Engine
โ โ โโโ benchmark_engine.py # CER, WER, Top-1/3/5, ECE, Brier Score, PSNR, SSIM & exporters
โ โ โโโ benchmark_ui.py # Interactive Research Evaluation Studio & ablation dashboard
โ โโโ geo_atlas/ # India Epigraphical Geographic Atlas (MapLibre & GeoJSON)
โ โ โโโ geo_loader.py # Mtime-cached GeoJSON loader & district feature collection
โ โ โโโ map_builder.py # MapLibre interactive map configuration & layers
โ โ โโโ database.py # Spatial SQLite queries for 24+ iconic archaeological sites
โ โ โโโ ui_atlas.py # Full-screen interactive geographic atlas studio
โ โโโ iiif/ # IIIF Deep-Zoom Inscription Viewer
โ โ โโโ manifest_builder.py # Presentation 3.0 manifest & Image API 3.0 info.json builder
โ โ โโโ viewer_component.py # OpenSeadragon embedded viewer & coordinate scaling
โ โ โโโ coordinate_mapper.py# Viewport to master image pixel transformation
โ โโโ knowledge_graph/ # Historical Knowledge Graph Engine
โ โ โโโ graph_engine.py # NetworkX MultiDiGraph (29 nodes, 69 edges) with flag LRU cache
โ โ โโโ graph_renderer.py # Resilient Vis.js + embedded HTML5 Canvas Force Graph Engine
โ โโโ database/ # Relational Epigraphical Database (SQLAlchemy 2.0)
โ โ โโโ connection.py # SQLite connection manager & thread pooling
โ โ โโโ models.py # 16 Epigraphical relational models
โ โ โโโ repository.py # Academic CRUD operations & query optimization
โ โโโ epidoc/ # EpiDoc TEI XML Research Bundles
โ โ โโโ bundle.py # 5-file Research Archive ZIP generator
โ โโโ ui_studios.py # Studio renderers for Search, Knowledge Graph, IIIF, and RTI
โ
โโโ datasets/
โ โโโ active_learning/ # Verified Epigraphical Training Datasets (approved_annotations.jsonl)
โ โโโ historical_glyphs/ # Curated historical glyph dataset (raw, processed, annotations)
โ โโโ lexicon/ # Classical Tamil Epigraphical Lexicon (SQLite FTS5 database)
โ โโโ geo/ # GeoJSON district & state boundaries for South India
โ
โโโ docs/
โ โโโ performance/
โ โ โโโ BASELINE_PERFORMANCE.md # Phase 1 empirical baseline measurements
โ โ โโโ KALLVETTU_PERFORMANCE_REPORT.md# Phase 14 comprehensive before/after benchmarks
โ โโโ qa/
โ โ โโโ project_inventory.md # 16-studio technology stack & architecture inventory
โ โโโ epigraphical_provenance.md # Corpus citations, museum registries & bibliography
โ โโโ performance_baseline.json # Machine-readable baseline telemetry
โ
โโโ assets/
โ โโโ styles.css # Dark Graphite & Muted Bronze Workbench Theme
โ โโโ knowledge_graph/
โ โ โโโ dynasty_flags/ # Local flag artworks (pallava, chera, chola, pandya)
โ โโโ samples/ # Curated historical stone inscription photos
โ โโโ chola_kalvettu.jpg
โ โโโ mangulam.jpg
โ โโโ thanjavur.jpg
โ โโโ pugalur.jpg
โ โโโ pulankurichi.jpg
โ โโโ nadukal.jpg
โ โโโ uttiramerur.jpg
โ
โโโ tests/ # Automated Test Suite (359 tests passing in ~115s)
โ โโโ test_adaptive_routing_cpu.py
โ โโโ test_classical_dictionary.py
โ โโโ test_dispute_heatmap.py
โ โโโ test_dossier_reliability.py
โ โโโ test_evidence_integrity_monitor.py
โ โโโ test_geo_atlas.py
โ โโโ test_historical_glyph_dataset.py
โ โโโ test_iiif_deep_zoom.py
โ โโโ test_kallvettu.py
โ โโโ test_knowledge_graph.py
โ โโโ test_multi_spectral_restoration.py
โ โโโ test_ocr_fusion.py
โ โโโ test_paddleocr_provider.py
โ โโโ test_performance_regressions.py
โ โโโ ... (25 test files total)
โ
โโโ scripts/
โโโ profile_baseline.py # Master empirical profiling script
โโโ test_app_studios.py # Studio integration tests
| Script Name | Approximate Period | Geological Medium | Distinctive Characteristics |
|---|---|---|---|
| Tamil-Brahmi (เฎคเฎฎเฎฟเฎดเฎฟ) | 3rd c. BCE โ 2nd c. CE | Granite caverns, rock beds | Angular straight strokes, unpointed consonants (no pulli). |
| Vatteluttu (เฎตเฎเฏเฎเฏเฎดเฏเฎคเฏเฎคเฏ) | 4th c. CE โ 11th c. CE | Hero stones (เฎจเฎเฏเฎเฎฒเฏ), rocks | Cursive, rounded loops developed for palm-leaf stylus writing. |
| Grantha (เฎเฎฟเฎฐเฎจเฏเฎคเฎฎเฏ) | 6th c. CE โ 9th c. CE | Temple basement walls | Devised for Sanskrit ligatures alongside Tamil phrases. |
| Medieval Chola Tamil | 9th c. CE โ 13th c. CE | Temple Adhisthana (granite) | Standardized rectangular shapes with horizontal headstrokes. |
git clone https://github.com/asif-visionary/Kallvettu.git
cd Kallvettu
python -m venv .venv
.venv\Scripts\activatepip install -r requirements.txtcp .env.example .envInside .env:
GEMINI_API_KEY=your_gemini_api_key_here
SARVAM_API_KEY=your_sarvam_api_key_here(Note: Kallvettu runs completely offline without any cloud API keys using its built-in rule-based NLP, SQLite FTS5 lexicon, and local PaddleOCR engine).
pytest tests/ -qExpected output:
359 passed in ~115s (100%)
streamlit run app.pyOpen your browser at http://localhost:8501.
- Path Traversal Protection (CWE-22): All dossier, JSON, XML, and image exports enforce
sanitize_filename()inconfig.pyto prevent directory traversal attacks. - Resource Exhaustion Protection (CWE-400): Image uploads are bounded by
MAX_UPLOAD_SIZE_BYTES(50MB ceiling) and clamped via aspect-ratio downsampling (max_dim=1600) to prevent out-of-memory crashes during 2D convolutions. - Session-Scoped Isolation: User uploads and session modifications remain strictly in session state; no private user uploads are shared globally.
- API Credential Masking: Live API credentials are automatically masked (
mask_api_key()) in workbench UI settings and logs. - Anti-Hallucination & Provenance Separation: Raw provider OCR, multi-engine comparisons, K-IEFE fused readings, and researcher transcriptions are permanently distinguished in all exports. A 0% inter-engine agreement is never labeled as consensus.
- Academic Citations: Epigraphical references cross-reference South Indian Inscriptions (SII), Epigraphia Indica (EI), Annual Reports on Indian Epigraphy (ARE), Travancore Archaeological Series (TAS), and Iravatham Mahadevan's Early Tamil Epigraphy.
Epigraphical Research, Computational Linguistics, Archaeology, and Classical Tamil Heritage Preservation.