AsyiraFitri commited on
Commit
cdb7bdd
Β·
1 Parent(s): 2282682

Daily/Weekly Update

Browse files
Updates/Week_06_Update.md ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Week 06 Update β€” Embedding Fusion, Bad Case Analysis, Post-Processing & Fine-tuning
2
+ *Image embedding benchmark Β· Tobacco-3482* Β· 20 Apr 2026 – 24 Apr 2026
3
+
4
+ ---
5
+
6
+ ## Summary
7
+
8
+ This week covered embedding fusion experiments, bad case analysis and reporting, post-processing and pooling experiments, SupCon fine-tuning, and hard-negative mining β€” culminating in a new best result of 92.68% kNN@1 on Tobacco-3482.
9
+
10
+ ---
11
+
12
+ ## Completed
13
+
14
+ **Embedding Fusion**
15
+ - Ran embedding fusion experiments across 7 model pairs (SigLIP, SigLIP2, DiT, DINOv2 combinations), testing raw concat (α=0.5), PCA-whitened concat, and alpha sweep at α ∈ {0.6, 0.7, 0.8}.
16
+ - Results saved to `results/fusion_summary.txt` and `results/fusion_summary.json`. README updated with full fusion section.
17
+ **Bad Case Analysis**
18
+ - Fixed result logging issue where post-processed results were overwriting raw embedding results β€” separated into independent entries.
19
+ - Ran bad case analysis for SigLIP2 SO400M and ModernVBERT Bi using top-1 kNN criterion; generated per-class error breakdowns across all 10 document classes.
20
+ - Sampled misclassified cases per class with top-10 nearest neighbour retrieval for visual inspection.
21
+ - Generated retrieval confusion heatmaps and error rate bar charts; saved bad case visualisations to `figures/bad_cases`.
22
+ **Bad Case Report & Initial Experiments**
23
+ - Improved bad case PNG visualisations for readability; added `bad_cases_grids.html` for grid-layout viewing.
24
+ - Created `figures/bad_cases/bad_case_report.html` with per-label summary tables, confusion heatmaps, colour-coded error severity, root cause analysis, and a full improvement roadmap.
25
+ - Benchmarked **mean-centering** β€” consistent gains across both models, notably ModernVBERT Bi kNN@5 +4.73%.
26
+ - Benchmarked **CLS + mean-patch pooling** for SigLIP2 SO400M β€” kNN@1 +2.73% over CLS-only; further gains combined with centering (87.80% kNN@1, 90.53% Clf Acc).
27
+ - Ran **per-label kNN@1 error breakdown** across 6 variants β€” CLS+patch+center best overall.
28
+ - Swept **query expansion** across k ∈ {1, 3, 5, 10} β€” marginal gains at best; does not reliably improve retrieval on this dataset.
29
+ **HuggingFace Fix & SupCon Fine-tuning**
30
+ - Diagnosed and resolved HuggingFace push failure β€” root cause was `bad_cases_grids.html` embedding images directly. Refactored to path references and split PNG grids by row to stay within XET size limits.
31
+ - Ran **SupCon fine-tuning** on SigLIP2 SO400M (5 epochs, batch 4, lr 1e-5, temp 0.07, 2 unfrozen blocks, 50% stratified data). Loss: 0.2981 β†’ 0.1146. Results: kNN@1 +5.16% (85.51% β†’ 90.67%), kNN@5 +5.02%, Clf Acc +2.73% β€” largest single-step gain of the week.
32
+ **Hard-Negative Mining & Results Consolidation**
33
+ - Ran **SupCon fine-tuning with online hard-negative mining** (5 epochs, batch 8, lr 5e-6, `MultiSimilarityMiner(epsilon=0.1)`, 2 unfrozen blocks). Mined pairs: 927 β†’ 270 across epochs. Results: kNN@1 92.68%, kNN@5 91.68%, Clf Acc 92.54% β€” best overall result, +2.01% kNN@1 over SupCon alone.
34
+ - Consolidated all results (experiments A–G) into `result_analysis.md`, linked from README alongside `bad_case_report.html`.
35
+ - Successfully pushed all outstanding assets to HuggingFace.
36
+ - Weekly meeting held β€” action items carried into next week.
37
+ ---
38
+
39
+ ## Best Results This Week
40
+
41
+ | Variant | kNN@1 | kNN@5 | Clf Acc |
42
+ |---|---|---|---|
43
+ | SigLIP2 SO400M baseline (CLS) | 84.36% | 86.37% | 88.38% |
44
+ | + Mean-centering | 85.51% | 84.79% | 88.95% |
45
+ | + CLS + patch + centering | 87.80% | 88.95% | 90.53% |
46
+ | + SupCon fine-tuning | 90.67% | 90.53% | 91.68% |
47
+ | **+ Hard-negative mining (best)** | **92.68%** | **91.68%** | **92.54%** |
48
+
49
+ ---
50
+
51
+ ## Carry-Over / Next Week
52
+
53
+ - Add image-level labels (filename/index, true label, predicted label, cosine distance) to bad case PNG grids for easier sample referencing.
54
+ - Benchmark **LayoutLMv3** as an additional model variant and compare results against SigLIP2 and ModernVBERT Bi.
55
+ ---
56
+
57
+ ## Key Learnings
58
+
59
+ - Embedding fusion was explored but post-processing and fine-tuning interventions on single models proved to be the higher-ROI path this week.
60
+ - Mean-centering and CLS+patch pooling are complementary β€” combining both consistently outperforms either alone.
61
+ - Query expansion does not help on Tobacco-3482 β€” the neighbourhood structure is noisy enough that averaging in neighbours introduces more error than it corrects.
62
+ - SupCon fine-tuning is the single biggest lever, with hard-negative mining adding a further consistent ~+2% on top by forcing separation of visually similar but label-distinct pairs.
63
+ - Report and Scientific remain the hardest classes across all variants β€” even the best model still misclassifies 35.2% of Report documents. Structural embedding space overlap between these two classes is the dominant unresolved challenge.
64
+ - Directly embedding images in HTML is not viable for HuggingFace at this dataset scale β€” path references and per-row PNG splitting are necessary.
Updates/daily_updates/20042026-DailyUpdate.md CHANGED
@@ -1,4 +1,4 @@
1
- **Daily Update β€” Embedding Fusion Experiments**
2
  *Image embedding benchmark Β· Tobacco-3482*
