cwLeeDev commited on
Commit
e2729fe
ยท
verified ยท
1 Parent(s): f770448

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +335 -266
README.md CHANGED
@@ -16,391 +16,460 @@ tags:
16
 
17
  # AIFlow Math Ink 0.6
18
 
19
- AIFlow Math Ink 0.6์€ ์ˆ˜ํ•™ ํ•„๊ธฐ๋ฅผ **์ด๋ฏธ์ง€๋ณด๋‹ค point/stroke sequence๋กœ ๋จผ์ € ์ฒ˜๋ฆฌํ•˜๋Š”** ์˜จ๋””๋ฐ”์ด์Šค ์—ฐ๊ตฌ ๋ชจ๋ธ์ด๋‹ค. ์›๋ณธ touch event๋ฅผ ๋ณด์กดํ•˜๋ฉด์„œ ๋ชจ๋ธ ์ž…๋ ฅ๋งŒ 6Hz canonical tap์œผ๋กœ ์žฌํ‘œ๋ณธํ™”ํ•˜๊ณ , ๊ฐ ๊ณ ๋ฆฝ ๊ธฐํ˜ธ์˜ 378-class top-k์™€ visual-family ํ™•๋ฅ ์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค.
20
 
21
- ํ˜„์žฌ ๊ณต๊ฐœ๋ณธ์€ seed 17ยท31ยท47์˜ ์—ฐ๊ตฌ checkpoint์™€ grouping/behavior head๋ฅผ ํฌํ•จํ•œ๋‹ค. ์ „์ฒด ์ˆ˜์‹ LaTeX decoder๋‚˜ ์™„์„ฑ๋œ Android LiteRT ๋ฐฐํฌ๋ณธ์€ ์•„๋‹ˆ๋‹ค.
 
 
 
 
 
 
 
 
 
 
22
 
23
  ![AIFlow Math Ink 0.6 architecture](assets/architecture.svg)
24
 
25
- ## 2026-07-24 federation ๊ฐ์‚ฌ
26
 
27
- ์ถœ์ฒ˜ ์ด๋ฆ„์ด๋‚˜ sample ID๋งŒ ์„ธ์ง€ ์•Š๊ณ , ์ด๋™ยทํฌ๊ธฐ๋ฅผ ์ œ๊ฑฐํ•œ trajectory signature์™€ writer split์„ ๋‹ค์‹œ ๊ฐ์‚ฌํ–ˆ๋‹ค.
28
 
29
- | ํ•ญ๋ชฉ | ๊ต์ • ์ „ | ๊ต์ • ํ›„ |
30
- |---|---:|---:|
31
- | UJI Pen v1โ†”v2 ์ค‘๋ณต | 1,364 | 0 |
32
- | HWRT writer split ๋ˆ„์ˆ˜ | 93๋ช… | 0 |
33
- | ์ „์ฒด origin overlap | 0 | 0 |
34
- | ์œ ํšจ supervised source | 4 | 3 |
35
 
36
- UJI Pen v1์€ v2์— ์ „๋ถ€ ํฌํ•จ๋œ mirror๋ผ sampler์—์„œ ์ œ๊ฑฐํ–ˆ๋‹ค. HWRT ๊ณต์‹ test๋Š” ์ œํ’ˆ ๊ฒฝ๋กœ์—์„œ ์ œ์™ธํ•˜๊ณ , ์Šน์ธ train writer 275๋ช…์„ ๋ณ„๋„์˜ train/validation/test๋กœ ๋‹ค์‹œ ๋‚˜๋ˆด๋‹ค. UJI v2๋Š” ๊ณต์‹ test๋ฅผ ๋ณด์กดํ•˜๋ฉด์„œ train writer validation์„ ๊ฒฉ๋ฆฌํ–ˆ๋‹ค.
 
 
37
 
38
- ํ˜„์žฌ registry๋Š” ์กฐ์‚ฌ `38/200`, ์Šน์ธ ๋ฐฐํฌ ๋…๋ฆฝ ๊ทธ๋ฃน `7/30`์ด๊ณ  ๊ธฐ์กด federation checkpoint์—๋Š” ์‹ค์ œ `training_source_ids`๊ฐ€ ์—†๋‹ค. ๋”ฐ๋ผ์„œ ๊ณต๊ฐœ ๋ชจ๋ธ์€ ๊ณ„์† ์—ฐ๊ตฌ์šฉ์ด๋ฉฐ `product_validation=false`๋‹ค. ๊ต์ • ์ „ federation ์ •ํ™•๋„๋Š” ์ œํ’ˆ ๊ทผ๊ฑฐ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๋‹ค.
39
 
40
- - [์‚ฌ๋žŒ์ด ์ฝ๋Š” ๊ฐ์‚ฌ ๋ณด๊ณ ์„œ](reports/FEDERATION_AUDIT_20260724.md)
41
- - [๊ธฐ๊ณ„ ํŒ๋… federation audit](reports/federation_audit.json)
42
- - [์ถœ์ฒ˜ registry](registry/math_ink_06_source_registry.json)
 
 
 
 
43
 
44
- ## ํ•ต์‹ฌ ์ž…๋ ฅ ๊ณ„์•ฝ
45
 
46
- ![Stroke encoding](assets/stroke_encoding.svg)
47
 
48
- ์‹ค์ œ ํŽœ ์ž…๋ ฅ์€ ๋‹ค์Œ ์ˆœ์„œ๋กœ ์ฒ˜๋ฆฌํ•œ๋‹ค.
49
 
50
- 1. ๊ธฐ๊ธฐ์˜ ๋ชจ๋“  touch event๋ฅผ ์›๋ณธ timestamp์™€ ํ•จ๊ป˜ ๋ฉ”๋ชจ๋ฆฌ์— ๋ณด์กดํ•œ๋‹ค.
51
- 2. stroke๋ณ„ ์‹œ์ž‘์ ยท๋์ ยทpen-up์„ ํ•„์ˆ˜ anchor๋กœ ๋‚จ๊ธด๋‹ค.
52
- 3. ๋ชจ๋ธ์šฉ temporal view๋งŒ 6Hz๋กœ ์žฌํ‘œ๋ณธํ™”ํ•œ๋‹ค.
53
- 4. ์ข…ํšก๋น„๋ฅผ ๋ณด์กดํ•ด 128ร—128 ink space์— ์ค‘์•™ ์ •๊ทœํ™”ํ•œ๋‹ค.
54
- 5. ์ตœ๋Œ€ 128 event, 19๊ฐœ feature๋ฅผ `128ร—19` tensor๋กœ ๋งŒ๋“ ๋‹ค.
55
 
56
- 19๊ฐœ channel:
 
 
 
 
 
57
 
58
  ```text
59
- shape_x, shape_y,
60
- canvas_x, canvas_y,
61
- direction_x, direction_y,
62
- curvature, pen_up, stroke_progress,
63
- aspect_ratio,
64
- bbox_top, bbox_bottom, bbox_height, center_y,
65
- baseline_available,
66
- time_delta, speed, missing_mask, source_modality
67
  ```
68
 
69
- - timestamp๊ฐ€ ์‹ค์ œ๋กœ ์žˆ์œผ๋ฉด `timestamp_mode=observed`
70
- - ์ •์  ์ด๋ฏธ์ง€์ฒ˜๋Ÿผ ์‹œ๊ฐ„์ด ์—†์œผ๋ฉด `timestamp_mode=canonical`, `missing_mask=1`
71
- - ์ถ”์ • ์‹œ๊ฐ„์„ ์‹ค์ œ ๊ด€์ธก ์‹œ๊ฐ„์ฒ˜๋Ÿผ ์ €์žฅํ•˜์ง€ ์•Š๋Š”๋‹ค.
72
 
73
- ## ๋ชจ๋ธ ๊ตฌ์กฐ
 
 
 
 
74
 
75
  ```text
76
- Online stroke
77
- โ†’ 6 Hz canonical taps (128ร—19)
78
- โ†’ online dual-TCN adapter
79
- โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
80
- โ”‚
81
- Raster 128ร—128 โ”‚
82
- โ†’ spatial encoder โ”‚
83
- โ†’ causal virtual-trajectory decoder โ”‚
84
- โ†’ top-4 stroke hypotheses โ”‚
85
- โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
86
- โ–ผ
87
- shared residual TCN (hidden=128)
88
- โ”œโ”€ exact head: 378 labels
89
- โ”œโ”€ family head: 324 families
90
- โ””โ”€ top-k probabilities
91
 
92
- Local formula context + stroke tensor
93
- โ†’ 49-d context MLP + stroke TCN
94
- โ†’ identifier_lower / identifier_upper / multiply_operator
95
 
96
- Segmentation lattice geometry
97
- โ†’ boundary behavior head
98
- โ†’ candidate crosses a symbol boundary?
99
  ```
100
 
101
- Raster ๊ฒฝ๋กœ๋„ ์ตœ์ข… label shortcut์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค. ์ด๋ฏธ์ง€์—์„œ top-4 virtual stroke๋ฅผ ๋งŒ๋“  ํ›„ ๋™์ผ trajectory encoder๋กœ ๋‹ค์‹œ ์ธ์‹ํ•œ๋‹ค.
 
 
 
 
102
 
103
- ## ๊ณต๊ฐœ checkpoint
104
 
105
- ๊ฐ seed๋Š” ์„ธ ํŒŒ์ผ๋กœ ๊ตฌ์„ฑ๋œ๋‹ค.
106
 
107
  ```text
108
- models/
109
- seed17/
110
- base_378.pt
111
- online_adapter.pt
112
- behavior_role_head.pt
113
- seed31/
114
- ...
115
- seed47/
116
- ...
117
- artifacts/
118
- boundary_behavior_guard.joblib
119
  ```
120
 
121
- | ํŒŒ์ผ | ์—ญํ•  | ์ฃผ์š” ๊ณ„์•ฝ |
122
- |---|---|---|
123
- | `base_378.pt` | ๊ณตํ†ต trajectory/raster base | hidden 128, top-4 hypothesis, 378 exact, 324 family |
124
- | `online_adapter.pt` | ์‹ค์ œ ์˜จ๋ผ์ธ stroke ๋ณด์ • | `dual_tcn_v3`, `top4-skeleton-128x19` |
125
- | `behavior_role_head.pt` | `x/X/ร—` ์—ญํ•  ๋ฌธ๋งฅ | 128ร—19 stroke + 49 context feature |
126
- | `boundary_behavior_guard.joblib` | ์ž˜๋ชป๋œ ๋‹ค๊ธฐํ˜ธ ๋ณ‘ํ•ฉ ์–ต์ œ | geometry 17 feature, threshold 0.5, weight 6 |
127
 
128
- ์„ธ seed teacher๋ฅผ ๊ทธ๋Œ€๋กœ ๋ชจ๋ฐ”์ผ์— ๋„ฃ๋Š” ๊ฒƒ์ด ์ตœ์ข… ๋ชฉํ‘œ๋Š” ์•„๋‹ˆ๋‹ค. release ๊ฒฝ๋กœ๋Š” seed ensemble์„ ํ•˜๋‚˜์˜ student๋กœ distillationํ•œ ๋’ค LiteRT INT8/FP16์„ ๋น„๊ตํ•˜๋Š” ๊ฒƒ์ด๋‹ค.
 
 
 
129
 
130
- ## Checkpoint metadata ํ™•์ธ
131
 
132
- ์•„๋ž˜ ์ฝ”๋“œ๋Š” network๋ฅผ ์‹คํ–‰ํ•˜์ง€ ์•Š๊ณ  checkpoint ๊ณ„์•ฝ์„ ํ™•์ธํ•œ๋‹ค.
133
 
