CoolFace
Modelpublic

OG2022/Github_OG1000.Model_1.Emnist

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
Model Card

Model Card: EMNIST Handwritten Character Classifier (OG2022/GithubOG1000.Model1.Emnist)

Model Overview

This model is designated as "Model_1" by the GitHub user OG1000 within the "OG2022" project. It is designed for handwritten character recognition on the EMNIST dataset. It classifies images of handwritten digits and letters into their corresponding categories.

Model Details

  • Model Identifier: OG2022/GithubOG1000.Model1.Emnist
  • Developed by: OG1000 (GitHub User)
  • Model Type: Convolutional Neural Network (CNN)
  • Architecture: The SimpleEMNISTCNN model is a convolutional neural network, implemented in PyTorch. Its architecture includes:
  • An initial convolutional layer (self.conv1) taking 1 input channel (for grayscale images) and producing 32 output channels, with a 3x3 kernel and stride of 1.
  • A second convolutional layer (self.conv2) taking 32 input channels and producing 64 output channels, also with a 3x3 kernel and stride of 1.
  • Rectified Linear Unit (ReLU) activation functions are applied after both convolutional layers.
  • A max-pooling layer with a 2x2 kernel (nn.functional.max_pool2d(x, 2)) is applied after the second convolutional layer.
  • A dropout layer (self.dropout1) with a probability of 0.25 is applied after pooling.
  • The feature maps are then flattened (torch.flatten(x, 1)) for input to the fully connected layers.
  • A fully connected layer (self.fc1) maps 9216 input features to 128 output features, followed by a ReLU activation.
  • Another dropout layer (self.dropout2) with a probability of 0.5 is applied after fc1.
  • A final fully connected layer (self.fc2) maps 128 input features to 62 output features.
  • The output of the final fully connected layer is passed through a log_softmax function (nn.functional.log_softmax(x, dim=1)) to produce log-probabilities for each of the 62 classes.
  • Input: Grayscale images of handwritten characters, expected to be 28x28 pixels.
  • Output: Predicted class label (one of 62 categories corresponding to digits '0'-'9', uppercase 'A'-'Z', and lowercase 'a'-'z', consistent with the EMNIST 'ByClass' split).
  • License: Not specified.

Intended Use

This model is primarily intended for use within the OG1000/AI-HOCR-Project repository on GitHub. It serves for:

  • Research and development in handwritten character recognition.
  • Educational purposes to demonstrate image classification using CNNs with PyTorch.
  • Prototyping applications requiring individual handwritten digit and letter recognition.

Training Data

The model was trained on the EMNIST (Extended MNIST) dataset. EMNIST is a larger and more complex version of the MNIST dataset, derived from the NIST Special Database 19.

  • Dataset Split Used for Training: EMNIST ByClass (inferred from the model's 62 output classes, matching the 62 unbalanced classes of this split). This dataset contains 814,255 handwritten characters comprising digits, uppercase, and lowercase letters.
  • Data Characteristics: 28x28 pixel grayscale images. Images in the raw EMNIST format are typically inverted horizontally and rotated 90 degrees anti-clockwise, and may require pre-processing (e.g., rotation, inversion) to be human-readable or compatible with standard image viewing tools.

Performance

  • Evaluation Metrics: Accuracy, Loss
  • Performance on Test Set:
  • Accuracy: 90% (104840/116323 Test Batches)
  • Loss: 0.26954 (average loss)
  • Strengths:
  • The model is described as being fast.
  • Good generalization to unseen handwritten characters within the EMNIST distribution.
  • Relatively robust to variations in handwriting styles.
  • Limitations:
  • May struggle with highly ambiguous or uncharacteristic handwriting.
  • Performance might degrade on characters outside the EMNIST distribution or with different image characteristics (e.g., noise, resolution, different fonts).
  • The model is designed for individual character recognition and does not handle connected characters or full words.

Ethical Considerations and Biases

  • Dataset Bias: The EMNIST dataset, while extensive, is derived from a specific source (NIST). This may introduce biases related to the demographic distribution of contributors, handwriting styles, and common letter formations that might not generalize perfectly to all global handwriting styles.
  • Fairness: As with any character recognition system, there's a potential for bias if the training data does not adequately represent the diversity of handwriting styles. This model is not specifically designed for fairness mitigation beyond the dataset's inherent properties.
  • Misuse: The model should not be used for critical applications where misclassification could lead to significant harm or incorrect decisions without further validation, human oversight, and appropriate risk assessment.

Technical Specifications

  • Framework: PyTorch
  • Dependencies: torch, torch.nn, torch.functional. Additional dependencies for data handling (e.g., torchvision) and general Python utilities (os) are likely required. The UI uses tkinter, which is built into Python.
  • Hardware Requirements (Training): Training was performed in Google Colab, implying GPU usage for efficient training.
  • Hardware Requirements (Inference): The project aims to improve minimum requirements for older systems, suggesting it might be runnable on CPUs, but specific minimal requirements are not detailed.
  • Model Size: 4.83MB

Citation

If you use the EMNIST dataset, please cite the following paper: