Saltar al contenido
ModelPublicadoExterno
Descargar

Yolo Detect Khmer Math

State-of-the-art YOLOv8 model for detecting Khmer printed text lines and mathematical formulas across MoEYS textbooks and exam papers.

TipoOtherVersiónRevision 940548cBcalidad

Fuente del modelo

Tipo
Other
Tamaño del archivo
5,25–11,7 MB
Versión
vRevision 940548c
Actualizado
21 oct 2026
Descargas
723
Fuente
Hugging Face

Descripción de la fuente

YOLO Khmer Math and Text Line Detector (v5.0 - khmer_V3dectect)

State-of-the-art YOLOv8 model for detecting Khmer printed text lines and mathematical formulas across MoEYS textbooks and exam papers.


Highlights of the Model (v5.0 / khmer_V3dectect)

  • 96.78% mAP@50: Peak performance across all versions.
  • 81.96% mAP@50-95: High bounding box tightness and precision for text and formula cropping.
  • 93.33% Recall: Captures complex stacked formulas, sub/superscripts, fractions, and Khmer diacritics.
  • 94.89% Precision: Low false positives on empty document spaces or page margins.
  • Lightweight and Fast: Compact model (~6.2 MB PyTorch .pt, ~11.7 MB ONNX .onnx) optimized for edge and web execution.

Model Checkpoints and Download Links

Checkpoint NameVersionFormatKey MetricsDirect Download Link
best.ptv5.0 (Default Latest).pt (~6.2 MB)mAP50: 96.78% | mAP50-95: 81.96% | Recall: 93.33%Download best.pt
best.onnxv5.0 (ONNX Runtime).onnx (~11.7 MB)Cross-platform Web/Desktop/Mobile readyDownload best.onnx
best_khmer_V3dectect_96pct.ptv5.0 (Archive).pt (~6.2 MB)Dedicated checkpoint for khmer_V3dectect 30 epochs runDownload
best_khmer_V3dectect_96pct.onnxv5.0 (Archive ONNX).onnx (~11.7 MB)Dedicated ONNX for khmer_V3dectectDownload
best_khmer_Dectecv2_30e.ptv4.0.pt (~6.2 MB)mAP50: 91.22% | Recall: 86.58%Download
best_khmer_line_detect_43pct.ptv3.1.pt (~5.9 MB)Selected high-density linesDownload
best_yolo_khmer_math_physics_v3.ptv3.0.pt (~5.5 MB)Math and Physics 54.4K imagesDownload
best_yolo_khmer_math_v2.ptv2.0.pt (~6.2 MB)Math G7-G12 Full TextbooksDownload

Version Evolution and Benchmark

VersionEpochsmAP@50mAP@50-95RecallPrecisionStatus
v5.0 (khmer_V3dectect)3096.78%81.96%93.33%94.89%Current Champion (SOTA)
v4.0 (Dectecv2)3091.22%70.11%86.58%90.99%Previous Stable
v3.1 (line_detect_43pct)20~80.5%61.2%78.40%88.2%Refined Lines
v3.0 (math_physics_v3)3074.93%55.25%76.66%82.1%Unified Curriculum
v2.0 (khmer_math_v2)3083.83%64.85%79.26%85.0%Math G7-G12
v1.0 (Baseline OBB)2043.31%29.62%50.36%-Initial Experiment

Quickstart Inference

Python (Ultralytics)

from ultralytics import YOLO
from huggingface_hub import hf_hub_download

# Download best model directly from Hugging Face
model_path = hf_hub_download(
    repo_id="krotreaksmey/Yolo_Detect_khmer_math",
    filename="best.pt"
)

# Load model
model = YOLO(model_path)

# Predict on full textbook or exam page
results = model.predict(
    source="textbook_page.png",
    conf=0.25,
    iou=0.45,
    imgsz=640
)

# Extract detected text/math lines
for r in results:
    for box in r.boxes:
        x1, y1, x2, y2 = box.xyxy[0].tolist()
        conf = float(box.conf[0])
        cls_id = int(box.cls[0])
        print(f"Line detected at [{x1:.1f}, {y1:.1f}, {x2:.1f}, {y2:.1f}] (conf: {conf:.2f})")

ONNX Runtime (Python / WebAssembly / C++)

import onnxruntime as ort
import numpy as np
from PIL import Image
from huggingface_hub import hf_hub_download

onnx_path = hf_hub_download(
    repo_id="krotreaksmey/Yolo_Detect_khmer_math",
    filename="best.onnx"
)

session = ort.InferenceSession(onnx_path)