134
- ```python
135
- from pathlib import Path
136
- import torch
137
 
138
- root = Path("models/seed17")
139
 
140
- base = torch.load(root / "base_378.pt", map_location="cpu", weights_only=False)
141
- adapter = torch.load(root / "online_adapter.pt", map_location="cpu", weights_only=False)
142
- role = torch.load(root / "behavior_role_head.pt", map_location="cpu", weights_only=False)
143
 
144
- print(base["model_version"])
145
- print(base["max_events"], base["sample_hz"])
146
- print(len(base["feature_names"]), len(base["exact_labels"]), len(base["family_labels"]))
147
- print(adapter["adapter_architecture"], adapter["feature_contract"])
148
- print(role["role_labels"], role["context_features"])
149
  ```
150
 
151
- ์‹ค์ œ Python composite ์ถ”๋ก ์€ Colab bundle์„ ํ‘ผ ๋””๋ ‰ํ„ฐ๋ฆฌ์—์„œ ๋‹ค์Œ์ฒ˜๋Ÿผ ์‹คํ–‰ํ•œ๋‹ค. Adapter๋ฅผ ์ƒ๋žตํ•˜๋ฉด ์ •์ •๋œ ๋ฉ”์ธ ๋ชจ๋ธ์ด ์•„๋‹ˆ๋ผ base-only ๊ฒฝ๋กœ๊ฐ€ ๋˜๋ฏ€๋กœ ๋ฐ˜๋“œ์‹œ ํ•จ๊ป˜ ์ „๋‹ฌํ•œ๋‹ค.
152
 
153
- ```python
154
- from pathlib import Path
155
- from math_grid_drawer.research.math_ink_06 import MathInk06Engine
 
 
156
 
157
- engine = MathInk06Engine(
158
- Path("artifacts/base_378.pt"),
159
- adapter_checkpoint=Path("artifacts/online_adapter.pt"),
160
- )
161
 
162
- result = engine.recognize_online(
163
- strokes,
164
- canvas_width=128,
165
- canvas_height=128,
166
- top_k=5,
167
- )
 
 
 
 
 
 
168
  ```
169
 
170
- Checkpoint ๋‚ด๋ถ€ ๊ฒฝ๋กœ๋Š” lineage ๊ธฐ๋ก์ด๋ฉฐ ๋กœ์ปฌ ์ ˆ๋Œ€๊ฒฝ๋กœ์— ์˜์กดํ•ด ์ถ”๋ก ํ•˜์ง€ ์•Š๋Š”๋‹ค.
171
 
172
- ## ํ˜„์žฌ ์„ฑ๋Šฅ
 
 
 
 
173
 
174
- ### 378-label trajectory classifier
175
 
176
- ์ตœ์‹  online case-context seed 17 ๊ธฐ์ค€:
 
 
 
 
177
 
178
- | split | top-1 | top-5 | family top-1 |
179
- |---|---:|---:|---:|
180
- | writer validation, 4,261 samples | 86.13% | 99.48% | 92.94% |
181
- | paired writer-disjoint test, 3,782 samples | 82.87% | 97.73% | 91.22% |
182
 
183
- Paired source๋Š” HWRT ๋‚ด๋ถ€ writer hash split๊ณผ UJI Pen v1/v2 writer-disjoint ๊ณ„์•ฝ์„ ์‚ฌ์šฉํ–ˆ๋‹ค. HWRT official test๋Š” ๊ฑฐ๋Œ€ writer ์ค‘๋ณต ๋•Œ๋ฌธ์— ์ œ์™ธํ–ˆ๋‹ค.
184
 
185
- ### ์ˆ˜์‹ ํ–‰๋™ head
186
 
187
- ์ •๋‹ต symbol grouping ์ดํ›„์˜ CROHME ์กฐ๊ฑด๋ถ€ ์—ญํ•  ํ‰๊ฐ€:
188
 
189
- | ์ง€ํ‘œ | 3-seed ํ‰๊ท  |
190
- |---|---:|
191
- | role accuracy | 93.33% |
192
- | macro-F1 | 76.41% |
193
- | lowercase identifier recall | 95.66% |
194
- | uppercase identifier recall | 55.91% |
195
- | multiplication recall | 88.89% |
196
- | ECE | 4.88% |
197
 
198
- ํ–‰๋™ head๋ฅผ ์‹ค์ œ teacher ์ถœ๋ ฅ ๋’ค์— ์—ฐ๊ฒฐํ•˜๊ณ  validation์—์„œ๋งŒ confidence threshold๋ฅผ ์„ ํƒํ•œ ๊ฒฐ๊ณผ, CROHME official test์˜ ๋Œ€์ƒ ๊ธฐํ˜ธ exact top-1์€ 33.65%์—์„œ 47.30%๋กœ ํ‰๊ท  **13.65%p** ์ƒ์Šนํ–ˆ๋‹ค. Rewrite precision์€ 81.35%์˜€๋‹ค. ๋‹ค๋งŒ ๊ฐ™์€ ๊ตฌ๊ฐ„์˜ teacher visual-family top-1์ด 53.02%์— ๋ถˆ๊ณผํ•ด, ํ–‰๋™ ๋ฌธ๋งฅ๋งŒ์œผ๋กœ ์ž˜๋ชป๋œ ํ˜•ํƒœ๊ตฐ์„ ๋ณต๊ตฌํ•  ์ˆ˜ ์—†์—ˆ๋‹ค.
199
 
200
- ### R-track ์—ฐ์† ์ˆ˜์‹ ์–ด๋Œ‘ํ„ฐ
201
 
202
- ์ œํ’ˆ trajectory encoder์™€ online adapter๋Š” ๊ณ ์ •ํ•˜๊ณ , CROHME ์—ฐ์†์‹์˜ ์ •๋‹ต symbol group ์œ„์—์„œ 92KB zero-init formula adapter๋งŒ ํ•™์Šตํ–ˆ๋‹ค. ์ด checkpoint๋Š” ๊ตฌ์กฐ ๊ฒ€์ฆ์šฉ **R_noncommercial_only** ๋ชจ๋ธ์ด๋ฉฐ ์ œํ’ˆ weight ๋˜๋Š” distillation ์ž…๋ ฅ์ด ์•„๋‹ˆ๋‹ค.
203
 
204
- | 3-seed ์ง€ํ‘œ | ํ‰๊ท  | ์ตœ์ € |
205
- |---|---:|---:|
206
- | writer-validation exact top-1 | 85.19% | 82.91% |
207
- | writer-validation visual-family top-1 | **93.30%** | **93.03%** |
208
- | official test exact top-1 | 82.38% | 81.13% |
209
- | official test visual-family top-1 | 88.17% | 88.03% |
210
- | visual-family ์ผ๋ฐ˜ํ™” gap | 5.13%p | โ€” |
211
 
212
- Validation์—์„œ๋Š” ์„ธ seed ๋ชจ๋‘ ํ˜•ํƒœ๊ตฐ 92%๋ฅผ ๋„˜๊ฒจ ํ˜„์žฌ TCN ๊ตฌ์กฐ๊ฐ€ ์—ฐ์† ์ˆ˜์‹์—๋„ ์ ์‘ํ•  ์ˆ˜ ์žˆ์Œ์„ ํ™•์ธํ–ˆ๋‹ค. ๋ฐ˜๋ฉด unseen official test์—์„œ๋Š” ๋ชจ๋‘ ์‹คํŒจํ–ˆ๋‹ค. ํ˜„ ๋ณ‘๋ชฉ์€ ๋ชจ๋ธ ์šฉ๋Ÿ‰๋ณด๋‹ค writer/source domain ์ผ๋ฐ˜ํ™”์ด๋ฉฐ, ๋‹ค์Œ gate๋Š” ์ƒ์šฉ ํ—ˆ์šฉ P-track ์—ฐ์†์‹์˜ writer/device-disjoint ์žฌํ•™์Šต์ด๋‹ค.
213
 
214
- ### P ๊ณ ๋ฆฝ๊ธฐํ˜ธ ํ•ฉ์„ฑ ์ˆ˜์‹ proxy โ€” ๊ธฐ๊ฐ
215
 
216
- ์Šน์ธ HWRT/UJI trajectory 1,590๊ฐœ๋ฅผ ์ˆซ์ž anchor ์‚ฌ์ด์— ํ•ฉ์„ฑ ๋ฐฐ์น˜ํ•ด ํ–‰๋™ head์— weight 0.35๋กœ ์ถ”๊ฐ€ํ•œ seed-17 ์‹คํ—˜์€ accuracy๊ฐ€ 93.07%๋กœ ๊ฐ™์•˜์ง€๋งŒ macro-F1 76.64โ†’73.62%, uppercase recall 61.29โ†’45.16%๋กœ ์•…ํ™”๋๋‹ค. ์‹ค์ œ ์—ฐ์†์‹ validation๊ณผ ๋น„๊ตํ•œ formula-relative bbox width/height์˜ ์ตœ๋Œ€ ์ ˆ๋Œ€ SMD๋Š” 2.82๋กœ ํ˜ธํ™˜ ๊ธฐ์ค€ 0.5๋ฅผ ํฌ๊ฒŒ ๋„˜์—ˆ๋‹ค.
 
 
 
 
 
 
 
 
 
217
 
218
- ๊ณ ๋ฆฝ๊ธฐํ˜ธ์—๋Š” ์ „์ฒด formula bboxยทTrayยท์ด์›ƒ ๋ถ€์žฌ ๋ถ„ํฌ๊ฐ€ ์—†์œผ๋ฏ€๋กœ ์ž„์˜ ํ•ฉ์„ฑ ๋ฐฐ์น˜๋ฅผ ํ–‰๋™/formula ์ œํ’ˆ ํ•™์Šต์— ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค. ์ด ๊ฒฝ๋กœ๋Š” `rejected_no_3seed_expansion`์ด๋ฉฐ ์‹คํŒจ checkpoint๋„ ๋ฐฐํฌํ•˜์ง€ ์•Š๋Š”๋‹ค. ์Šน์ธ ๊ณ ๋ฆฝ๊ธฐํ˜ธ๋Š” shape encoder์—๋งŒ ์œ ์ง€ํ•˜๊ณ , ํ–‰๋™ ํ•™์Šต์€ ์‹ค์ œ `AIFlow P Formula v1` ์—ฐ์†์‹์„ ๊ธฐ๋‹ค๋ฆฐ๋‹ค.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
 
220
- ### Grouping boundary head
221
 
222
- | ์ง€ํ‘œ | ์ด์ „ | boundary ์ ์šฉ |
223
- |---|---:|---:|
224
- | CROHME exact partition | 60.04% | 60.25% |
225
- | pair-F1 | 91.07% | 91.26% |
226
- | overmerge formula rate | 21.72% | 20.49% |
 
 
 
 
 
 
 
 
 
 
 
 
227
 
228
- ### P boundary shared-state ์ •์ •
229
 
230
- ์ดˆ๊ธฐ ๊ณต๊ฐœ P delta๋Š” `online_adapter.pt`์˜ `shared_state_dict`๋ฅผ ์ ์šฉํ•˜์ง€ ์•Š์€ loader ๊ฒฐํ•จ์„ ์ƒ์†ํ–ˆ๋‹ค. ์ด ๋•Œ๋ฌธ์— ๊ฐ•ํ•œ main encoder๋ฅผ ๋น ๋œจ๋ฆฐ ๋‚ฎ์€ ๊ธฐ์ค€์„ ๊ณผ ๋น„๊ตํ–ˆ์œผ๋ฉฐ, ํ•ด๋‹น auxiliary/joint checkpoint์™€ ์„ฑ๋Šฅ ์ฃผ์žฅ์„ ์ฒ ํšŒํ–ˆ๋‹ค.
 
 
 
 
 
 
 
 
231
 
232
- ์˜ฌ๋ฐ”๋ฅธ ํ•ฉ์„ฑ ์ˆœ์„œ์ธ `base โ†’ adapter shared state โ†’ modality adapter โ†’ optional head`๋กœ ์„ธ seed๋ฅผ ๋‹ค์‹œ ํ•™์Šตํ•œ ๊ฒฐ๊ณผ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
233
 
