Image Classification
Transformers
Tibetan
tibetan
uchen
ume
script-classification
dinov3
fine-tuned
Eval Results (legacy)
Instructions to use openpecha/uchen-ume-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openpecha/uchen-ume-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="openpecha/uchen-ume-classifier") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("openpecha/uchen-ume-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
---
|
| 2 |
language:
|
| 3 |
- bo
|
|
|
|
| 4 |
library_name: transformers
|
| 5 |
tags:
|
| 6 |
- image-classification
|
|
@@ -10,7 +11,7 @@ tags:
|
|
| 10 |
- binary-classification
|
| 11 |
- vision
|
| 12 |
datasets:
|
| 13 |
-
- openpecha/
|
| 14 |
metrics:
|
| 15 |
- accuracy
|
| 16 |
- f1
|
|
@@ -18,31 +19,57 @@ metrics:
|
|
| 18 |
base_model: facebook/dinov3-vits16-pretrain-lvd1689m
|
| 19 |
---
|
| 20 |
|
| 21 |
-
#
|
| 22 |
|
| 23 |
-
This model is a fine-tuned version of **Meta's DINOv3-ViT-S/16** for binary classification of Tibetan scripts
|
| 24 |
|
| 25 |
-
##
|
| 26 |
-
|
| 27 |
-
### Model Description
|
| 28 |
-
|
| 29 |
-
The model was developed to provide a high-reliability baseline for separating formal block scripts (**Uchen**) from cursive script families (**Ume**). By focusing on global page geometry rather than local character patches, it achieves high accuracy on whole-page manuscript scans.
|
| 30 |
|
| 31 |
- **Project Name:** The BDRC Etext Corpus
|
| 32 |
- **Developed by:** Dharmaduta
|
| 33 |
- **Specifications provided by:** [Buddhist Digital Resource Center (BDRC)](https://www.bdrc.io)
|
| 34 |
- **Funded by:** Khyentse Foundation
|
| 35 |
- **Model type:** Vision Transformer (ViT)
|
| 36 |
-
- **
|
| 37 |
-
- **
|
| 38 |
-
|
| 39 |
-
##
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
- **Test Accuracy:** 98.95%
|
| 43 |
- **Macro F1-Score:** 0.984
|
| 44 |
- **AUC-ROC:** 0.9988
|
| 45 |
-
- **Best Training Configuration:** Stage B (Partial Backbone Unfreezing)
|
| 46 |
|
| 47 |
### Confusion Matrix
|
| 48 |
| Predicted \ Actual | Uchen | Ume |
|
|
@@ -50,33 +77,17 @@ The model achieved near-perfect discrimination during testing, specifically exce
|
|
| 50 |
| **Uchen** | 159 | 2 |
|
| 51 |
| **Ume** | 6 | 595 |
|
| 52 |
|
| 53 |
-
##
|
| 54 |
-
|
| 55 |
-
### Direct Use
|
| 56 |
-
|
| 57 |
-
This model is intended to be used as a **pre-processing filter** or **router** within the **BDRC Etext Corpus** pipeline. It can automatically sort large digital archives into Uchen or Ume categories to be processed by specialized downstream OCR engines.
|
| 58 |
-
|
| 59 |
-
### Out-of-Scope Use
|
| 60 |
-
|
| 61 |
-
- Classification of modern printed Tibetan fonts (untested).
|
| 62 |
-
- Recognition of non-Tibetan scripts (Sanskrit, Lantsa, etc.).
|
| 63 |
-
- Character-level recognition (OCR).
|
| 64 |
-
|
| 65 |
-
## Bias, Risks, and Limitations
|
| 66 |
-
|
| 67 |
-
The model was trained primarily on BDRC manuscript scans. It may struggle with:
|
| 68 |
-
- Extremely faint or damaged woodblock prints.
|
| 69 |
-
- Pages containing a roughly equal mix of both Uchen and Ume (Multi-script).
|
| 70 |
-
|
| 71 |
-
## How to Get Started with the Model
|
| 72 |
|
| 73 |
```python
|
| 74 |
from transformers import AutoImageProcessor, AutoModelForImageClassification
|
| 75 |
import torch
|
| 76 |
from PIL import Image
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|
|
|
|
|
|
|
| 80 |
|
| 81 |
image = Image.open("manuscript_page.jpg").convert("RGB")
|
| 82 |
inputs = processor(images=image, return_tensors="pt")
|
|
|
|
| 1 |
---
|
| 2 |
language:
|
| 3 |
- bo
|
| 4 |
+
license: apache-2.0
|
| 5 |
library_name: transformers
|
| 6 |
tags:
|
| 7 |
- image-classification
|
|
|
|
| 11 |
- binary-classification
|
| 12 |
- vision
|
| 13 |
datasets:
|
| 14 |
+
- openpecha/uchen-ume-classification-benchmark
|
| 15 |
metrics:
|
| 16 |
- accuracy
|
| 17 |
- f1
|
|
|
|
| 19 |
base_model: facebook/dinov3-vits16-pretrain-lvd1689m
|
| 20 |
---
|
| 21 |
|
| 22 |
+
# Tibetan Script Router (DINOv3-ViT-S)
|
| 23 |
|
| 24 |
+
This model is a fine-tuned version of **Meta's DINOv3-ViT-S/16** specifically designed for high-precision binary classification of Tibetan scripts. It acts as the primary "Router" in a hierarchical classification pipeline, distinguishing between formal block scripts (**Uchen**) and cursive families (**Ume**).
|
| 25 |
|
| 26 |
+
## Model Details
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
- **Project Name:** The BDRC Etext Corpus
|
| 29 |
- **Developed by:** Dharmaduta
|
| 30 |
- **Specifications provided by:** [Buddhist Digital Resource Center (BDRC)](https://www.bdrc.io)
|
| 31 |
- **Funded by:** Khyentse Foundation
|
| 32 |
- **Model type:** Vision Transformer (ViT)
|
| 33 |
+
- **License:** Apache 2.0
|
| 34 |
+
- **Fine-tuned from:** `facebook/dinov3-vits16-pretrain-lvd1689m`
|
| 35 |
+
|
| 36 |
+
## 📊 Dataset & Class Distribution
|
| 37 |
+
|
| 38 |
+
The model was trained using the [openpecha/uchen-ume-classification](https://huggingface.co/datasets/openpecha/uchen-ume-classification) dataset. This training set consists of **4,572 images** balanced across two major categories.
|
| 39 |
+
|
| 40 |
+
The binary classes were mapped from the following granular script types:
|
| 41 |
+
|
| 42 |
+
### 1. Uchen (Class 0) — 2,286 Total Samples
|
| 43 |
+
| Granular Script Type | Sample Count |
|
| 44 |
+
| :--- | :--- |
|
| 45 |
+
| `uchen_sugdring` | 1,670 |
|
| 46 |
+
| `uchen_sugthung` | 616 |
|
| 47 |
+
|
| 48 |
+
### 2. Ume (Class 1) — 2,286 Total Samples
|
| 49 |
+
| Granular Script Type | Sample Count |
|
| 50 |
+
| :--- | :--- |
|
| 51 |
+
| `petsuk` | 1,388 |
|
| 52 |
+
| `tsegdrig` | 749 |
|
| 53 |
+
| `peri` | 614 |
|
| 54 |
+
| `druthung` | 207 |
|
| 55 |
+
| `tsumachug` | 178 |
|
| 56 |
+
| `yigchung` | 166 |
|
| 57 |
+
| `drudring` | 132 |
|
| 58 |
+
| `drathung` | 129 |
|
| 59 |
+
| `druring` | 119 |
|
| 60 |
+
| `khyuyig` | 113 |
|
| 61 |
+
| `dhumri` | 98 |
|
| 62 |
+
| `tsugchung` | 77 |
|
| 63 |
+
| `trinyig` | 42 |
|
| 64 |
+
|
| 65 |
+
*Note: Classes labeled "Difficult," "Multi-script," and "Non-Tibetan" were excluded to maintain a clean training signal for the Uchen/Ume boundary.*
|
| 66 |
+
|
| 67 |
+
## 📈 Performance Summary
|
| 68 |
+
The model achieved its peak performance at **Stage B** (Partial backbone unfreezing of the last 2 blocks).
|
| 69 |
|
| 70 |
- **Test Accuracy:** 98.95%
|
| 71 |
- **Macro F1-Score:** 0.984
|
| 72 |
- **AUC-ROC:** 0.9988
|
|
|
|
| 73 |
|
| 74 |
### Confusion Matrix
|
| 75 |
| Predicted \ Actual | Uchen | Ume |
|
|
|
|
| 77 |
| **Uchen** | 159 | 2 |
|
| 78 |
| **Ume** | 6 | 595 |
|
| 79 |
|
| 80 |
+
## 🚀 How to Get Started
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
```python
|
| 83 |
from transformers import AutoImageProcessor, AutoModelForImageClassification
|
| 84 |
import torch
|
| 85 |
from PIL import Image
|
| 86 |
|
| 87 |
+
# Note: Gated access approval for DINOv3 is required
|
| 88 |
+
model_id = "openpecha/uchen-ume-classifier"
|
| 89 |
+
processor = AutoImageProcessor.from_pretrained(model_id)
|
| 90 |
+
model = AutoModelForImageClassification.from_pretrained(model_id)
|
| 91 |
|
| 92 |
image = Image.open("manuscript_page.jpg").convert("RGB")
|
| 93 |
inputs = processor(images=image, return_tensors="pt")
|