3
 
4
  ---
 
1
+ # Daily Update β€” Embedding Fusion Experiments
2
  *Image embedding benchmark Β· Tobacco-3482*
3
 
4
  ---
Updates/daily_updates/21042026-DailyUpdate.md CHANGED
@@ -1,4 +1,4 @@
1
- **Daily Update β€” Bad Case Analysis**
2
  *Image embedding benchmark Β· Tobacco-3482*
3
 
4
  ---
 
1
+ # Daily Update β€” Bad Case Analysis
2
  *Image embedding benchmark Β· Tobacco-3482*
3
 
4
  ---
Updates/daily_updates/22042026-DailyUpdate.md CHANGED
@@ -1,7 +1,9 @@
1
- **Daily Update β€” Bad Case Analysis, Improvement Report & Initial Experiments**
2
  *Image embedding benchmark Β· Tobacco-3482*
3
 
4
- **Completed**
 
 
5
 
6
  - Improved the bad case `.png` visualisations for better readability and repushed to HuggingFace. Added `bad_cases_grids.html` for improved grid-layout readability alongside the per-case PNGs.
7
  - Created `figures/bad_cases/bad_case_report.html` with per-label summary tables, confusion heatmaps, retrieval error rate bar charts, colour-coded error severity (green <25%, amber 25–50%, red >50%), root cause analysis, and a full improvement roadmap across four categories (preprocessing, architecture/pooling, training objectives, post-processing/retrieval).
@@ -10,15 +12,21 @@
10
  - Ran **per-label kNN@1 error breakdown** across all six variants β€” CLS+patch+center is best overall and wins on 4 of 8 labels including Report (44.4% β†’ 35.2%) and Note (35.6% β†’ 25.4% tied with ModernVBERT Bi+ctr).