234
- | paired proxy test | ์ •์ •๋œ main baseline | joint ๊ฒฐ๊ณผ | ๋ณ€ํ™” |
235
- |---|---:|---:|---:|
236
- | exact top-1 | **83.03%** | 82.81% | -0.22%p |
237
- | family top-1 | **91.37%** | 90.88% | -0.49%p |
238
- | single-symbol recall | โ€” | 92.83% | 95% floor ์‹คํŒจ |
239
- | cross-boundary recall | โ€” | 98.47% | ํ†ต๊ณผ |
240
 
241
- ์„ธ seed ๋ชจ๋‘ release gate๋ฅผ ์‹คํŒจํ–ˆ์œผ๋ฏ€๋กœ joint delta๋Š” ๋ฐฐํฌํ•˜์ง€ ์•Š๋Š”๋‹ค. ํ˜„์žฌ ์œ ํšจํ•œ main ๊ตฌ์„ฑ์€ seed๋ณ„ `base_378.pt + online_adapter.pt`์ด๋ฉฐ adapter ์•ˆ์˜ `shared_state_dict`๋ฅผ ๋ฐ˜๋“œ์‹œ ๋จผ์ € ์ ์šฉํ•ด์•ผ ํ•œ๋‹ค.
242
 
243
- Joint delta ์—†๋Š” main+shadow auxiliary device stress์—์„œ ์ตœ์•… exact/family ํ•˜๋ฝ์€ affine ๋ณ€ํ˜•์˜ -0.98%p/-1.08%p์˜€๋‹ค. Software stress๋Š” ํ†ต๊ณผํ–ˆ์ง€๋งŒ clean single recall์ด 91.42~94.50%์ด๋ฏ€๋กœ auxiliary head๋„ ์ œํ’ˆ ์ฑ„ํƒ ๋Œ€์ƒ์ด ์•„๋‹ˆ๋‹ค.
244
 
245
- ### Composite torch.export
 
 
 
 
 
246
 
247
- Export ๊ทธ๋ž˜ํ”„๋Š” ์ด์ œ base-only๊ฐ€ ์•„๋‹ˆ๋ผ online/raster modality adapter์™€ shared state๋ฅผ ํฌํ•จํ•œ๋‹ค. ์„ธ seed ๋ชจ๋‘ ๊ฐ ๊ฒฝ๋กœ ๋Œ€ํ‘œ ์ž…๋ ฅ 76๊ฐœ์—์„œ eager ๋Œ€๋น„ top-1 100% ์ผ์น˜, ์ตœ๋Œ€ logit ์ ˆ๋Œ€์˜ค์ฐจ 0.0์„ ๊ธฐ๋กํ–ˆ๋‹ค. Validation-only calibration์œผ๋กœ ๊ณ ์ •๋œ online family-fusion 0.15๋„ export์— ํฌํ•จ๋œ๋‹ค. Fresh seed-17 online/raster `.pt2` ํ•ฉ๊ณ„๋Š” 24,300,116 bytes๋‹ค.
248
 
249
- `.pt2`๋Š” Android์šฉ `.tflite`๊ฐ€ ์•„๋‹ˆ๋‹ค. LiteRT Torch 0.9.1 ๋ณ€ํ™˜๊ณผ Android runtime parity๋Š” ์•„์ง ์™„๋ฃŒ๋˜์ง€ ์•Š์•˜์œผ๋ฏ€๋กœ `litert_exported=false`๋ฅผ ์œ ์ง€ํ•œ๋‹ค.
250
 
251
- ### CPU latencyยทmemory proxy
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
 
253
- Family-fusion 0.15๋ฅผ ํฌํ•จํ•œ Windows PyTorch CPU ์žฌ์ธก์ •์—์„œ online p95๋Š” 8.90~9.67ms, raster p95๋Š” 22.10~26.63ms์˜€๋‹ค. Tensor state๋Š” 8.95MB, ๋ชจ๋ธ ๋กœ๋“œ ํ›„ inference RSS ์ฆ๊ฐ€๋ถ„์„ ํ•ฉ์นœ ๊ตฌ์กฐ proxy๋Š” 26.39MB๋‹ค. ์ „์ฒด Python process RSS๋Š” PyTorch runtime์„ ํฌํ•จํ•˜๋ฏ€๋กœ Android LiteRT memory ๊ทผ๊ฑฐ๊ฐ€ ์•„๋‹ˆ๋‹ค.
 
 
 
 
254
 
255
- ### Online ์˜ค๋ฅ˜ ํ•ฉ์˜ ๊ฐ์‚ฌ
256
 
257
- ์ •์ • composite ์„ธ seed๋ฅผ ์„ ํƒ์— ์“ฐ์ง€ ์•Š์€ paired writer/device-disjoint 3,782๊ฐœ์—์„œ ๋‹ค์‹œ ๊ฐ์‚ฌํ–ˆ๋‹ค.
258
 
259
- | ์ง€ํ‘œ | ๊ฒฐ๊ณผ |
260
- |---|---:|
261
- | exact ensemble top-1 | 83.71% |
262
- | exact ensemble top-5 | 98.02% |
263
- | visual-family top-1 | **92.99%** |
264
- | seed oracle top-1 | 88.05% |
265
- | ์„ธ seed ๊ณตํ†ต ์˜ค๋ฅ˜ | 11.95% |
266
 
267
- Exact ์˜ค๋ฅ˜์˜ 56.98%(์ „์ฒด 9.28%p)๋Š” `O/0/o`, ๋Œ€์†Œ๋ฌธ์ž, ์ˆ˜์ง์„ ยทcross์ฒ˜๋Ÿผ ๊ฐ™์€ visual family ์•ˆ์˜ ์˜๋ฏธ ํ˜ผ๋™์ด๋‹ค. ๋”ฐ๋ผ์„œ 0.6์˜ trajectory ๋‹จ๊ณ„๋Š” ํ˜•ํƒœ๊ตฐ ํ›„๋ณด๋ฅผ ๋ฐ˜ํ™˜ํ•˜๊ณ , exact ์˜๋ฏธ๋Š” ์‹ค์ œ ์ˆ˜์‹ ํ–‰์˜ ์ƒ๋Œ€ ํฌ๊ธฐ์™€ ํ–‰๋™ ๋ฌธ๋งฅ์ด ๊ฒฐ์ •ํ•ด์•ผ ํ•œ๋‹ค. ์‹ค์ œ P ์—ฐ์†์‹์ด ์—†์œผ๋ฏ€๋กœ formula-context exact 92% gate๋Š” ์•„์ง ํ†ต๊ณผํ•˜์ง€ ์•Š์•˜๋‹ค.
268
 
269
- Validation์—์„œ family-fusion 0.15๋ฅผ ์„ ํƒํ•œ ๋’ค paired-test์— ํ•œ ๋ฒˆ ์ ์šฉํ•˜์ž exact top-1์€ 83.71โ†’83.82%(+0.11%p)์˜€๋‹ค. ์ด๋Š” ์ž‘์€ ๋ณด์ •์ด๋ฉฐ ๋ฌธ๋งฅ ๋ ˆ์ด์–ด๋ฅผ ๋Œ€์ฒดํ•˜์ง€ ์•Š๋Š”๋‹ค.
 
 
 
270
 
271
- ## ์ถœ๋ ฅ ๋ฒ”์œ„
 
 
 
 
 
 
272
 
273
- ์˜๋„ํ•œ ๋ชจ๋ฐ”์ผ API:
274
 
275
- ```text
276
- recognizeOnline(strokes, canvas) โ†’ SymbolResult
277
- recognizeRaster(bitmap) โ†’ SymbolResult
278
-
279
- SymbolResult:
280
- candidates[{token, probability}]
281
- confidence
282
- modelVersion
283
- latencyMs
284
  ```
285
 
286
- ์ด๋ฏธ์ง€, raw stroke, virtual stroke๋Š” ์„œ๋ฒ„ payload๋กœ ์ „์†กํ•˜์ง€ ์•Š๋Š”๋‹ค. virtual hypotheses๋Š” ๋กœ์ปฌ debug์—์„œ๋งŒ ๋…ธ์ถœํ•œ๋‹ค.
287
 
288
- ## Local P Formula intake
289
 
290
- Drawer์˜ local-only `AIFlow Ink v1`์€ ์ž๋™์œผ๋กœ ํ•™์Šต ์ •๋‹ต์ด ๋˜์ง€ ์•Š๋Š”๋‹ค. ๋ณ„๋„ human annotation JSONL์ด ์‹ค์ œ ๋น„์‹๋ณ„ `device_id`, `label_status=human_verified`, ๋ชจ๋“  `formula_cell_id โ†’ token` ์ „๋‹จ์‚ฌ๋ฅผ ์ œ๊ณตํ•ด์•ผ ํ•œ๋‹ค.
291
 
292
- Materializer๋Š” ๋‹ค์Œ ์กฐ๊ฑด์„ ๋ชจ๋‘ ํ†ต๊ณผํ•œ ๋’ค์—๋งŒ UTF-8 P Formula v1 JSONL์„ ์›์ž์ ์œผ๋กœ ์ƒ์„ฑํ•œ๋‹ค.
 
 
 
293
 
294
- - ๋ชจ๋“  raw stroke๊ฐ€ ์ •ํ™•ํžˆ ํ•œ symbol group์— ํฌํ•จ๋จ
295
- - timestampยทpressure ๊ฒฐ์ธก์„ ์›๋ณธ ๊ทธ๋Œ€๋กœ ๋ณด์กด
296
- - ๊ธฐ์ค€ checkpoint์˜ ์ค‘๋ณต ์—†๋Š” 378 exact vocabulary์™€ token ์ผ์น˜
297
- - origin/writer/device/source split ๋ˆ„์ˆ˜ 0
298
- - training/validation/test์™€ P ๊ถŒ๋ฆฌยท๋…๋ฆฝ source gate ํ†ต๊ณผ
299
 
300
- ์ „์ฒด AIFlow source checkout์—์„œ ์‹คํ–‰ํ•œ๋‹ค.
 
 
 
 
 
 
 
 
 
301
 
302
- ```powershell
303
- python scripts/materialize_math_ink_06_p_formula.py `
304
- --input path/to/curated `
305
- --annotations path/to/annotations.jsonl `
306
- --checkpoint path/to/base_378.pt `
307
- --output path/to/p_formula_v1.jsonl `
308
- --report path/to/preflight.json
309
  ```
310
 
311
- ์‹คํŒจ ์‹œ report๋งŒ ๋‚จ๊ณ  dataset์€ ์ƒ์„ฑ๋˜์ง€ ์•Š๋Š”๋‹ค. ์ด ๊ธฐ๋Šฅ๏ฟฝ๏ฟฝ ์„œ๋ฒ„ ์ „์†ก์ด๋‚˜ ์ž๋™ ์ˆ˜์ง‘์„ ์ˆ˜ํ–‰ํ•˜์ง€ ์•Š๋Š”๋‹ค.
312
 
313
- ### P-only formula adapter training
314
 
315
- Materialize๋œ P Formula v1์€ ์ „์ฒด formula bbox ๊ธฐ์ค€ 128ร—19 symbol tensor๋กœ ๋ณ€ํ™˜๋œ๋‹ค. Product encoder์™€ online adapter๋Š” ๋™๊ฒฐํ•˜๊ณ  hidden-64 zero-init formula adapter๋งŒ ํ•™์Šตํ•œ๋‹ค.
 
 
 
 
 
 
 
 
 
 
 
316
 
317
  ```text
