Shree10 commited on
Commit
3114ebc
·
verified ·
1 Parent(s): d24aba7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +312 -2
README.md CHANGED
@@ -1,7 +1,317 @@
1
  ---
2
  license: apache-2.0
 
 
 
3
  language:
4
  - en
5
  size_categories:
6
- - 100B<n<1T
7
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ task_categories:
4
+ - image-to-text
5
+ - image-classification
6
  language:
7
  - en
8
  size_categories:
9
+ - 1M<n<10M
10
+ tags:
11
+ - handwriting-recognition
12
+ - htr
13
+ - self-supervised-learning
14
+ - historical-documents
15
+ - writer-identification
16
+ pretty_name: SSL-HWD
17
+ ---
18
+
19
+ # SSL-HWD (A Large Scale Handwritten Image Dataset)
20
+
21
+ ## Dataset Description
22
+
23
+ ### Dataset Summary
24
+
25
+ **SSL-HWD** is a large-scale handwritten text dataset introduced in the paper ["Learning Beyond Labels: Self-Supervised Handwritten Text Recognition"](https://logo-ssl.github.io/) (WACV 2026). The dataset comprises **10 million word-level handwritten images** from **852 writers** across diverse domains including Physics, Computer Science, Biology, Mathematics, and more.
26
+
27
+ The dataset is specifically designed to support **self-supervised learning** approaches for Handwritten Text Recognition (HTR), addressing the critical challenge of reducing dependence on large volumes of labeled data.
28
+
29
+ ### Dataset Composition
30
+
31
+ - **Total Words**: 10 million word-level images
32
+ - **Writers**: 852 unique contributors
33
+ - **Pages**: 81,280 scanned document pages
34
+ - **Domains**: 20+ domains including sciences, literature, and mathematics
35
+ - **Labeled Subset**: 2.08M words (20.8%) with ground truth transcriptions
36
+ - **Unlabeled Subset**: 7.92M words (79.2%) for self-supervised pretraining
37
+ - **Unique Vocabulary**: 107,813 unique words
38
+
39
+ ### Key Features
40
+
41
+ **Diversity and Complexity**: The dataset includes challenging real-world scenarios:
42
+ - Texts with different font colors (varying ink and pen usage)
43
+ - Texts with difficult backgrounds (lines, noise interference)
44
+ - Texts with distorted characters (irregular strokes, structural inconsistencies)
45
+ - Texts with blurring effects (motion or focus issues)
46
+ - Texts with highlighted backgrounds (color markings obscuring content)
47
+
48
+ **Quality Assurance**:
49
+ - All samples automatically annotated using Amazon Textract with confidence ≥99%
50
+ - Labeled subset manually verified by language experts
51
+ - High-quality word segmentation with precise bounding boxes
52
+
53
+ ### Comparison with Existing Datasets
54
+
55
+ | Dataset | Pages | Writers | Words | Unique Words |
56
+ |---------|-------|---------|-------|--------------|
57
+ | IAM | 1.5K | 657 | 115K | 10.5K |
58
+ | GNHK | 687 | - | 39K | 12.3K |
59
+ | IIIT-HW-English-Word | 20.8K | 1,215 | 757K | 174K |
60
+ | **SSL-HWD (Ours)** | **81.2K** | **852** | **10M** | **107K** |
61
+
62
+ ### Vocabulary Distribution
63
+
64
+ | Category | SSL-HWD |
65
+ |----------|---------|
66
+ | Alphabetic Words | 61,088 |
67
+ | Numeric Words | 4,981 |
68
+ | Stop-words | 457 |
69
+ | Other Words | 41,287 |
70
+ | **Total Unique** | **107,813** |
71
+
72
+ ## Dataset Structure
73
+
74
+ ### Data Organization
75
+
76
+ ```
77
+ SSL-HWD/
78
+ ├── labeled/ # 2.08M labeled samples
79
+ │ ├── writer1/
80
+ │ │ ├── writer1.csv # Ground truth transcriptions
81
+ │ │ ├── writer1_1.png
82
+ │ │ ├── writer1_2.png
83
+ │ │ └── ...
84
+ │ ├── writer2/
85
+ │ └── ...
86
+ └── unlabeled/ # 7.92M unlabeled samples
87
+ ├── writer1/
88
+ │ ├── writer1_1.png
89
+ │ ├── writer1_2.png
90
+ │ └── ...
91
+ └── ...
92
+ ```
93
+
94
+ ### Data Fields
95
+
96
+ **CSV Format (for labeled data)**:
97
+ - `image_filename` (string): Name of the word image file
98
+ - `transcription` (string): Ground truth text transcription
99
+
100
+ **Example**:
101
+ ```csv
102
+ image_filename,transcription
103
+ writer1_1.png,handwritten
104
+ writer1_2.png,recognition
105
+ writer1_3.png,dataset
106
+ ```
107
+
108
+ ### Data Splits
109
+
110
+ The labeled subset (2.08M samples) is divided as follows:
111
+ - **Training**: 60% (1.25M samples)
112
+ - **Testing**: 40% (0.83M samples)
113
+
114
+ The unlabeled subset (7.92M samples) is used for self-supervised pretraining.
115
+
116
+ ## Supported Tasks
117
+
118
+ ### 1. Handwriting Text Recognition (HTR)
119
+ Train models to recognize handwritten text from word images.
120
+
121
+ ### 2. Self-Supervised Learning
122
+ Use the large unlabeled subset for pretraining with methods like contrastive learning.
123
+
124
+ ### 3. Writer Identification
125
+ Identify writers based on handwriting characteristics (852 unique writers).
126
+
127
+ ### 4. Domain Adaptation
128
+ Transfer learning across different handwriting styles and domains.
129
+
130
+ ### 5. Semi-Supervised Learning
131
+ Combine small labeled and large unlabeled subsets for improved performance.
132
+
133
+ ## Usage
134
+
135
+ ### Loading the Dataset
136
+
137
+ ```python
138
+ from datasets import load_dataset
139
+
140
+ # Load the full dataset
141
+ dataset = load_dataset("your-username/ssl-hwd")
142
+
143
+ # Access labeled data
144
+ labeled = dataset['labeled']
145
+
146
+ # Access unlabeled data for self-supervised learning
147
+ unlabeled = dataset['unlabeled']
148
+ ```
149
+
150
+ ### Basic Example
151
+
152
+ ```python
153
+ from PIL import Image
154
+ import pandas as pd
155
+ from pathlib import Path
156
+
157
+ # Load a writer's data
158
+ writer_folder = Path("labeled/writer1")
159
+ df = pd.read_csv(writer_folder / "writer1.csv")
160
+
161
+ # Load first image and transcription
162
+ img_name = df.iloc[0]['image_filename']
163
+ transcription = df.iloc[0]['transcription']
164
+
165
+ image = Image.open(writer_folder / img_name)
166
+ print(f"Transcription: {transcription}")
167
+ ```
168
+
169
+ ### PyTorch DataLoader
170
+
171
+ ```python
172
+ import torch
173
+ from torch.utils.data import Dataset, DataLoader
174
+ from PIL import Image
175
+ import pandas as pd
176
+
177
+ class SSLHWDDataset(Dataset):
178
+ def __init__(self, writer_folder, transform=None):
179
+ self.folder = Path(writer_folder)
180
+ csv_file = list(self.folder.glob("*.csv"))[0]
181
+ self.data = pd.read_csv(csv_file)
182
+ self.transform = transform
183
+
184
+ def __len__(self):
185
+ return len(self.data)
186
+
187
+ def __getitem__(self, idx):
188
+ img_name = self.data.iloc[idx]['image_filename']
189
+ transcription = self.data.iloc[idx]['transcription']
190
+
191
+ img_path = self.folder / img_name
192
+ image = Image.open(img_path).convert('RGB')
193
+
194
+ if self.transform:
195
+ image = self.transform(image)
196
+
197
+ return image, transcription
198
+
199
+ # Usage
200
+ dataset = SSLHWDDataset('labeled/writer1')
201
+ dataloader = DataLoader(dataset, batch_size=32, shuffle=True)
202
+ ```
203
+
204
+ ## Benchmark Results
205
+
206
+ ### State-of-the-Art Performance (from LoGo-HTR paper)
207
+
208
+ **IAM Dataset**:
209
+ - With 80% labeled data: WER 11.93%, CER 2.31%
210
+ - With 100% labeled data: WER 10.27%, CER 2.01%
211
+
212
+ **GNHK Dataset**:
213
+ - With 80% labeled data: WER 19.69%, CER 9.05%
214
+ - With 100% labeled data: WER 12.07%, CER 7.20%
215
+
216
+ **RIMES Dataset**:
217
+ - With 80% labeled data: WER 6.15%, CER 1.89%
218
+ - With 100% labeled data: WER 5.50%, CER 1.78%
219
+
220
+ **LAM Dataset** (line-level):
221
+ - With 80% labeled data: WER 7.2%, CER 3.2%
222
+ - With 100% labeled data: WER 6.3%, CER 2.39%
223
+
224
+ ### Cross-Dataset Generalization
225
+
226
+ The dataset demonstrates strong cross-dataset transfer capabilities:
227
+ - SSL-HWD → IAM: WER 13.2%, CER 2.9%
228
+ - SSL-HWD → GNHK: WER 10.1%, CER 6.8%
229
+ - SSL-HWD → RIMES: WER 11.2%, CER 3.5%
230
+ - SSL-HWD → LAM: WER 16.4%, CER 7.2%
231
+
232
+ ## Dataset Creation
233
+
234
+ ### Source Data
235
+
236
+ The dataset was curated from publicly available digitized manuscripts from web sources, selected for being fully or substantially handwritten. Documents span:
237
+ - Personal diaries
238
+ - Academic notes
239
+ - Historical correspondence
240
+ - Scientific manuscripts
241
+ - Mathematical writings
242
+ - Literature and more
243
+
244
+ ### Data Quality
245
+
246
+ - **Diverse Sources**: 852 unique writers across 20+ domains
247
+ - **Real-world Challenges**: Includes blur, noise, distortions, and background interference
248
+
249
+ ## Applications
250
+
251
+ ### Self-Supervised Learning (Primary Use)
252
+ Use the 7.92M unlabeled samples for pretraining with methods like:
253
+ - Contrastive learning (SimCLR, MoCo)
254
+ - Masked image modeling
255
+ - Local-global objectives (as in LoGo-HTR)
256
+
257
+ ### Semi-Supervised Learning
258
+ Combine labeled and unlabeled subsets for improved performance with limited annotations.
259
+
260
+ ### Few-Shot Learning
261
+ Train models with minimal labeled data by leveraging pretrained representations.
262
+
263
+ ### Transfer Learning
264
+ Pretrain on SSL-HWD and fine-tune on domain-specific datasets.
265
+
266
+ ## Limitations and Considerations
267
+
268
+ ### Known Limitations
269
+
270
+ - **Language**: Primarily English handwritten text
271
+ - **Geographic Bias**: Predominantly Western handwriting styles
272
+ - **Historical Period**: Concentrated in specific time periods
273
+ - **Domain Coverage**: While diverse, may not represent all handwriting variations
274
+
275
+ ### Ethical Considerations
276
+
277
+ - Dataset contains historical documents and handwritten materials
278
+ - Personal information may be present in some samples
279
+ - Users should be aware of privacy considerations when using this data
280
+
281
+ ## Citation
282
+
283
+ If you use the SSL-HWD dataset in your research, please cite:
284
+
285
+ ```bibtex
286
+ @inproceedings{mitra2026learning,
287
+ title={Learning Beyond Labels: Self-Supervised Handwritten Text Recognition},
288
+ author={Mitra, Shree and Mondal, Ajoy and Jawahar, C. V.},
289
+ booktitle={Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},
290
+ year={2026}
291
+ }
292
+ ```
293
+
294
+ ## Additional Resources
295
+
296
+ - **Project Website**: [https://logo-ssl.github.io/](https://logo-ssl.github.io/)
297
+
298
+ ## License
299
+
300
+ This dataset is released under the **Apache License 2.0**.
301
+
302
+ ## Acknowledgments
303
+
304
+ This work is supported by MeitY, Government of India, through the NLTM-Bhashini project.
305
+
306
+ ## Contact
307
+
308
+ For questions or issues regarding the dataset:
309
+ - **Authors**: Shree Mitra, Ajoy Mondal, C.V. Jawahar
310
+ - **Institution**: IIIT Hyderabad
311
+ - **Email**: shree.mitra@research.iiit.ac.in
312
+
313
+ ---
314
+
315
+ **Dataset Version**: 1.0
316
+ **Last Updated**: January 2026
317
+ **Status**: Active