mnist-ann-model / README.md
ramanat1968's picture
Upload folder using huggingface_hub
7a344ab verified
|
Raw
History Blame Contribute Delete
835 Bytes
metadata
tags:
  - computer-vision
  - tensorflow
  - keras
  - mnist
  - classification
license: mit

MNIST Digit Recognition (ANN - TensorFlow/Keras)

This model is a simple Artificial Neural Network (ANN) trained on the MNIST dataset to classify handwritten digits (0–9).

Architecture

  • Input: 28x28 grayscale image
  • Flatten layer
  • Dense(128, ReLU)
  • Dense(10, Softmax)

Training

  • Dataset: MNIST
  • Optimizer: Adam
  • Loss: Sparse Categorical Crossentropy
  • Epochs: 5

Performance

Achieves ~97–98% test accuracy.

Usage

import tensorflow as tf
import numpy as np

model = tf.keras.models.load_model("mnist_ann_model.keras")

# Example input (28x28 image normalized)
sample = np.random.rand(1, 28, 28)

pred = model.predict(sample)
print(np.argmax(pred))

Notes

This is a beginner-friendly ANN model (not CNN).