318
- family CE + exact CEร—0.10
319
- context dropout 0.30
320
- inverse-sqrt(source frequency ร— exact-label frequency) sampler
321
- validation-only checkpoint selection
322
  ```
323
 
324
- ๊ฐ seed๋Š” test exact top-1 92%, top-5 99%, macro-F1 90%, writer floor 75%, ๊ฒฐ์ธก metadata slice ํ•˜๋ฝ 3%p ์ดํ•˜๋ฅผ ๋ชจ๋‘ ํ†ต๊ณผํ•ด์•ผ ํ•œ๋‹ค. Seed 17ยท31ยท47์ด ๊ฐœ๋ณ„ ํ†ต๊ณผํ•˜๊ณ  ์„ธ run์˜ ์›๋ณธ P Formula JSONL SHA-256์ด ์ •ํ™•ํžˆ ๊ฐ™์€ ๊ฒฝ์šฐ์—๋งŒ single mobile student distillation์„ ํ—ˆ์šฉํ•œ๋‹ค. Teacher ensemble ์ž์ฒด๋Š” ๊ธฐ๊ธฐ์— ํƒ‘์žฌํ•˜์ง€ ์•Š๋Š”๋‹ค.
325
 
326
- ์‹ค์ œ seed-17 composite์™€ GTX 1650์„ ์‚ฌ์šฉํ•œ 1-epoch fixture smoke์—์„œ CUDA ํ•™์Šต๋ถ€ํ„ฐ report/checkpoint ์ƒ์„ฑ๊นŒ์ง€ ํ†ต๊ณผํ–ˆ๋‹ค. Fixture checkpoint๋Š” ์„ฑ๋Šฅ ๊ทผ๊ฑฐ๊ฐ€ ์•„๋‹ˆ๋ฏ€๋กœ ์ด ๊ณต๊ฐœ ์ €์žฅ์†Œ์— ํฌํ•จํ•˜์ง€ ์•Š์•˜๋‹ค. ๊ณ ์ • recipe๋Š” [`configs/MATH-INK-06-P-FORMULA-v1.json`](configs/MATH-INK-06-P-FORMULA-v1.json)์— ์žˆ๋‹ค.
327
 
328
- ### Single-student distillation
329
 
330
- ํ†ต๊ณผํ•œ ์„ธ teacher๋Š” base โ†’ shared online adapter โ†’ P formula adapter ์ˆœ์„œ๋กœ ํ•ฉ์„ฑํ•œ๋‹ค. Temperature 2.0์˜ exact/family ํ™•๋ฅ ์„ seed ์‚ฌ์ด์—์„œ ํ‰๊ท ํ•˜๊ณ  KL + hard-label CE๋กœ hidden-64 formula adapter ํ•˜๋‚˜๋งŒ ํ•™์Šตํ•œ๋‹ค. Student checkpoint์—๋Š” teacher weight๋ฅผ ํฌํ•จํ•˜์ง€ ์•Š๋Š”๋‹ค.
331
 
332
- Student๋Š” ์ž์ฒด 92/99ยทmacro-F1ยทwriter/missing gate๋ฟ ์•„๋‹ˆ๋ผ teacher ensemble ๋Œ€๋น„ exact top-1ยทtop-5ยทvisual-family ํ•˜๋ฝ 1%p ์ดํ•˜๋ฅผ ๋ชจ๋‘ ๋งŒ์กฑํ•ด์•ผ ํ•œ๋‹ค. 2/2/2-symbol fixture์˜ 3-teacherโ†’student CUDA ์‹คํ–‰ ๊ฒฝ๋กœ๋Š” ํ†ต๊ณผํ–ˆ์ง€๋งŒ ์ •์‹ student gate๋Š” ์‹คํŒจํ–ˆ๋‹ค. Fixture์™€ checkpoint๋Š” ์ด ๊ณต๊ฐœ ์ €์žฅ์†Œ์— ์—†์œผ๋ฉฐ, ์‹ค์ œ P ๋ฐ์ดํ„ฐ ์„ฑ๋Šฅ์ด๋‚˜ ์ œํ’ˆ ๊ฒ€์ฆ์„ ๋œปํ•˜์ง€ ์•Š๋Š”๋‹ค. LiteRT ๋ณ€ํ™˜๋„ ์•„์ง ์ˆ˜ํ–‰ํ•˜์ง€ ์•Š์•˜๋‹ค.
 
 
 
 
333
 
334
- ### Fail-closed release and export
335
 
336
- `run_math_ink_06_p_formula_release.py`๋Š” seed 17/31/47 ํ•™์Šตยท๊ฐœ๋ณ„ gate, ๋™์ผ data SHA-256 ์š”์•ฝ, single-student ์ฆ๋ฅ˜, student export๋ฅผ ์ˆœ์„œ๋Œ€๋กœ ์‹คํ–‰ํ•œ๋‹ค. ํ•œ ๋‹จ๊ณ„์˜ ์ •์‹ gate๊ฐ€ ์‹คํŒจํ•˜๋ฉด ๋‹ค์Œ ๋‹จ๊ณ„๋Š” ์‹คํ–‰ํ•˜์ง€ ์•Š๋Š”๋‹ค.
 
 
 
 
 
337
 
338
- Student export๋Š” `online adapter โ†’ formula adapter โ†’ shared classifier โ†’ family fusion` ์ˆœ์„œ๋ฅผ graph์— ํฌํ•จํ•œ๋‹ค. P trackยท์„ธ teacher lineageยท๋™์ผ corpusยทteacher weight ๋ฏธํฌํ•จ์„ ๋‹ค์‹œ ํ™•์ธํ•˜๊ณ , ์‹ค์ œ P test representative์—์„œ strict eager/export top-1 100%, logit ์ตœ๋Œ€ ์˜ค์ฐจ 0.02 ์ดํ•˜, graph 25MB ์ดํ•˜๋ฅผ ์š”๊ตฌํ•œ๋‹ค. ์‹คํŒจ fixture๋Š” ์ •์‹ export์—์„œ ๊ฑฐ๋ถ€๋œ๋‹ค. 378-label ๋ฉ”๋ชจ๋ฆฌ graph์˜ strict export ํ˜ธํ™˜์„ฑ์€ top-1 2/2ยท์˜ค์ฐจ 0์œผ๋กœ ํ™•์ธํ–ˆ์ง€๋งŒ ์‹ค์ œ LiteRT/Android ๊ฒ€์ฆ์€ ์•„๋‹ˆ๋‹ค.
339
 
340
- ### Android ODA runtime
341
 
342
- `android/aiflow-math-ink-runtime`์€ `recognizeOnline`, `recognizeRaster`, `SymbolResult`์™€ AIFlow Ink v2์˜ raw strokeยท6Hz tapยท128ร—19 ๊ณ„์•ฝ์„ ๊ตฌํ˜„ํ•œ๋‹ค. Server payload์—๋Š” ํ›„๋ณดยทconfidenceยทmodel versionยทlatency๋งŒ ํฌํ•จ๋œ๋‹ค.
 
 
 
 
343
 
344
- Android canonicalizer๋Š” Python ๋Œ€ํ‘œ 4ํ–‰ร—19์ฑ„๋„๊ณผ ์ ˆ๋Œ€์˜ค์ฐจ `1e-4` ์ด๋‚ด parity๋ฅผ ํ†ต๊ณผํ–ˆ๋‹ค. ์ตœ์‹  standalone LiteRT `CompiledModel` 2.1.6์œผ๋กœ APK asset์˜ online/raster graph๋ฅผ ์ง์ ‘ ์‹คํ–‰ํ•˜๋ฉฐ ML Kit custom model API๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค.
345
 
346
- Raster ๋ฐฐํฌ graph๋Š” exact logits๋ฟ ์•„๋‹ˆ๋ผ top-4 coordinates/state logits/progress/hypothesis scores๋ฅผ ํฌํ•จํ•œ ์ •ํ™•ํžˆ 5๊ฐœ output์„ ์š”๊ตฌํ•œ๋‹ค. `recognizeRasterDebug`๋Š” ์ด ๊ฐ’์„ ๋กœ์ปฌ์—๋งŒ ๋…ธ์ถœํ•˜๊ณ  server payload์—๋Š” ํฌํ•จํ•˜์ง€ ์•Š๋Š”๋‹ค. ์‹ค์ œ seed-17 378-labelยท76 representative strict export์—์„œ online/raster top-1 76/76, ์ตœ๋Œ€ ์˜ค์ฐจ 0.0๊ณผ ๋‹ค์„ฏ output shape๋ฅผ ํ™•์ธํ–ˆ๋‹ค.
347
 
348
- ์ด ์ €์žฅ์†Œ์˜ Colab ZIP์€ ๊ณต๊ฐœ ๊ฐ€๋Šฅํ•œ `R_public_conversion_only` ์—ฐ๊ตฌ graph๋‹ค. P student์™€ P corpus๋ฅผ ํฌํ•จํ•˜์ง€ ์•Š์œผ๋ฉฐ product bundle์ด ์•„๋‹ˆ๋‹ค. ์ œํ’ˆ์šฉ builder๋Š” ๋ณ„๋„๋กœ ์ œ๊ณตํ•˜์ง€๋งŒ ์ƒ์„ฑ๋ฌผ์—๋Š” P data๊ฐ€ ๋“ค์–ด๊ฐ€๋ฏ€๋กœ public upload์™€ server ์ „์†ก์ด ๊ธˆ์ง€๋œ๋‹ค. ์ƒˆ P student๋Š” baseยทonline adapter SHA-256๊นŒ์ง€ checkpoint lineage๋กœ ๊ฐ€์ ธ์•ผ ํ•œ๋‹ค.
349
 
350
- 3-tier benchmark runner๋Š” ๋™์ผ online/raster SHA-256 ์Œ์˜ representative๋กœ warm-up ํ›„ ๊ฐ 100ํšŒ, PSS, battery charge-counter delta๋ฅผ ์ธก์ •ํ•œ๋‹ค. ๊ฐœ๋ณ„ hash๋Š” ์ˆœ์„œ๊ฐ€ ๊ณ ์ •๋œ bundle SHA-256์œผ๋กœ๋„ ๋ฌถ๋Š”๋‹ค. Python ์š”์•ฝ๊ธฐ๋Š” low/mid/high๊ฐ€ ์ •ํ™•ํžˆ ํ•˜๋‚˜์”ฉ์ด๊ณ  versionยท๊ฐœ๋ณ„ hashยทbundle hash๊ฐ€ ๋™์ผํ•  ๋•Œ๋งŒ online p95 50ms, raster p95 200ms, PSS 100MiB, battery ๊ณ„์ธก gate๋ฅผ AND๋กœ ๊ฒฐํ•ฉํ•œ๋‹ค. ์ตœ์ข… product manifest๋Š” P 3-seed, ๋ฐฐํฌ raster ํ’ˆ์งˆ, LiteRT model pair, Android 3-tier์˜ ๋™์ผ lineage๋ฅผ ๋‹ค์‹œ ํ™•์ธํ•œ๋‹ค. Kotlin unit test 8๊ฐœ์™€ ์ „์ฒด Python ํšŒ๊ท€ 355๊ฐœ, release AAR build๊ฐ€ ํ†ต๊ณผํ–ˆ๋‹ค. AAR์€ 84,436 bytes, SHA-256 `2c65d4af59af1204fad66eff15bec5ef125dfa242da82d05b0e85cf99504c44d`์ด๋ฉฐ ๋ชจ๋ธ์„ ํฌํ•จํ•˜์ง€ ์•Š๋Š”๋‹ค. ์‹ค์ œ flatbufferยท๊ธฐ๊ธฐ benchmark ๊ฐ’์€ ์•„์ง ์—†๋‹ค.
 
 
 
 
351
 
352
- ## ์•Œ๋ ค์ง„ ํ•œ๊ณ„
353
 
354
- - 378-label paired writer/device-disjoint top-1 ๋ชฉํ‘œ 92%์— ์•„์ง ๋ฏธ๋‹ฌํ•œ๋‹ค.
355
- - ์ „์ฒด ์ˆ˜์‹ LaTeX, Tray decoder, gridding์€ 0.7 ๋ฒ”์œ„๋‹ค.
356
- - uppercase ์—ญํ•  recall๊ณผ `O/0`, styled-letter hard family๊ฐ€ ๋‚จ์€ ๋ณ‘๋ชฉ์ด๋‹ค.
357
- - ํ–‰๋™ exact gate๋Š” ์œ ํšจํ•˜์ง€๋งŒ, ์—ฐ์†์‹ teacher ํ˜•ํƒœ๊ตฐ์ด ํ‹€๋ฆฌ๋ฉด ์—ญํ•  head๊ฐ€ ๋ณต๊ตฌํ•  ์ˆ˜ ์—†๋‹ค.
358
- - R-track formula adapter๋Š” validation ํ˜•ํƒœ๊ตฐ 93.30%๋ฅผ ๋‹ฌ์„ฑํ–ˆ์œผ๋‚˜ official test 88.17%์— ๊ทธ์ณ ์ œํ’ˆ ๊ฒ€์ฆ์„ ํ†ต๊ณผํ•˜์ง€ ๋ชปํ–ˆ๋‹ค.
359
- - ์Šน์ธ P ๊ณ ๋ฆฝ๊ธฐํ˜ธ ํ•ฉ์„ฑ ํ–‰๋™ proxy๋Š” layout SMD ์ตœ๋Œ€ 2.82์™€ uppercase recall ํ•˜๋ฝ ๋•Œ๋ฌธ์— ๊ธฐ๊ฐํ–ˆ๋‹ค.
360
- - raster virtual-stroke ๊ฒฝ๋กœ๋Š” digit/Greek slice์—์„œ๋Š” ๊ฐœ์„ ๋์ง€๋งŒ 378-label release gate๋ฅผ ํ†ต๊ณผํ•˜์ง€ ๋ชปํ–ˆ๋‹ค.
361
- - boundary/behavior/formula adapter๋Š” CROHME R-track ํ•™์Šต๋ฌผ์ด๋ฏ€๋กœ ์ œํ’ˆ weight๋กœ distillํ•  ์ˆ˜ ์—†๋‹ค.
362
- - P boundary auxiliary/joint๋Š” shared-state ์ •์ • ํ›„ ์„ธ seed release gate๋ฅผ ์‹คํŒจํ•ด checkpoint๋ฅผ ์ฒ ํšŒํ–ˆ๋‹ค.
363
- - Device stress๋Š” ์ฑ„ํƒ๋˜์ง€ ์•Š์€ shadow auxiliary์˜ software perturbation ๊ฒฐ๊ณผ์ด๋ฉฐ ์‹ค์ œ stylus/device-disjoint ์„ฑ๋Šฅ ๊ทผ๊ฑฐ๊ฐ€ ์•„๋‹ˆ๋‹ค.
364
- - Android LiteRT ๋ณ€ํ™˜, PyTorch/LiteRT logit parity, ์ €๊ฐ€ยท์ค‘๊ธ‰ยท๊ณ ๊ธ‰ ๊ธฐ๊ธฐ benchmark๊ฐ€ ๋‚จ์•„ ์žˆ๋‹ค.
365
 
366
- ## ๋ฐ์ดํ„ฐ์™€ ๊ถŒ๋ฆฌ
367
 
368
- ์ด ์ €์žฅ์†Œ์—๋Š” ์›๋ณธ ํ•„๊ธฐ ๋ฐ์ดํ„ฐ, ์ด๋ฏธ์ง€, OCR cache๋ฅผ ํฌํ•จํ•˜์ง€ ์•Š๋Š”๋‹ค.
369
 
370
- - HWRT database: ODbL-1.0 ์ทจ๊ธ‰, attribution ๋ฐ ํŒŒ์ƒ database ๊ฒ€ํ†  ํ•„์š”
371
- - UJI/Pendigits ๊ณ„์—ด: ๊ฐ ์› ์ถœ์ฒ˜ ์กฐ๊ฑด์„ ๋ณ„๋„๋กœ ๋”ฐ๋ผ์•ผ ํ•จ
372
- - CROHME/MathWriting: ๋น„์ƒ์—… R-track ํ‰๊ฐ€ ๋˜๋Š” ์—ฐ๊ตฌ head์—๋งŒ ์‚ฌ์šฉ
373
- - checkpoint์™€ report๋Š” ํ˜„์žฌ **research-only / non-commercial** ๊ณต๊ฐœ๋ฌผ์ด๋‹ค.
374
- - ์ƒ์šฉ checkpoint๋Š” ๊ถŒ๋ฆฌ ๊ฒ€ํ† ๋ฅผ ํ†ต๊ณผํ•œ P-track ๋ฐ์ดํ„ฐ๋กœ ์ฒ˜์Œ๋ถ€ํ„ฐ ์žฌํ•™์Šตํ•ด์•ผ ํ•œ๋‹ค.
375
 
376
- ์ด ๊ณต๊ฐœ๋Š” ์ œํ’ˆ ์ •ํ™•๋„ยท์ƒ์šฉ ๋ฐฐํฌ ๊ฐ€๋Šฅ์„ฑยทLiteRT ํ˜ธํ™˜์„ฑ์„ ๋ณด์ฆํ•˜์ง€ ์•Š๋Š”๋‹ค.
 
 
 
 
377
 
378
- ## ๋ณด์•ˆ
379
 
380
- PyTorch checkpoint์™€ joblib/pickle์€ ์‹ ๋ขฐํ•  ์ˆ˜ ์—†๋Š” ์ถœ์ฒ˜์—์„œ ๋กœ๋“œํ•˜๋ฉด ์ž„์˜ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋‹ค. `MANIFEST.json`์˜ SHA-256์„ ํ™•์ธํ•˜๊ณ  ์‹ ๋ขฐ๋œ ํ™˜๊ฒฝ์—์„œ๋งŒ ์‚ฌ์šฉํ•œ๋‹ค.
 
 
 
 
381
 
382
  ## ์—ฐ๊ตฌ ์ž๋ฃŒ
383
 
384
- - ์ „์ฒด ๊ธฐ์ˆ  ๋ณด๊ณ ์„œ: [`reports/RESEARCH_REPORT.md`](reports/RESEARCH_REPORT.md)
385
- - boundary ํ•™์Šต ๊ฒฐ๊ณผ: [`reports/boundary_behavior_guard_report.json`](reports/boundary_behavior_guard_report.json)
386
- - 3-seed ํ–‰๋™ head: [`reports/behavior_role_3seed_summary.json`](reports/behavior_role_3seed_summary.json)
387
- - P boundary ์ •์ • 3-seed: [`reports/p_boundary_joint_sharedfix_3seed_summary.json`](reports/p_boundary_joint_sharedfix_3seed_summary.json)
388
- - ์ •์ • main device stress: [`reports/p_boundary_device_stress_sharedfix_3seed.json`](reports/p_boundary_device_stress_sharedfix_3seed.json)
389
- - Seed-17 composite export: [`exports/seed17/export_manifest.json`](exports/seed17/export_manifest.json)
390
- - Composite CPU benchmark: [`reports/composite_cpu_benchmark.json`](reports/composite_cpu_benchmark.json)
391
- - Online 3-seed ์˜ค๋ฅ˜ ํ•ฉ์˜: [`reports/online_error_consensus_paired_test_3seed.json`](reports/online_error_consensus_paired_test_3seed.json)
392
- - Online family-fusion calibration: [`reports/online_family_fusion_calibration_3seed.json`](reports/online_family_fusion_calibration_3seed.json)
393
- - ํ–‰๋™ exact gate 3-seed: [`reports/behavior_exact_gate_3seed.json`](reports/behavior_exact_gate_3seed.json)
394
- - ์ˆ˜์‹ context ๊ณ„์•ฝ ๊ฐ์‚ฌ: [`reports/formula_context_contract_3seed.json`](reports/formula_context_contract_3seed.json)
395
- - R-track ์ˆ˜์‹ ์–ด๋Œ‘ํ„ฐ 3-seed: [`reports/formula_adapter_h64_3seed_summary.json`](reports/formula_adapter_h64_3seed_summary.json)
396
- - P ํ•ฉ์„ฑ ํ–‰๋™ proxy seed-17 ์‹คํŒจ: [`reports/behavior_role_p_proxy_w035_seed17.json`](reports/behavior_role_p_proxy_w035_seed17.json)
397
- - P ํ•ฉ์„ฑ ๋ฐฐ์น˜ ๋ถ„ํฌ ๊ฐ์‚ฌ: [`reports/p_proxy_shift_seed17.json`](reports/p_proxy_shift_seed17.json)
398
- - LiteRT Colab notebook: [`colab/AIFlow_Math_Ink_06_LiteRT.ipynb`](colab/AIFlow_Math_Ink_06_LiteRT.ipynb)
399
- - ์‹ค์ œ P formula schema: [`contracts/aiflow_p_formula_v1.schema.json`](contracts/aiflow_p_formula_v1.schema.json)
400
- - P formula ์‚ฌ๋žŒ annotation schema: [`contracts/aiflow_p_formula_annotation_v1.schema.json`](contracts/aiflow_p_formula_annotation_v1.schema.json)
401
- - P-only formula ํ•™์Šต recipe: [`configs/MATH-INK-06-P-FORMULA-v1.json`](configs/MATH-INK-06-P-FORMULA-v1.json)
402
- - P-only formula student distiller: [`scripts/distill_math_ink_06_p_formula_student.py`](scripts/distill_math_ink_06_p_formula_student.py)
403
- - P-only formula student exporter: [`scripts/export_math_ink_06_p_formula_student.py`](scripts/export_math_ink_06_p_formula_student.py)
404
- - Fail-closed P release driver: [`scripts/run_math_ink_06_p_formula_release.py`](scripts/run_math_ink_06_p_formula_release.py)
405
- - Android ODA runtime source: [`android/README.md`](android/README.md)
406
- - ํŒŒ์ผ checksum: [`MANIFEST.json`](MANIFEST.json)
 
16
 
17
  # AIFlow Math Ink 0.6
18
 
19
+ AIFlow Math Ink 0.6์€ ์ˆ˜ํ•™ ํ•„๊ธฐ๋ฅผ **์ด๋ฏธ์ง€๋ณด๋‹ค stroke trajectory๋กœ ๋จผ์ € ํ•ด์„ํ•˜๋Š”** PyTorch ์—ฐ๊ตฌ ๋ชจ๋ธ์ด๋‹ค.
20
 
21
+ ์˜จ๋ผ์ธ ํŽœ ์ž…๋ ฅ์„ ์‹œ๊ฐ„ ์ˆœ์„œ๊ฐ€ ์žˆ๋Š” point sequence๋กœ ํ‘œํ˜„ํ•˜๊ณ , ๊ฐ ๊ณ ๋ฆฝ ๊ธฐํ˜ธ์— ๋Œ€ํ•ด ๋‹ค์Œ ๋‘ ์ข…๋ฅ˜์˜ ํ™•๋ฅ ์„ ์˜ˆ์ธกํ•œ๋‹ค.
22
+
23
+ - 378๊ฐœ exact symbol label
24
+ - 324๊ฐœ visual family
25
+
26
+ ํ•ต์‹ฌ ์—ฐ๊ตฌ ์ฃผ์ œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
27
+
28
+ 1. ์„œ๋กœ ๋‹ค๋ฅธ ํ•„๊ธฐ ์†๋„๋ฅผ ์ผ์ •ํ•œ temporal representation์œผ๋กœ ์ •๊ทœํ™”ํ•˜๋Š” ๋ฐฉ๋ฒ•
29
+ 2. ์˜จ๋ผ์ธ stroke์™€ raster ์ด๋ฏธ์ง€๋ฅผ ํ•˜๋‚˜์˜ trajectory encoder๋กœ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฐฉ๋ฒ•
30
+ 3. ์‹œ๊ฐ์ ์œผ๋กœ ์œ ์‚ฌํ•œ ๊ธฐํ˜ธ์˜ ํ˜•ํƒœ์™€ ์˜๋ฏธ๋ฅผ ๋ถ„๋ฆฌํ•˜๋Š” ๋ฐฉ๋ฒ•
31
+ 4. ๊ธฐํ˜ธ ๋ถ„๋ฅ˜์™€ ์ˆ˜์‹ ๋ฌธ๋งฅ์„ ๊ฒฐํ•ฉํ•˜๋Š” ๋ฐฉ๋ฒ•
32
 
33
  ![AIFlow Math Ink 0.6 architecture](assets/architecture.svg)
34
 
35
+ ## ์—ฐ๊ตฌ ์•„์ด๋””์–ด
36
 
37
+ ### 1. Trajectory-first representation
38
 
39
+ ์ผ๋ฐ˜์ ์ธ ์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜ ๋ฐฉ์‹์€ ํ•„๊ธฐ๋ฅผ ๊ณ ์ •๋œ bitmap์œผ๋กœ ๋ณ€ํ™˜ํ•˜๋ฉด์„œ stroke ์ˆœ์„œ์™€ ์‹œ๊ฐ„ ์ •๋ณด๋ฅผ ์ œ๊ฑฐํ•œ๋‹ค.
40
+
41
+ AIFlow Math Ink๋Š” ํ•„๊ธฐ๋ฅผ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์‹œ๊ณ„์—ด๋กœ ํ‘œํ˜„ํ•œ๋‹ค.
 
 
 
42
 
43
+ ```text
44
+ pointโ‚ โ†’ pointโ‚‚ โ†’ pointโ‚ƒ โ†’ ... โ†’ pen-up
45
+ ```
46
 
47
+ ๊ฐ point์—๋Š” ์œ„์น˜๋ฟ ์•„๋‹ˆ๋ผ ๋‹ค์Œ ์ •๋ณด๊ฐ€ ํฌํ•จ๋œ๋‹ค.
48
 
49
+ - ์ด๋™ ๋ฐฉํ–ฅ
50
+ - ๊ณก๋ฅ 
51
+ - ํ•„๊ธฐ ์†๋„
52
+ - stroke ๋‚ด๋ถ€ ์ง„ํ–‰๋ฅ 
53
+ - pen-up ์ƒํƒœ
54
+ - ์ „์ฒด ๊ธฐํ˜ธ ์•ˆ์—์„œ์˜ ์ƒ๋Œ€ ์œ„์น˜
55
+ - timestamp ๊ด€์ธก ์—ฌ๋ถ€
56
 
57
+ ์ด ํ‘œํ˜„์€ ๊ฐ™์€ ๋ชจ์–‘์ด๋ผ๋„ stroke ์ˆœ์„œ์™€ ์›€์ง์ž„์ด ๋‹ค๋ฅธ ํ•„๊ธฐ๋ฅผ ๊ตฌ๋ถ„ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•œ๋‹ค.
58
 
59
+ ### 2. Canonical temporal sampling
60
 
61
+ ์‚ฌ๋žŒ๋งˆ๋‹ค ํ•„๊ธฐ ์†๋„์™€ touch event ๋ฐœ์ƒ ๋นˆ๋„๊ฐ€ ๋‹ค๋ฅด๊ธฐ ๋•Œ๋ฌธ์— ์›๋ณธ event ๊ฐœ์ˆ˜๋Š” ์ผ์ •ํ•˜์ง€ ์•Š๋‹ค.
62
 
63
+ ๋ชจ๋ธ์€ ๊ฐ stroke๋ฅผ 6Hz canonical timeline์œผ๋กœ ์žฌํ‘œ๋ณธํ™”ํ•œ๋‹ค. ์ด๋•Œ ๋‹ค์Œ anchor๋Š” ํ•ญ์ƒ ๋ณด์กดํ•œ๋‹ค.
 
 
 
 
64
 
65
+ - stroke ์‹œ์ž‘์ 
66
+ - stroke ๋์ 
67
+ - pen-up
68
+ - ์›๋ณธ timestamp
69
+
70
+ ์ด๋ฅผ ํ†ตํ•ด ๋น ๋ฅด๊ฒŒ ์“ด ๊ธฐํ˜ธ์™€ ๋А๋ฆฌ๊ฒŒ ์“ด ๊ธฐํ˜ธ๋ฅผ ๋น„์Šทํ•œ temporal scale์—์„œ ๋น„๊ตํ•  ์ˆ˜ ์žˆ๋‹ค.
71
 
72
  ```text
