Louis Rädisch commited on
Commit
a7ad983
1 Parent(s): d096766

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +49 -18
README.md CHANGED
@@ -1,36 +1,65 @@
1
-
2
  ---
3
  license: mit
4
  ---
5
 
6
  # AlphaNum Dataset
7
 
8
- ## Dataset Summary
9
- The AlphaNum dataset, curated by Louis Rädisch, is a comprehensive collection of grayscale, handwritten characters and digits, each with dimensions of 28x28 pixels. The primary aim of this dataset is to aid Optical Character Recognition (OCR) tasks. The dataset encompasses labels ranging from 33 to 126, and 999 representing the ASCII characters from '!' to '~', and 'null' respectively. The 'null' category comprises images with normally distributed light pixels placed randomly.
10
-
11
- Images derived from the MNIST dataset have been color inverted to maintain consistency with the rest of the data. Vision Transformer Models have been fine-tuned to harmonize the data from diverse sources, enhancing the dataset's accuracy. For instance, the 'A-Z handwritten alphabets' dataset originally did not differentiate between upper and lower case letters, an issue rectified in this new compilation.
12
 
 
13
 
14
- ## Sources:
15
- 1) [Handwriting Characters Database](https://github.com/sueiras/handwritting_characters_database)
16
  2) [MNIST](https://huggingface.co/datasets/mnist)
17
  3) [AZ Handwritten Alphabets in CSV format](https://www.kaggle.com/datasets/sachinpatel21/az-handwritten-alphabets-in-csv-format)
18
 
19
- The dataset files have been scaled down to 24x24 pixels and recolored from white-on-black to black-on-white to ensure uniformity.
20
 
21
  ## Dataset Structure
22
- ### Data Instances
23
- A single data instance in this dataset comprises an image of a handwritten character or digit, accompanied by its corresponding ASCII label.
 
 
 
24
 
25
- ### Data Fields
26
- 1) 'image': This field contains the image of the handwritten character or digit.
27
- 2) 'label': This field provides the ASCII label corresponding to the character or digit in the image.
28
 
29
- ### Data Splits
30
- The dataset is bifurcated into training and test subsets to facilitate the building and evaluation of models.
31
 
32
- ## Dataset Use
33
- The AlphaNum dataset is apt for tasks associated with text recognition, document processing, and machine learning. It is particularly beneficial for constructing, fine-tuning, and enhancing OCR models.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  ## ASCII Table
36
  | ASCII Value | Character |
@@ -128,4 +157,6 @@ The AlphaNum dataset is apt for tasks associated with text recognition, document
128
  | 124 | \| |
129
  | 125 | } |
130
  | 126 | ~ |
131
- | 999 | null |
 
 
 
 
1
  ---
2
  license: mit
3
  ---
4
 
5
  # AlphaNum Dataset
6
 
7
+ ## Abstract
8
+ The AlphaNum dataset, curated by Louis Rädisch, is an extensive repository of grayscale, handwritten characters and numerals, each of 28x28 pixel dimensions. This dataset is designed to support Optical Character Recognition (OCR) tasks, offering labels that range from 33 to 126, and 999, aligning with ASCII characters from '!' to '~', and 'null', respectively. The 'null' category includes images generated through a noise injection process, resulting in normally distributed light pixels placed randomly.
 
 
9
 
10
+ Images drawn from the MNIST dataset have undergone color inversion to ensure consistency throughout the dataset. Vision Transformer Models have been fine-tuned to unify data sourced from varied origins, thereby augmenting the overall accuracy of the dataset. Notably, the 'A-Z handwritten alphabets' dataset, which initially did not distinguish between upper and lower case letters, has been modified to correct this in the present compilation.
11
 
12
+ ## Data Sources
13
+ 1) [Handwriting Characters Database](https://github.com/sueiras/handwritting_characters_database)
14
  2) [MNIST](https://huggingface.co/datasets/mnist)
15
  3) [AZ Handwritten Alphabets in CSV format](https://www.kaggle.com/datasets/sachinpatel21/az-handwritten-alphabets-in-csv-format)
16
 
17
+ In an effort to maintain uniformity, the dataset files have been resized to 24x24 pixels and recolored from white-on-black to black-on-white.
18
 
19
  ## Dataset Structure
20
+ ### Instance Description
21
+ Each dataset instance contains an image of a handwritten character or numeral, paired with its corresponding ASCII label.
22
+
23
+ ### Data Organization
24
+ The dataset, contained in a .rar file, is organized within a "dataset" folder. Each ASCII symbol is housed in a dedicated folder, the name of which corresponds to the ASCII value of the symbol.
25
 
26
+ ## Dataset Utility
27
+ The AlphaNum dataset caters to a variety of use cases including text recognition, document processing, and machine learning tasks. It is particularly instrumental in the development, fine-tuning, and enhancement of OCR models.
 
28
 
29
+ ## Null Category Image Generation
30
+ The 'null' category comprises images generated by injecting noise to mimic randomly distributed light pixels. The creation of these images is accomplished through the following Python script:
31
 
32
+ ```python
33
+ import os
34
+ import numpy as np
35
+ from PIL import Image, ImageOps, ImageEnhance
36
+
37
+ def generate_noisy_images(num_images, image_size=(28, 28), output_dir='NoisyImages', image_format='JPEG'):
38
+ if not os.path.exists(output_dir):
39
+ os.makedirs(output_dir)
40
+
41
+ for i in range(num_images):
42
+ variation_scale = abs(np.random.normal(30, 15))
43
+ # Generate random noise with reduced strength
44
+ noise = np.random.rand(image_size[0], image_size[1]) * 0.05
45
+ noise = (noise * 255).astype(np.uint8)
46
+
47
+ # Create a PIL image from the noise
48
+ image = Image.fromarray(noise, mode='L') # 'L' for grayscale
49
+
50
+ # Invert the image
51
+ inverted_image = ImageOps.invert(image)
52
+
53
+ # Enhance the contrast with increased amplitude
54
+ enhancer = ImageEnhance.Contrast(inverted_image)
55
+ contrast_enhanced_image = enhancer.enhance(variation_scale) # Increased amplitude (e.g., 3.0)
56
+
57
+ # Save the image
58
+ contrast_enhanced_image.save(os.path.join(output_dir, f'{i}.jpg'), format=image_format)
59
+
60
+ # Generate 5000 noisy images
61
+ generate_noisy_images(5000)
62
+ ```
63
 
64
  ## ASCII Table
65
  | ASCII Value | Character |
 
157
  | 124 | \| |
158
  | 125 | } |
159
  | 126 | ~ |
160
+ | 999 | null
161
+
162
+ |