# Preprocess image with 640x640 letterboxing
im = Image.open("textbook_page.png").convert("RGB")
w, h = im.size
scale = min(640 / w, 640 / h)
nw, nh = int(w * scale), int(h * scale)
im_resized = im.resize((nw, nh), Image.Resampling.BILINEAR)

padded = Image.new("RGB", (640, 640), (114, 114, 114))
pad_x = (640 - nw) // 2
pad_y = (640 - nh) // 2
padded.paste(im_resized, (pad_x, pad_y))

input_arr = np.array(padded, dtype=np.float32) / 255.0
input_arr = np.transpose(input_arr, (2, 0, 1))[np.newaxis, ...]

outputs = session.run(["output0"], {"images": input_arr})
predictions = outputs[0]  # shape: (1, 5, 8400)

Training Visualizations

Metric Progress and Loss Curves

Training Metrics


Intended Use and Applications

  1. Khmer MoEYS Math and Science OCR: First-stage line segmentation before passing crops to PARSeq / TrOCR recognition models.
  2. Interactive Education and AI Vision Teacher: Automatic extraction and solving of math exercises from photo and PDF submissions.
  3. Document Digitization: Archiving Grade 1 to 12 national exams, curriculum books, and research documents.

Citation

@misc{yolo_khmer_math_v5,
  title={YOLO Khmer Math and Text Line Detection Model (v5.0)},
  author={krotreaksmey},
  year={2026},
  publisher={Hugging Face},
  url={https://huggingface.co/krotreaksmey/Yolo_Detect_khmer_math}
}

Fuentes

1 fuente
Hugging FacePrincipalVersión 940548cc5a4b98fa0548116e76599c483afcfd20
huggingface.co/krotreaksmey/Yolo_Detect_khmer_math/tree/940548cc5a4b98fa0548116e76599c483afcfd20

Verificado 21 oct

Artefactos del modelo

13 artefactos

best_khmer_Dectecv2_30e.onnx

onnx · 11,7 MB · SHA-256 2bb67bbf5788…14bf · Hugging Face

Descargar

best_khmer_Dectecv2_30e.pt

pt · 5,94 MB · SHA-256 f37f7658567e…80c2 · Hugging Face

Descargar

best_khmer_line_detect_43pct.onnx

onnx · 11,7 MB · SHA-256 7cc37d1e65c0…ec25 · Hugging Face

Descargar

best_khmer_line_detect_43pct.pt

pt · 5,94 MB · SHA-256 8f26ec115bf9…52be · Hugging Face

Descargar

best_khmer_V3dectect_96pct.onnx

onnx · 11,7 MB · SHA-256 e7fda10e2010…0667 · Hugging Face

Descargar

best_khmer_V3dectect_96pct.pt

pt · 5,94 MB · SHA-256 6b4c7e6de9bf…a937 · Hugging Face

Descargar

best_yolo_khmer_math_physics_v3.onnx

onnx · 10,1 MB · SHA-256 b7b97b270cee…30f6 · Hugging Face

Descargar

best_yolo_khmer_math_physics_v3.pt

pt · 5,25 MB · SHA-256 b5fd96fc162c…a969 · Hugging Face

Descargar

best_yolo_khmer_math_v2.onnx

onnx · 11,7 MB · SHA-256 004d0101a269…a3ee · Hugging Face

Descargar

best_yolo_khmer_math_v2.pt

pt · 5,94 MB · SHA-256 4091d54c3df9…ee3c · Hugging Face

Descargar

best_yolo_khmer_math.pt

pt · 6,48 MB · SHA-256 6b1934773a8e…c600 · Hugging Face

Descargar

best.onnx

onnx · 11,7 MB · SHA-256 e7fda10e2010…0667 · Hugging Face

Descargar

best.pt

pt · 5,94 MB · SHA-256 6b4c7e6de9bf…a937 · Hugging Face

Descargar

Extractos de fuentes

3 extractos

--- language: - km - en license: mit tags: - yolo - yolov8 - object-detection - khmer-ocr - khmer-text - math-ocr - document-ai - line-detection - ultralytics - moeys pipeline_tag: object-detection model-index: - name: Yolo_Detect_khmer_math results: - task: type: object-detection name: Khmer Math and Text Line Detection dataset: name: Khmer STEM MoEYS Dataset type: khmer-stem-moeys metrics: - type: mAP@50 value: 0.9678 name: mAP@50 - type: mAP@50-95 value: 0.8196 name: mAP@50-95 - type: recall value: 0.9333 name: Recall - type: precision value: 0.9489 name: Precision --- # YOLO Khmer Math and Text Line Detector (v5.0 - khmer_V3dectect) State-of-the-art YOLOv8 model for detecting Khmer printed text lines and mathematical formulas across MoEYS textbooks and exam papers. --- ## Highlights of the Model (v5.0 / khmer_V3dectect) - **96.78% mAP@50**: Peak performance across all versions. - **81.96% mAP@50-95**: High bounding box tightness and precision for text and formula cropping. - **93.33% Recall**: Captures complex stacked formulas, sub/superscripts, fractions, and Khmer diacritics. - **94.89% Precision**: Low false positives on empty document spaces or page margins. - **Lightweight and Fast**: Compact model (~6.2 MB PyTorch `.pt`, ~11.7 MB ONNX `.onnx`) optimized for edge and web execution. --- ## Model Checkpoints and Download Links | Checkpoint Name | Version | Format | Key Metrics | Direct Download Link | | :--- | :---: | :---: | :--- | :--- | | **`best.pt`** | v5.0 (Default Latest) | `.pt` (~6.2 MB) | mAP50: 96.78% \| mAP50-95: 81.96% \| Recall: 93.33% | [Download best.pt](https://huggingface.co/krotreaksmey/Yolo_Detect_khmer_math/resolve/main/best.pt) | | **`best.onnx`** | v5.0 (ONNX Runtime) | `.onnx` (~11.7 MB) | Cross-platform Web/Desktop/Mobile ready | [Download best.onnx](https://huggingface.co/krotreaksmey/Yolo_Detect_khmer_math/resolve/main/best.onnx) | | **`best_khmer_V3dectect_96pct.pt`** | v5.0 (Archive) | `.pt` (~6.2 MB) | Dedicated checkpoint for khmer_V3dectect 30 epochs run | [Download](https://huggingface.co/krotreaksmey/Yolo_Detect_khmer_math/resolve/main/best_khmer_V3dectect_96pct.pt) | | **`best_khmer_V3dectect_96pct.onnx`** | v5.0 (Archive ONNX) | `.onnx` (~11.7 MB) | Dedicated ONNX for khmer_V3dectect | [Download](https://huggingface.co/krotreaksmey/Yolo_Detect_khmer_math/resolve/main/best_khmer_V3decte...

--- language: - km - en tags: - yolo - object-detection - khmer - math - obb - oriented-bounding-box - document-understanding library_name: ultralytics license: apache-2.0 pipeline_tag: object-detection --- # YOLOv8 OBB - Khmer & Math Detection YOLOv8n-obb model for detecting **Khmer text** and **LaTeX math expressions** in document images using oriented bounding boxes (OBB). ## Model Details | Property | Value | |----------|-------| | Architecture | YOLOv8n-obb (nano) | | Task | Oriented Object Detection | | Input | RGB image (1280x1280) | | Output | Oriented bounding boxes + class + confidence | | Framework | Ultralytics YOLOv8 | ## Classes | ID | Name | Description | |----|------|-------------| | 0 | `khmer` | Khmer script text | | 1 | `expression` | LaTeX math formulas | ## Metrics | Metric | Value | |--------|-------| | mAP50 | **0.995** | | mAP50-95 | **0.918** | ## Training Details - **Dataset**: 9,770 train + 2,443 val synthetic document pages - **Epochs**: 50 - **Image size**: 1280 - **Device**: M3 MacBook Pro (CPU/MPS) - **Data augmentation**: Mosaic, mixup, HSV, flip ## Usage ### Python (Ultralytics) ```python from ultralytics import YOLO # Load model model = YOLO("best_yolo_khmer_math.pt") # Run inference results = model.predict("document.jpg", conf=0.3) for result in results: if result.obb: for obb in result.obb: cls = int(obb.cls[0]) conf = float(obb.conf[0]) name = "khmer" if cls == 0 else "expression" print(f"Class: {name}, Confidence: {conf:.2f}") # obb.xyxyxyxy gives 4 corner points (x1,y1,x2,y2,x3,y3,x4,y4) print(f"Points: {obb.xyxyxyxy[0].tolist()}") ``` ### Download ```python from huggingface_hub import hf_hub_download path = hf_hub_download( repo_id="krotreaksmey/Yolo_Detect_khmer_math", filename="best_yolo_khmer_math.pt" ) model = YOLO(path) ``` ## Test Model ### Live Demo on Hugging Face Spaces [![Open in Spaces](https://img.shields.io/badge/%F0%9F%9A%80-Open%20in%20Spaces-blue)](https://huggingface.co/spaces/krotreaksmey/khmer-math-detector) Upload a document image directly in your browser. No installation needed. ### Google Colab (Free GPU) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Krotreaksmey2200/yolo/blob/main/Colab_Test_Model.ipynb) Upload a document image and see detection results with bounding boxes and c...

Source context: 723 downloads · 0 likes · Pipeline object-detection · Library ultralytics · Repo krotreaksmey/Yolo_Detect_khmer_math