73
+ Raw touch events
74
+ โ†’ stroke anchor preservation
75
+ โ†’ 6 Hz canonical sampling
76
+ โ†’ maximum 128 events
 
 
 
 
77
  ```
78
 
79
+ ์›๋ณธ touch event๋Š” ๊ทธ๋Œ€๋กœ ์œ ์ง€ํ•˜๊ณ , ์žฌํ‘œ๋ณธํ™”๋œ sequence๋Š” ๋ชจ๋ธ ์ž…๋ ฅ์šฉ view๋กœ ์‚ฌ์šฉํ•œ๋‹ค.
 
 
80
 
81
+ ### 3. Shape coordinate์™€ canvas coordinate์˜ ๋ถ„๋ฆฌ
82
+
83
+ ๊ธฐํ˜ธ์˜ ๋ชจ์–‘๊ณผ ์ˆ˜์‹ ์•ˆ์—์„œ์˜ ์œ„์น˜๋Š” ์„œ๋กœ ๋‹ค๋ฅธ ์ •๋ณด๋ฅผ ๊ฐ€์ง„๋‹ค.
84
+
85
+ AIFlow Math Ink๋Š” ๋‘ ์ขŒํ‘œ๊ณ„๋ฅผ ๋™๏ฟฝ๏ฟฝ๏ฟฝ์— ์‚ฌ์šฉํ•œ๋‹ค.
86
 
87
  ```text
