Instructions to use BDRC/gyuyig-tsugdri-binary-script-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BDRC/gyuyig-tsugdri-binary-script-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="BDRC/gyuyig-tsugdri-binary-script-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("BDRC/gyuyig-tsugdri-binary-script-classifier", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Gyuyig vs Tsugdri Binary Script Classifier (DINOv3 ViT-S)
Fine-tuned DINOv3 ViT-S for parent script classification:
Gyuyig, Tsugdri
Experiment: dinov3_gyuyig_tsugdri_sub_warmstart (gyuyig_tsugdri_binary_classification)
Pooling: ViT CLS token (last_hidden_state[:, 0, :])
Weights: final_model.pt (best validation macro-F1 across stages A/B/C)
Warm-start: BDRC/4-class-balanced-script-classifier (final_model.pt โ prior test acc 82.6%, macro-F1 0.833)
Data
| Split | Source |
|---|---|
| Train / val / test | BDRC/gyuyig-tsugdri-binary-balanced-script-classification-dataset |
Test split: balanced benchmark (60 images per parent class, held out of training).
Preprocessing
| Split | Mode | Size |
|---|---|---|
| train | resize_letterbox |
448 |
| val | resize_letterbox |
448 |
| test | resize_letterbox |
448 |
Validation metrics (n=60)
| Metric | Value |
|---|---|
| Accuracy | 85.0% |
| Macro F1 | 0.850 |
| Weighted F1 | 0.850 |
| AUC-ROC | 0.902 |
| Loss | 0.4520 |
Best checkpoint: best_stage_c_last_blocks.pt epoch 7 val macro-F1 0.850
Per-class (validation)
precision recall f1-score support
Gyuyig 0.89 0.80 0.84 30
Tsugdri 0.82 0.90 0.86 30
accuracy 0.85 60
macro avg 0.85 0.85 0.85 60
weighted avg 0.85 0.85 0.85 60
Test / benchmark metrics (n=120)
| Metric | Value |
|---|---|
| Accuracy | 80.8% |
| Macro F1 | 0.808 |
| Weighted F1 | 0.808 |
| AUC-ROC | 0.868 |
| Loss | 0.5354 |
Per-class (test)
precision recall f1-score support
Gyuyig 0.79 0.83 0.81 60
Tsugdri 0.82 0.78 0.80 60
accuracy 0.81 120
macro avg 0.81 0.81 0.81 120
weighted avg 0.81 0.81 0.81 120
Training
| Stage | Epochs | LR head | LR backbone | Unfrozen blocks |
|---|---|---|---|---|
| A | 7 | 0.0005 | โ | 0 |
| B | 10 | 0.0001 | 1e-05 | 4 |
| C | 12 | 5e-05 | 1.5e-05 | 8 |
| Setting | Value |
|---|---|
| Scheduler | cosine_warmup |
| Class weights | custom |
| Label smoothing | 0.05 |
| Dropout | 0.1 |
Confusion matrix (test)
| True \ Pred | Gyuyig | Tsugdri |
|---|---|---|
| Gyuyig | 50 | 10 |
| Tsugdri | 13 | 47 |
Files
| File | Description |
|---|---|
final_model.pt |
Best val-F1 weights + label maps |
results.json |
Full metrics, history, warm-start info |
config.yaml |
Training config |
model_card.json |
Summary metadata |
confusion_matrix.json / .png |
Test CM |
training_history.png |
Stage loss / val F1 curves |
split_stats.json / .md |
Per-class split counts |
inference.py |
Classify image paths |
requirements-inference.txt |
Pip deps |
Inference
pip install -r requirements-inference.txt
python inference.py --checkpoint final_model.pt --image path/to/page.jpg --preprocess resize_letterbox --preprocess-size 448
Reproduce training
python experiments/gyuyig-tsugdri/train.py --config experiments/gyuyig-tsugdri/config_warmstart.yaml
Model repo: BDRC/gyuyig-tsugdri-binary-script-classifier
- Downloads last month
- 5
Model tree for BDRC/gyuyig-tsugdri-binary-script-classifier
Base model
facebook/dinov3-vit7b16-pretrain-lvd1689m Finetuned
facebook/dinov3-vits16-pretrain-lvd1689m