11
  - Implemented **query expansion** swept across k ∈ {1, 3, 5, 10} for all variants β€” marginal gains at best; CLS+patch+center with k=3 gives +0.57% kNN@1 (87.80% β†’ 88.38%) but kNN@5 drops 2.15%. Query expansion does not reliably improve retrieval on this dataset.
12
 
13
- **In Progress**
 
 
14
 
15
  - Consolidating results β€” to be pushed to HuggingFace tomorrow.
16
 
17
- **Blockers**
 
 
18
 
19
  - Couldn't sync commit to huggingface
20
 
21
- **Key Learnings**
 
 
22
 
23
  - Centering consistently helps both models but ModernVBERT Bi benefits more than SigLIP2, suggesting its embedding space is less well-centred out of the box.
24
  - CLS+patch pooling trades classifier accuracy for kNN@1 accuracy on its own, but combining both with centering gives the best results across all three metrics β€” the two post-processing steps are complementary.
 
1
+ # Daily Update β€” Bad Case Analysis, Improvement Report & Initial Experiments
2
  *Image embedding benchmark Β· Tobacco-3482*
3
 
4
+ ---
5
+
6
+ ## Completed
7
 
8
  - Improved the bad case `.png` visualisations for better readability and repushed to HuggingFace. Added `bad_cases_grids.html` for improved grid-layout readability alongside the per-case PNGs.
9
  - Created `figures/bad_cases/bad_case_report.html` with per-label summary tables, confusion heatmaps, retrieval error rate bar charts, colour-coded error severity (green <25%, amber 25–50%, red >50%), root cause analysis, and a full improvement roadmap across four categories (preprocessing, architecture/pooling, training objectives, post-processing/retrieval).
 
12
  - Ran **per-label kNN@1 error breakdown** across all six variants β€” CLS+patch+center is best overall and wins on 4 of 8 labels including Report (44.4% β†’ 35.2%) and Note (35.6% β†’ 25.4% tied with ModernVBERT Bi+ctr).
13
  - Implemented **query expansion** swept across k ∈ {1, 3, 5, 10} for all variants β€” marginal gains at best; CLS+patch+center with k=3 gives +0.57% kNN@1 (87.80% β†’ 88.38%) but kNN@5 drops 2.15%. Query expansion does not reliably improve retrieval on this dataset.
14
 
15
+ ---
16
+
17
+ ## In Progress
18
 
19
  - Consolidating results β€” to be pushed to HuggingFace tomorrow.
20
 
21
+ ---
22
+
23
+ ## Blockers
24
 
25
  - Couldn't sync commit to huggingface
26
 
27
+ ---
28
+
29
+ ## Key Learnings
30
 
31
  - Centering consistently helps both models but ModernVBERT Bi benefits more than SigLIP2, suggesting its embedding space is less well-centred out of the box.
32
  - CLS+patch pooling trades classifier accuracy for kNN@1 accuracy on its own, but combining both with centering gives the best results across all three metrics β€” the two post-processing steps are complementary.