88
+ shape_x, shape_y
89
+ ```
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
+ ๊ธฐํ˜ธ ์ž์ฒด์˜ bounding box๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์ •๊ทœํ™”ํ•œ ์ขŒํ‘œ๋‹ค. ๊ธ€์ž์˜ ํฌ๊ธฐ์™€ ์œ„์น˜ ์˜ํ–ฅ์„ ์ค„์ด๊ณ  ์ˆœ์ˆ˜ํ•œ ํ˜•ํƒœ๋ฅผ ํ‘œํ˜„ํ•œ๋‹ค.
 
 
92
 
93
+ ```text
94
+ canvas_x, canvas_y
 
95
  ```
96
 
97
+ ์ „์ฒด canvas ๋˜๋Š” ์ˆ˜์‹ ์˜์—ญ์„ ๊ธฐ์ค€์œผ๋กœ ํ•œ ์ขŒํ‘œ๋‹ค. ๊ธฐํ˜ธ์˜ ์ƒ๋Œ€ ํฌ๊ธฐ์™€ ์ˆ˜์ง ์œ„์น˜๋ฅผ ๋ณด์กดํ•œ๋‹ค.
98
+
99
+ ์˜ˆ๋ฅผ ๋“ค์–ด ์†Œ๋ฌธ์ž `x`, ๋Œ€๋ฌธ์ž `X`, ๊ณฑ์…ˆ ๊ธฐํ˜ธ `ร—`๋Š” ๋ชจ์–‘์ด ๋น„์Šทํ•˜์ง€๋งŒ ์ˆ˜์‹ ์•ˆ์—์„œ์˜ ํฌ๊ธฐ์™€ ์œ„์น˜ ๋ถ„ํฌ๊ฐ€ ๋‹ค๋ฅผ ์ˆ˜ ์žˆ๋‹ค. ๋‘ ์ขŒํ‘œ๊ณ„๋ฅผ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜๋ฉด ํ˜•ํƒœ์™€ ๋ฌธ๋งฅ์„ ๋ถ„๋ฆฌํ•ด ํ•™์Šตํ•  ์ˆ˜ ์žˆ๋‹ค.
100
+
101
+ ### 4. Online๊ณผ raster์˜ ๊ณตํ†ต trajectory space
102
 
103
+ ์˜จ๋ผ์ธ ์ž…๋ ฅ์—๋Š” stroke sequence๊ฐ€ ์ง์ ‘ ์กด์žฌํ•˜์ง€๋งŒ, raster ์ด๋ฏธ์ง€์—๋Š” stroke ์ˆœ์„œ๊ฐ€ ์—†๋‹ค.
104
 
105
+ Raster ๊ฒฝ๋กœ๋Š” ์ด๋ฏธ์ง€๋ฅผ ๊ณง๋ฐ”๋กœ symbol label๋กœ ๋ถ„๋ฅ˜ํ•˜๋Š” ๋Œ€์‹ , ์ด๋ฏธ์ง€์—์„œ ์—ฌ๋Ÿฌ ๊ฐœ์˜ virtual trajectory๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.
106
 
107
  ```text
108
+ Raster image
109
+ โ†’ spatial encoder
110
+ โ†’ virtual-trajectory decoder
111
+ โ†’ top-4 stroke hypotheses
112
+ โ†’ shared trajectory encoder
 
 
 
 
 
 
113
  ```
114
 
115
+ ๊ฐ hypothesis๋Š” ๋‹ค์Œ ์ •๋ณด๋ฅผ ํฌํ•จํ•œ๋‹ค.
 
 
 
 
 
116
 
117
+ - virtual stroke coordinates
118
+ - stroke state
119
+ - progress
120
+ - hypothesis score
121
 
122
+ ์ดํ›„ ์˜จ๋ผ์ธ ์ž…๋ ฅ๊ณผ ๋™์ผํ•œ residual TCN์ด virtual trajectory๋ฅผ ์ฒ˜๋ฆฌํ•œ๋‹ค.
123
 
124
+ ์ด ๊ตฌ์กฐ์˜ ๋ชฉ์ ์€ ์ž…๋ ฅ modality๊ฐ€ ๋‹ฌ๋ผ๋„ ์ตœ์ข… ์ธ์‹์€ ๋™์ผํ•œ trajectory representation ์œ„์—์„œ ์ˆ˜ํ–‰ํ•˜๋Š” ๊ฒƒ์ด๋‹ค.
125
 
126
+ ### 5. Exact label๊ณผ visual family์˜ ๊ณ„์ธต์  ์˜ˆ์ธก
 
 
127
 
128
+ ์ˆ˜ํ•™ ๊ธฐํ˜ธ์—๋Š” ํ˜•ํƒœ๊ฐ€ ๊ฑฐ์˜ ๋™์ผํ•˜์ง€๋งŒ ์˜๋ฏธ๊ฐ€ ๋‹ค๋ฅธ ๊ฒฝ์šฐ๊ฐ€ ๋งŽ๋‹ค.
129
 
130
+ ์˜ˆ:
 
 
131
 
132
+ ```text
133
+ O / 0 / o
134
+ x / X / ร—
135
+ | / 1 / l
 
