metom-onnx

ブラウザ (onnxruntime-web) でくずし字の単字認識を行うための SakanaAI/Metom の ONNX 変換版。 古文書向けの fine-tune 版は nakamura196/metom-komonjo-onnx を参照。

ファイル

  • metom.onnx — ViT 単字分類器 (fp32 / 量子化なし)
  • metom-labels.json — クラス id → 文字 の配列 (length = 2703)

入出力 / 前処理

input pixel_values [batch, 3, 128, 128] float32
output logits [batch, 2703] (softmax で確率、argmax で文字 id)
前処理 文字 crop を 128×128 へ resize → /255CLIP 正規化 → NCHW
正規化 mean = [0.48145466, 0.4578275, 0.40821073] / std = [0.26862954, 0.26130258, 0.27577711]

クラス数 2703 は原典モデルの config.labels に由来する。

精度(原典 SakanaAI/Metom の公表値)

下記は原典モデルの公表値。本 ONNX は原典を fp32 のまま変換し、HF の example 画像で PyTorch と argmax 一致を検証済み(量子化なし)のため、原典と同等の挙動とみなせる。 ただし本リポジトリでの独立した再測定値ではない点に注意。

指標
micro accuracy(全体) 0.9722
macro accuracy(クラス平均) 0.8354
評価データ 日本古典籍くずし字データセット (CODH)、テスト 216,645 字
学習データ 同データセット 649,932 字(train:val:test = 3:1:1)
アーキテクチャ Vision Transformer (ViT) ベース

出典: https://huggingface.co/SakanaAI/Metom

制約

  • 単字 crop 前提(行・文脈は扱わない)。濁点・連綿・レイアウトは考慮しない。
  • macro 0.8354 が示すとおり、低頻度字種の精度は相対的に低い。
  • 分布外(近代活字・漢籍整版・劣化資料)では精度が落ちる。

License / Credit

Apache-2.0。原典: SakanaAI/Metomhttps://huggingface.co/SakanaAI/Metom)。 本リポジトリは onnxruntime-web 用の ONNX 変換ミラー

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for nakamura196/metom-onnx

Base model

SakanaAI/Metom
Quantized
(2)
this model