Updates/daily_updates/23042026-DailyUpdate.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Daily Update β€” HuggingFace Push Fix, File Size Optimisation & SupCon Fine-tuning
2
+ *Image embedding benchmark Β· Tobacco-3482*
3
+
4
+ ---
5
+
6
+ ## Completed
7
+
8
+ - Diagnosed and resolved the HuggingFace push failure from 22/04. Root cause: `bad_cases_grids.html` was loading images directly, resulting in a file size too large to sync. Some of the per-case PNG grids were also too large to be rendered on HuggingFace's XET storage.
9
+ - Refactored `bad_cases_grids.html` to reference image paths instead of embedding them inline, significantly reducing file size.
10
+ - Split the per-case PNG grids by row so individual files stay within HuggingFace's renderable size limits while preserving readability.
11
+ - Conducted trial-and-error optimisation across both file types, balancing compression against visual clarity before re-pushing assets.
12
+ - Ran **SupCon fine-tuning** on SigLIP2 SO400M (5 epochs, batch size 4, lr 1e-5, temp 0.07, 2 unfrozen blocks, 50% of training data stratified). Loss: 0.2981 β†’ 0.1146. Results: kNN@1 +5.16% (85.51% β†’ 90.67%), kNN@5 +5.02%, Clf Acc +2.73% β€” the largest single-step gain across all experiments to date.
13
+
14
+ ---
15
+
16
+ ## In Progress
17
+
18
+ - Hard-negative mining fine-tuning experiment scheduled for next day.
19
+
20
+ ---
21
+
22
+ ## Blockers
23
+
24
+ - ...
25
+
26
+ ---
27
+
28
+ ## Key Learnings
29
+
30
+ - Directly embedding images in HTML is not viable for HuggingFace hosting at this scale β€” path references are necessary. File size constraints also apply to PNGs, requiring per-row splitting rather than full grids.
31
+ - SupCon fine-tuning is the highest-ROI intervention so far β€” even with only 50% of training data and 5 epochs, it substantially tightens within-class clusters and separates the Report/Scientific confusion pair.
32
+
Updates/daily_updates/24042026-DailyUpdate.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Daily Update β€” Hard-Negative Mining, Results Consolidation & LayoutLMv3 Kickoff
2
+ *Image embedding benchmark Β· Tobacco-3482*
3
+
4
+ ---
5
+
6
+ ## Completed
7
+
8
+ - Ran **SupCon fine-tuning with online hard-negative mining** on SigLIP2 SO400M (5 epochs, batch size 8, lr 5e-6, temp 0.07, `MultiSimilarityMiner(epsilon=0.1)`, 2 unfrozen blocks). Mined pairs per epoch: 927 β†’ 635 β†’ 471 β†’ 327 β†’ 270 (declining count confirms the model is actively separating confused pairs). Results: kNN@1 92.68%, kNN@5 91.68%, Clf Acc 92.54% β€” best overall result across all experiments, +2.01% kNN@1 over SupCon alone.
9
+ - Consolidated all experiment results (A through G) into `result_analysis.md` and linked it from the README as the canonical results reference, alongside the existing `bad_case_report.html`.
10
+ - Successfully pushed all outstanding assets to HuggingFace (previously blocked).
11
+ - Weekly meeting held. Action items identified (see In Progress).
12
+ ---
13
+
14
+ ## In Progress
15
+
16
+ - Add image-level labels (filename/index, true label, predicted label, cosine distance) to bad case PNG grids for easier sample referencing.
17
+ - Benchmark **LayoutLMv3** as an additional model variant and compare results against SigLIP2 and ModernVBERT Bi β€” to be ready for next week's review.
18
+
19
+ ## Blockers
20
+
21
+ - ...
22
+
23
+ ---
24
+
25
+ ## Key Learnings
26
+
27
+ - Hard-negative mining adds a consistent ~+2% on top of vanilla SupCon. Declining mined pair count across epochs confirms the model is actively separating previously-confused pairs.
28
+ - Report and Scientific remain the hardest classes even after fine-tuning (best variant still at 35.2% Report error), but narrowed significantly from the 44.4% baseline.
29
+ - Maintaining results in both `.md` and `.html` formats is worth the duplication β€” `.md` is easier to link and diff on HuggingFace, while `.html` retains the visual heatmaps and bar charts.
tabacco3482_benchmarks/figures/bad_cases/result_analysis.md CHANGED
@@ -132,7 +132,7 @@ Resume is the only class with perfect retrieval. The two-column structured layou
132
 
133
  Query image (orange border) + top-10 retrieved neighbours. Green border = correct label, Red border = wrong label.
134
 
135
- [SigLIP2 SO400M β€” Bad Case Grids](bad_case_grids.html)
136
 
137
  ---
138
 
 
132
 
133
  Query image (orange border) + top-10 retrieved neighbours. Green border = correct label, Red border = wrong label.
134
 
135
+ [Bad Case Grids Visualisations](bad_case_grids.html)
136
 
137
  ---
138