136
  ```
137
 
138
+ ๋ชจ๋ธ์€ ์ด๋ฅผ ํ•˜๋‚˜์˜ ๋ถ„๋ฅ˜ ๋ฌธ์ œ๋กœ๋งŒ ๋‹ค๋ฃจ์ง€ ์•Š๊ณ  ๋‘ ๊ฐœ์˜ prediction head๋กœ ๋‚˜๋ˆˆ๋‹ค.
139
 
140
+ ```text
141
+ Shared trajectory representation
142
+ โ”œโ”€ exact head: 378 labels
143
+ โ””โ”€ family head: 324 visual families
144
+ ```
145
 
146
+ Exact head๋Š” ์ตœ์ข… symbol token์„ ์˜ˆ์ธกํ•œ๋‹ค.
 
 
 
147
 
148
+ Family head๋Š” ์‹œ๊ฐ์ ์œผ๋กœ ๊ฐ€๊นŒ์šด ๊ธฐํ˜ธ ์ง‘ํ•ฉ์„ ์˜ˆ์ธกํ•œ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด trajectory encoder๊ฐ€ ํ˜•ํƒœ๋ฅผ ๋จผ์ € ์•ˆ์ •์ ์œผ๋กœ ๊ตฌ๋ถ„ํ•˜๊ณ , ์ •ํ™•ํ•œ ์˜๋ฏธ ์„ ํƒ์€ ๋ณ„๋„์˜ ๋ฌธ๋งฅ ์ •๋ณด์™€ ๊ฒฐํ•ฉํ•  ์ˆ˜ ์žˆ๋‹ค.
149
+
150
+ ### 6. Formula-context behavior modeling
151
+
152
+ ๊ณ ๋ฆฝ ๊ธฐํ˜ธ์˜ trajectory๋งŒ์œผ๋กœ ๊ตฌ๋ถ„ํ•˜๊ธฐ ์–ด๋ ค์šด ๊ธฐํ˜ธ์—๋Š” ์ˆ˜์‹ ๋ฌธ๋งฅ์„ ์ถ”๊ฐ€ํ•œ๋‹ค.
153
+
154
+ Behavior head๋Š” ๋‹ค์Œ ๋‘ ํ‘œํ˜„์„ ๊ฒฐํ•ฉํ•œ๋‹ค.
155
+
156
+ ```text
157
+ 128ร—19 stroke representation
158
+ +
159
+ 49-dimensional formula context
160
  ```
161
 
162
+ Context feature์—๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ •๋ณด๊ฐ€ ํฌํ•จ๋œ๋‹ค.
163
 
164
+ - ์ˆ˜์‹ ์ „์ฒด ํฌ๊ธฐ ๋Œ€๋น„ ๊ธฐํ˜ธ ํฌ๊ธฐ
165
+ - baseline๊ณผ์˜ ์ƒ๋Œ€ ์œ„์น˜
166
+ - ์ฃผ๋ณ€ ๊ธฐํ˜ธ์˜ ์œ„์น˜์™€ ๊ฐ„๊ฒฉ
167
+ - symbol group geometry
168
+ - ์ด์›ƒ token ํŒจํ„ด
169
 
170
+ ํ˜„์žฌ behavior head์˜ ๋Œ€ํ‘œ ์—ญํ•  ๋ถ„๋ฅ˜๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.
171
 
172
+ ```text
173
+ identifier_lower
174
+ identifier_upper
175
+ multiply_operator
176
+ ```
177
 
178
+ ์˜ˆ๋ฅผ ๋“ค์–ด `x`, `X`, `ร—`์˜ trajectory๊ฐ€ ๋น„์Šทํ•  ๋•Œ, ๊ธฐํ˜ธ์˜ ์ƒ๋Œ€ ํฌ๊ธฐ์™€ ์ฃผ๋ณ€ token์„ ์ด์šฉํ•ด ์—ญํ• ์„ ์„ ํƒํ•œ๋‹ค.
 
 
 
179
 
180
+ ### 7. Boundary behavior modeling
181
 
182
+ ์ˆ˜์‹ ์ธ์‹์—์„œ๋Š” ์—ฌ๋Ÿฌ stroke๋ฅผ ํ•˜๋‚˜์˜ ๊ธฐํ˜ธ๋กœ ๋ฌถ๋Š” grouping ๊ณผ์ •์ด ํ•„์š”ํ•˜๋‹ค.
183
 
184
+ Boundary behavior head๋Š” segmentation candidate๊ฐ€ ์‹ค์ œ ๊ธฐํ˜ธ ๊ฒฝ๊ณ„๋ฅผ ๊ฐ€๋กœ์ง€๋ฅด๋Š”์ง€๋ฅผ geometry feature๋กœ ์˜ˆ์ธกํ•œ๋‹ค.
185
 
186
+ ```text
187
+ Segmentation lattice geometry
188
+ โ†’ 17-dimensional boundary features
189
+ โ†’ boundary behavior score
190
+ ```
 
 
 
191
 
192
+ ์ด score๋Š” ๊ฐ€๊นŒ์ด ์žˆ๋Š” ๋‘ ๊ธฐํ˜ธ๊ฐ€ ํ•˜๋‚˜์˜ symbol group์œผ๋กœ ํ•ฉ์ณ์ง€๋Š” overmerge๋ฅผ ์–ต์ œํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋œ๋‹ค.
193
 
194
+ ## ์ž…๋ ฅ ํ‘œํ˜„
195
 
196
+ ๋ชจ๋ธ ์ž…๋ ฅ์€ ์ตœ๋Œ€ 128๊ฐœ์˜ event์™€ 19๊ฐœ์˜ feature๋กœ ๊ตฌ์„ฑ๋œ๋‹ค.
197
 
198
+ ```text
199
+ input shape: 128 ร— 19
200
+ sample rate: 6 Hz
201
+ normalized ink space: 128 ร— 128
202
+ ```
 
 
203
 
204
+ ![Stroke encoding](assets/stroke_encoding.svg)
205
 
206
+ ### 19 input channels
207
 
208
+ ```text
209
+ shape_x, shape_y,
210
+ canvas_x, canvas_y,
211
+ direction_x, direction_y,
212
+ curvature, pen_up, stroke_progress,
213
+ aspect_ratio,
214
+ bbox_top, bbox_bottom, bbox_height, center_y,
215
+ baseline_available,
216
+ time_delta, speed, missing_mask, source_modality
217
+ ```
218
 
219
+ | Feature group | ์—ญํ•  |
220
+ |---|---|
221
+ | `shape_x`, `shape_y` | ๊ธฐํ˜ธ ๋‚ด๋ถ€์˜ ์ •๊ทœํ™”๋œ ํ˜•ํƒœ |
222
+ | `canvas_x`, `canvas_y` | ์ „์ฒด canvas ์•ˆ์—์„œ์˜ ์ƒ๋Œ€ ์œ„์น˜ |
223
+ | `direction_x`, `direction_y` | point ์ด๋™ ๋ฐฉํ–ฅ |
224
+ | `curvature` | stroke์˜ ๊ตญ์†Œ ๊ณก๋ฅ  |
225
+ | `pen_up` | stroke ๊ฒฝ๊ณ„ |
226
+ | `stroke_progress` | stroke ์‹œ์ž‘๋ถ€ํ„ฐ ๋๊นŒ์ง€์˜ ์ง„ํ–‰๋„ |
227
+ | `aspect_ratio` | ๊ธฐํ˜ธ bounding box ๋น„์œจ |
228
+ | `bbox_*`, `center_y` | ์ˆ˜์‹ ์•ˆ์—์„œ์˜ geometry |
229
+ | `baseline_available` | baseline feature์˜ ์œ ํšจ์„ฑ |
230
+ | `time_delta`, `speed` | temporal dynamics |
231
+ | `missing_mask` | ๊ด€์ธก๋˜์ง€ ์•Š์€ ์‹œ๊ฐ„ ์ •๋ณด ํ‘œ์‹œ |
232
+ | `source_modality` | online ๋˜๋Š” raster ์ž…๋ ฅ ๊ตฌ๋ถ„ |
233
+
234
+ Timestamp๊ฐ€ ์กด์žฌํ•˜๋Š” ์ž…๋ ฅ์€ ๊ด€์ธก๋œ ์‹œ๊ฐ„ ์ฐจ์ด์™€ ์†๋„๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค. ์ •์  ์ด๋ฏธ์ง€์—์„œ ์ƒ์„ฑ๋œ virtual trajectory๋Š” canonical timing๊ณผ missingness ์ •๋ณด๋ฅผ ํ•จ๊ป˜ ์‚ฌ์šฉํ•œ๋‹ค.
235
 
236
+ ## ๋ชจ๋ธ ๊ตฌ์กฐ
237
 
238
+ ```text
239
+ Online strokes
240
+ โ†’ canonical sampler
241
+ โ†’ 128ร—19 sequence
242
+ โ†’ dual-TCN online adapter
243
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
244
+ โ”‚
245
+ Raster 128ร—128 โ”‚
246
+ โ†’ spatial encoder โ”‚
247
+ โ†’ causal virtual-trajectory decoder โ”‚
248
+ โ†’ top-4 trajectory hypotheses โ”‚
249
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
250
+ โ–ผ
251
+ shared residual TCN
252
+ โ”œโ”€ exact head
253
+ โ””โ”€ visual-family head
254
+ ```
255
 
256
+ ์ฃผ์š” ์„ค์ •:
257
 
258
+ | ํ•ญ๋ชฉ | ๊ฐ’ |
259
+ |---|---:|
260
+ | Maximum events | 128 |
261
+ | Input features | 19 |
262
+ | Shared hidden size | 128 |
263
+ | Exact labels | 378 |
264
+ | Visual families | 324 |
265
+ | Raster hypotheses | 4 |
266
+ | Canonical sample rate | 6Hz |
267
 
268
+ ### Dual-TCN online adapter
269
 
270
+ ์˜จ๋ผ์ธ ์ž…๋ ฅ์€ ๋‘ ์ข…๋ฅ˜์˜ temporal pattern์„ ํ•จ๊ป˜ ์ฒ˜๋ฆฌํ•œ๋‹ค.
271
+
272
+ - ๊ธฐํ˜ธ ์ „์ฒด์˜ ๊ธด stroke ํ๋ฆ„
273
+ - point ์‚ฌ์ด์˜ ์งง์€ ๊ตญ์†Œ ๋ณ€ํ™”
 
 
274
 
275
+ Dual-TCN adapter๋Š” ์„œ๋กœ ๋‹ค๋ฅธ receptive field๋ฅผ ๊ฐ€์ง„ temporal convolution์„ ๊ฒฐํ•ฉํ•ด ์ด ๋‘ ํŒจํ„ด์„ ํ‘œํ˜„ํ•œ๋‹ค.
276
 
277
+ Adapter์˜ shared state๋Š” base trajectory encoder์™€ ํ•จ๊ป˜ ํ•ฉ์„ฑ๋œ๋‹ค.
278
 
279
+ ```text
280
+ base trajectory state
281
+ โ†’ online shared state
282
+ โ†’ modality-specific adaptation
283
+ โ†’ classifier heads
284
+ ```
285
 
286
+ ## Checkpoints
287
 
288
+ ๊ฐ seed๋Š” ๋‹ค์Œ ์„ธ ํŒŒ์ผ๋กœ ๊ตฌ์„ฑ๋œ๋‹ค.
289
 
290
+ ```text
291
+ models/
292
+ seed17/
293
+ base_378.pt
294
+ online_adapter.pt
295
+ behavior_role_head.pt
296
+ seed31/
297
+ base_378.pt
298
+ online_adapter.pt
299
+ behavior_role_head.pt
300
+ seed47/
301
+ base_378.pt
302
+ online_adapter.pt
303
+ behavior_role_head.pt
304
+ ```
305
 
306
+ | ํŒŒ์ผ | ๋‚ด์šฉ |
307
+ |---|---|
308
+ | `base_378.pt` | ๊ณตํ†ต trajectory encoder, raster encoder, exact/family classifier |
309
+ | `online_adapter.pt` | ์‹ค์ œ online stroke์— ๋Œ€ํ•œ dual-TCN adaptation |
310
+ | `behavior_role_head.pt` | ๊ธฐํ˜ธ์˜ ์ˆ˜์‹ ๋‚ด ์—ญํ• ์„ ๋ถ„๋ฅ˜ํ•˜๋Š” context head |
311
 
312
+ ์„ธ seed๋Š” ์„œ๋กœ ๋‹ค๋ฅธ ์ดˆ๊ธฐํ™”์—์„œ ํ•™์Šต๋˜์–ด ๋ชจ๋ธ ๊ฐ„ ์˜ค๋ฅ˜ ํ•ฉ์˜์™€ ensemble ํŠน์„ฑ์„ ๋ถ„์„ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋œ๋‹ค.
313
 
314
+ ## ์‚ฌ์šฉ ์˜ˆ์‹œ
315
 
316
+ ```python
317
+ from pathlib import Path
318
+ from math_grid_drawer.research.math_ink_06 import MathInk06Engine
 
 
 
 
319
 
