johnsonkuan commited on
Commit
f409e64
·
verified ·
1 Parent(s): be7b536

Present Glancelot as the canonical model source

Browse files
Files changed (2) hide show
  1. README.md +6 -22
  2. provenance.json +0 -24
README.md CHANGED
@@ -93,13 +93,10 @@ All nine outputs contribute to training through a shared backbone. Chowder uses
93
  | --- | --- |
94
  | `triage_fp32.onnx` | Deployed FP32 ONNX model |
95
  | `config.json` | Model settings, preprocessing, operating threshold, and validation statistics; consumed by Chowder and the example below |
96
- | `threshold.json` | Original threshold-only export; its threshold and validation fields are also in `config.json` |
97
- | `best.pt` | Original PyTorch checkpoint for re-export or fine-tuning with the original architecture |
98
- | `provenance.json` | Original repository revision and artifact hashes and sizes |
99
  | `LICENSE` | CC BY-SA 4.0 license text |
100
 
101
- The ONNX weights and effective operating threshold are the same as the deployed model previously hosted at [`chowderai/chowder-doc-page-triage`](https://huggingface.co/chowderai/chowder-doc-page-triage). This repo gives that model its Glancelot name; it does not introduce a new training run or a standalone PDF extraction package.
102
-
103
  ## Run on page thumbnails
104
 
105
  Install the dependencies:
@@ -157,27 +154,16 @@ Different rendering or preprocessing can change scores, especially near the rout
157
 
158
  ## Training and labels
159
 
160
- The deployed model is the nine-output `cnn_v2` model. Its training recipe was:
161
 
162
  1. Run Heron on the source pages and record its per-class detection counts. Build eight structural targets and the ninth routing target using the rule above. This is supervision from **hard binary labels**, not soft-logit or feature distillation.
163
  2. Prepare RGB page thumbnails at 224×224. Normalize them with the ImageNet mean and standard deviation. Training adds light brightness/contrast jitter and random crops with eight-pixel edge padding, without flips or rotations.
164
  3. Start from an ImageNet-pretrained MobileNetV3-Small backbone. Add dropout of 0.2 and a `Linear(1024, 9)` output layer. Fine-tune the backbone and output layer together.
165
- 4. Optimize binary cross-entropy with logits across all nine outputs. Each output uses a positive-class weight based on its training-split negative/positive count ratio, clipped to `[0.5, 50]`. The original run records specify AdamW, a learning rate of `0.002`, batch size 1,024, and a 25-epoch schedule. The implementation uses weight decay of `0.0001`, cosine learning-rate decay, and FP16 mixed precision on CUDA.
166
  5. Select the checkpoint using validation recall on the routing output at a false-positive-rate budget of 30%. Then sweep the selected checkpoint's routing threshold to target 99% validation recall. Export the selected weights as a single FP32 ONNX file.
167
 
168
- The combined source pool contains approximately 1.29M PDF page thumbnails, including pages reserved for evaluation. Sources include financial filings, investor-relations materials, research papers, clinical-trial documents, and slides. The original implementation assigns splits by hashing the source-path prefix, rather than randomly splitting individual pages. The source PDFs and training dataset are not included in this repository.
169
-
170
- ### Training source
171
-
172
- The original implementation is in the private [`JohnsonKuan/chonk-triage-model`](https://github.com/JohnsonKuan/chonk-triage-model) repository. These links pin the inspected implementation at commit `7ff2365439f6c7ce9cc5b1f16c728300a0a868eb`:
173
 
174
- - [`data.py`](https://github.com/JohnsonKuan/chonk-triage-model/blob/7ff2365439f6c7ce9cc5b1f16c728300a0a868eb/chonk_triage_model/cnn_v2/data.py): target construction, source-prefix splits, transforms, and class weights.
175
- - [`model.py`](https://github.com/JohnsonKuan/chonk-triage-model/blob/7ff2365439f6c7ce9cc5b1f16c728300a0a868eb/chonk_triage_model/cnn_v2/model.py): backbone and nine-output layer.
176
- - [`train.py`](https://github.com/JohnsonKuan/chonk-triage-model/blob/7ff2365439f6c7ce9cc5b1f16c728300a0a868eb/chonk_triage_model/cnn_v2/train.py): optimization, validation, and checkpoint selection.
177
- - [`eval_threshold.py`](https://github.com/JohnsonKuan/chonk-triage-model/blob/7ff2365439f6c7ce9cc5b1f16c728300a0a868eb/chonk_triage_model/cnn_v2/eval_threshold.py): operating-threshold selection.
178
- - [`export_onnx.py`](https://github.com/JohnsonKuan/chonk-triage-model/blob/7ff2365439f6c7ce9cc5b1f16c728300a0a868eb/chonk_triage_model/cnn_v2/export_onnx.py): FP32 ONNX export.
179
-
180
- These sources document the deployed model's training implementation. They are not a complete public reproduction bundle: the training data and exact historical environment are not included here. Later experiments in the separately named `glancer` repository are not the weights hosted in this model repo.
181
 
182
  ## Evaluation and limits
183
 
@@ -202,9 +188,7 @@ The recorded model-only measurement is **39.2 ms for 32 thumbnails**, or about *
202
 
203
  This measurement does not establish an end-to-end speedup. Savings depend on the document mix, the cost of preparing thumbnails, and the work skipped downstream. Time the full pipeline and check extraction quality on your workload.
204
 
205
- ## Provenance and license
206
-
207
- Glancelot was developed by **Chowder**. The model writeup is by **Johnson Kuan**. The original artifacts come from [`chowderai/chowder-doc-page-triage` at commit `3eb0f8f61214471637652dec75c698a56523cdcf`](https://huggingface.co/chowderai/chowder-doc-page-triage/tree/3eb0f8f61214471637652dec75c698a56523cdcf). `provenance.json` records the ONNX, original threshold, and checkpoint hashes.
208
 
209
  The weights are licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). For attribution, identify **Chowder AI / Johnson Kuan**, the **Glancelot** model, and this repository. Include the license link and indicate any changes. See `LICENSE` for the full terms.
210
 
 
93
  | --- | --- |
94
  | `triage_fp32.onnx` | Deployed FP32 ONNX model |
95
  | `config.json` | Model settings, preprocessing, operating threshold, and validation statistics; consumed by Chowder and the example below |
96
+ | `threshold.json` | Threshold-only export; its threshold and validation fields are also in `config.json` |
97
+ | `best.pt` | PyTorch training checkpoint for re-export or fine-tuning with the model architecture |
 
98
  | `LICENSE` | CC BY-SA 4.0 license text |
99
 
 
 
100
  ## Run on page thumbnails
101
 
102
  Install the dependencies:
 
154
 
155
  ## Training and labels
156
 
157
+ Glancelot was trained with eight structural outputs and one routing output:
158
 
159
  1. Run Heron on the source pages and record its per-class detection counts. Build eight structural targets and the ninth routing target using the rule above. This is supervision from **hard binary labels**, not soft-logit or feature distillation.
160
  2. Prepare RGB page thumbnails at 224×224. Normalize them with the ImageNet mean and standard deviation. Training adds light brightness/contrast jitter and random crops with eight-pixel edge padding, without flips or rotations.
161
  3. Start from an ImageNet-pretrained MobileNetV3-Small backbone. Add dropout of 0.2 and a `Linear(1024, 9)` output layer. Fine-tune the backbone and output layer together.
162
+ 4. Optimize binary cross-entropy with logits across all nine outputs. Each output uses a positive-class weight based on its training-split negative/positive count ratio, clipped to `[0.5, 50]`. The run records specify AdamW, a learning rate of `0.002`, batch size 1,024, and a 25-epoch schedule. The implementation uses weight decay of `0.0001`, cosine learning-rate decay, and FP16 mixed precision on CUDA.
163
  5. Select the checkpoint using validation recall on the routing output at a false-positive-rate budget of 30%. Then sweep the selected checkpoint's routing threshold to target 99% validation recall. Export the selected weights as a single FP32 ONNX file.
164
 
165
+ The combined source pool contains approximately 1.29M PDF page thumbnails, including pages reserved for evaluation. Sources include financial filings, investor-relations materials, research papers, clinical-trial documents, and slides. Training splits are assigned by hashing the source-path prefix, rather than randomly splitting individual pages. The source PDFs and training dataset are not included in this repository.
 
 
 
 
166
 
 
 
 
 
 
 
 
167
 
168
  ## Evaluation and limits
169
 
 
188
 
189
  This measurement does not establish an end-to-end speedup. Savings depend on the document mix, the cost of preparing thumbnails, and the work skipped downstream. Time the full pipeline and check extraction quality on your workload.
190
 
191
+ ## License
 
 
192
 
193
  The weights are licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). For attribution, identify **Chowder AI / Johnson Kuan**, the **Glancelot** model, and this repository. Include the license link and indicate any changes. See `LICENSE` for the full terms.
194
 
provenance.json DELETED
@@ -1,24 +0,0 @@
1
- {
2
- "model_name": "Glancelot",
3
- "source_repo": "chowderai/chowder-doc-page-triage",
4
- "source_revision": "3eb0f8f61214471637652dec75c698a56523cdcf",
5
- "training_run": "v2 run-002",
6
- "release_note": "Repackaged deployed model under its Glancelot name; weights and operating threshold are unchanged.",
7
- "files": [
8
- {
9
- "filename": "best.pt",
10
- "sha256": "18d62994187d59256377057d66f00233854f90c81578244c0230cbf3c6e257f9",
11
- "size": 6235753
12
- },
13
- {
14
- "filename": "triage_fp32.onnx",
15
- "sha256": "4f7c6b27901b16abf96fd924eaa684ca9d596971978e3c5ed9b70621bd17ff77",
16
- "size": 6421483
17
- },
18
- {
19
- "filename": "threshold.json",
20
- "sha256": "5a09e3b1ea1c5e2dbf885100820012b6fe7e980f1290c6f7482aa77917f16369",
21
- "size": 170
22
- }
23
- ]
24
- }