320
+ root = Path("models/seed17")
321
 
322
+ engine = MathInk06Engine(
323
+ root / "base_378.pt",
324
+ adapter_checkpoint=root / "online_adapter.pt",
325
+ )
326
 
327
+ result = engine.recognize_online(
328
+ strokes,
329
+ canvas_width=128,
330
+ canvas_height=128,
331
+ top_k=5,
332
+ )
333
+ ```
334
 
335
+ ์ถœ๋ ฅ์—๋Š” exact symbol ํ›„๋ณด์™€ ๊ฐ ํ›„๋ณด์˜ ํ™•๋ฅ ์ด ํฌํ•จ๋œ๋‹ค.
336
 
337
+ ```python
338
+ for candidate in result.candidates:
339
+ print(candidate.token, candidate.probability)
 
 
 
 
 
 
340
  ```
341
 
342
+ ## ์—ฐ๊ตฌ ๊ฒฐ๊ณผ
343
 
344
+ ### ๊ณ ๋ฆฝ ๊ธฐํ˜ธ trajectory classification
345
 
346
+ Seed 17์˜ writer-disjoint ํ‰๊ฐ€ ๊ฒฐ๊ณผ:
347
 
348
+ | Split | Exact top-1 | Exact top-5 | Family top-1 |
349
+ |---|---:|---:|---:|
350
+ | Writer validation, 4,261 samples | 86.13% | 99.48% | 92.94% |
351
+ | Paired test, 3,782 samples | 82.87% | 97.73% | 91.22% |
352
 
353
+ ์„ธ seed์˜ ํ™•๋ฅ ์„ ํ‰๊ท ํ•œ ensemble ๊ฒฐ๊ณผ:
 
 
 
 
354
 
355
+ | Metric | Result |
356
+ |---|---:|
357
+ | Exact top-1 | 83.71% |
358
+ | Exact top-5 | 98.02% |
359
+ | Visual-family top-1 | 92.99% |
360
+ | Seed oracle top-1 | 88.05% |
361
+
362
+ Exact top-1๊ณผ family top-1์˜ ์ฐจ์ด๋Š” ์ „์ฒด์ ์ธ ํ˜•ํƒœ ์ธ์‹๋ณด๋‹ค ๋™์ผ family ๋‚ด๋ถ€์˜ ์˜๋ฏธ ์„ ํƒ์ด ๋” ์–ด๋ ค์šด ๋ฌธ์ œ์ž„์„ ๋ณด์—ฌ์ค€๋‹ค.
363
+
364
+ Exact ์˜ค๋ฅ˜์˜ 56.98%๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋™์ผ visual-family ๋‚ด๋ถ€ ํ˜ผ๋™์ด์—ˆ๋‹ค.
365
 
366
+ ```text
367
+ O / 0 / o
368
+ uppercase / lowercase
369
+ vertical-line family
370
+ cross family
 
 
371
  ```
372
 
373
+ ์ด ๊ฒฐ๊ณผ๋Š” trajectory encoder๊ฐ€ ํ˜•ํƒœ ํ›„๋ณด๋ฅผ ๋งŒ๋“ค๊ณ , formula context๊ฐ€ ์ตœ์ข… ์˜๋ฏธ๋ฅผ ์„ ํƒํ•˜๋Š” ๊ณ„์ธต์  ๊ตฌ์กฐ๋ฅผ ๋’ท๋ฐ›์นจํ•œ๋‹ค.
374
 
375
+ ### Formula-context behavior head
376
 
377
+ ์ •๋‹ต symbol grouping ์œ„์—์„œ ํ‰๊ฐ€ํ•œ 3-seed ํ‰๊ท :
378
+
379
+ | Metric | Result |
380
+ |---|---:|
381
+ | Role accuracy | 93.33% |
382
+ | Macro-F1 | 76.41% |
383
+ | Lowercase identifier recall | 95.66% |
384
+ | Uppercase identifier recall | 55.91% |
385
+ | Multiplication recall | 88.89% |
386
+ | Expected calibration error | 4.88% |
387
+
388
+ Behavior head๋ฅผ teacher prediction ๋’ค์— ์ ์šฉํ–ˆ์„ ๋•Œ ๋Œ€์ƒ ๊ธฐํ˜ธ์˜ exact top-1์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ณ€ํ™”ํ–ˆ๋‹ค.
389
 
390
  ```text
391
+ 33.65% โ†’ 47.30%
 
 
 
392
  ```
393
 
394
+ ํ‰๊ท  ์ƒ์Šน ํญ์€ `13.65%p`์˜€์œผ๋ฉฐ rewrite precision์€ `81.35%`์˜€๋‹ค.
395
 
396
+ ์ด ์‹คํ—˜์€ trajectory๋งŒ์œผ๋กœ ์„ ํƒํ•˜๊ธฐ ์–ด๋ ค์šด exact meaning์„ ์ˆ˜์‹ ๋ฌธ๋งฅ์ด ๋ณด์™„ํ•  ์ˆ˜ ์žˆ์Œ์„ ๋ณด์—ฌ์ค€๋‹ค.
397
 
398
+ ### Continuous-formula adaptation
399
 
400
+ Product trajectory encoder์™€ online adapter๋ฅผ ๊ณ ์ •ํ•˜๊ณ , ์—ฐ์† ์ˆ˜์‹์˜ symbol group์— ์ž‘์€ formula adapter๋ฅผ ์ถ”๊ฐ€ํ–ˆ๋‹ค.
401
 
402
+ ```text
403
+ Frozen trajectory encoder
404
+ + frozen online adapter
405
+ + hidden-64 formula adapter
406
+ ```
407
 
408
+ 3-seed ํ‰๊ท  ๊ฒฐ๊ณผ:
409
 
410
+ | Metric | Mean |
411
+ |---|---:|
412
+ | Writer-validation exact top-1 | 85.19% |
413
+ | Writer-validation family top-1 | 93.30% |
414
+ | Official-test exact top-1 | 82.38% |
415
+ | Official-test family top-1 | 88.17% |
416
 
417
+ ์ž‘์€ adapter๋งŒ์œผ๋กœ๋„ ๊ณ ๋ฆฝ ๊ธฐํ˜ธ encoder์˜ representation์„ ์—ฐ์† ์ˆ˜์‹ ํ™˜๊ฒฝ์— ๋งž๊ฒŒ ์กฐ์ •ํ•  ์ˆ˜ ์žˆ์Œ์„ ํ™•์ธํ–ˆ๋‹ค.
418
 
419
+ ### Grouping boundary head
420
 
421
+ | Metric | Base grouping | Boundary head |
422
+ |---|---:|---:|
423
+ | Exact partition | 60.04% | 60.25% |
424
+ | Pair-F1 | 91.07% | 91.26% |
425
+ | Overmerge formula rate | 21.72% | 20.49% |
426
 
427
+ Boundary head๋Š” ๊ธฐํ˜ธ ์‚ฌ์ด์˜ geometry๋ฅผ ์ด์šฉํ•ด ์ธ์ ‘ symbol์˜ ๊ณผ๋„ํ•œ ๋ณ‘ํ•ฉ์„ ์ค„์˜€๋‹ค.
428
 
429
+ ### Family fusion
430
 
431
+ Validation์—์„œ exact probability์™€ family probability๋ฅผ ๊ฒฐํ•ฉํ•˜๋Š” fusion weight๋ฅผ ์„ ํƒํ–ˆ๋‹ค.
432
 
433
+ ```text
434
+ exact score
435
+ +
436
+ 0.15 ร— family-consistency score
437
+ ```
438
 
439
+ Paired test exact top-1:
440
 
441
+ ```text
442
+ 83.71% โ†’ 83.82%
443
+ ```
 
 
 
 
 
 
 
 
444
 
445
+ Family prediction์€ exact classifier์˜ ํ›„๋ณด ์ˆœ์„œ๋ฅผ ์ž‘์€ ๋ฒ”์œ„์—์„œ ๋ณด์ •ํ•˜๋Š” ์—ญํ• ์„ ํ•œ๋‹ค.
446
 
447
+ ## ์—ฐ๊ตฌ ํ•ด์„
448
 
449
+ AIFlow Math Ink 0.6์˜ ์‹คํ—˜์€ ์ˆ˜ํ•™ ํ•„๊ธฐ ์ธ์‹์„ ๋‹ค์Œ ์„ธ ๋‹จ๊ณ„๋กœ ๋ถ„๋ฆฌํ•  ์ˆ˜ ์žˆ์Œ์„ ๋ณด์—ฌ์ค€๋‹ค.
 
 
 
 
450
 
451
+ ```text
452
+ 1. Stroke trajectory์—์„œ ์‹œ๊ฐ์  ํ˜•ํƒœ๋ฅผ ์ถ”์ถœ
453
+ 2. Visual family ์•ˆ์—์„œ ๊ฐ€๋Šฅํ•œ symbol ํ›„๋ณด๋ฅผ ๊ตฌ์„ฑ
454
+ 3. ์ˆ˜์‹ ๋ฌธ๋งฅ๊ณผ geometry๋กœ exact meaning์„ ์„ ํƒ
455
+ ```
456
 
457
+ ์ด ๊ตฌ์กฐ๋Š” ๊ณ ๋ฆฝ ๊ธฐํ˜ธ ์ธ์‹๊ณผ ์ „์ฒด ์ˆ˜์‹ ํ•ด์„์„ ํ•˜๋‚˜์˜ ๊ฑฐ๋Œ€ํ•œ classifier๋กœ ์ฒ˜๋ฆฌํ•˜๋Š” ๋Œ€์‹ , ๊ฐ ๋‹จ๊ณ„๊ฐ€ ์„œ๋กœ ๋‹ค๋ฅธ ์ •๋ณด๋ฅผ ๋‹ด๋‹นํ•˜๋„๋ก ํ•œ๋‹ค.
458
 
459
+ - Trajectory encoder: ํ•„๊ธฐ ๋™์ž‘๊ณผ ํ˜•ํƒœ
460
+ - Family head: ์‹œ๊ฐ์  ์œ ์‚ฌ์„ฑ
461
+ - Behavior head: ๊ธฐํ˜ธ์˜ ๋ฌธ๋ฒ•์  ์—ญํ• 
462
+ - Boundary head: stroke grouping
463
+ - Formula adapter: ์ˆ˜์‹ ์•ˆ์—์„œ์˜ ์ƒ๋Œ€ ํฌ๊ธฐ์™€ ์œ„์น˜
464
 
465
  ## ์—ฐ๊ตฌ ์ž๋ฃŒ
466
 
467
+ - [์ „์ฒด ๊ธฐ์ˆ  ๋ณด๊ณ ์„œ](reports/RESEARCH_REPORT.md)
468
+ - [Federation audit](reports/FEDERATION_AUDIT_20260724.md)
469
+ - [3-seed behavior ๊ฒฐ๊ณผ](reports/behavior_role_3seed_summary.json)
470
+ - [Boundary ๊ฒฐ๊ณผ](reports/boundary_behavior_guard_report.json)
471
+ - [Online ์˜ค๋ฅ˜ ํ•ฉ์˜ ๋ถ„์„](reports/online_error_consensus_paired_test_3seed.json)
472
+ - [Family-fusion calibration](reports/online_family_fusion_calibration_3seed.json)
473
+ - [Formula-context ๊ณ„์•ฝ ๋ถ„์„](reports/formula_context_contract_3seed.json)
474
+ - [Formula adapter ๊ฒฐ๊ณผ](reports/formula_adapter_h64_3seed_summary.json)
475
+ - [Checkpoint manifest](MANIFEST.json)