Skip to content

This project leverages TensorFlow and Keras to implement deep learning techniques, focusing on CNNs for recognizing handwritten digits from images. Integrated with OpenCV, it ensures precise digit extraction through robust image preprocessing and manipulation.

Notifications You must be signed in to change notification settings

sayande01/Handwritten_Digits_Recognition_NN

Repository files navigation

Title: Handwritten Digit Recognition System Using TensorFlow, Keras, and OpenCV Neural Networks

Workflow -

  1. Data Preparation and Preprocessing:

    • Load the MNIST dataset containing handwritten digit samples.
    • Split the dataset into training and testing sets.
    • Normalize the pixel values of the images to a range between 0 and 1 to enhance model performance and convergence during training.
  2. Model Architecture Design:

    • Create a neural network model using TensorFlow and Keras.
    • Design the model architecture:
      • Include a flattened input layer to accept the pixel values of the digit images.
      • Add two dense hidden layers with ReLU activation functions to capture complex patterns in the data.
      • Incorporate a dense output layer with softmax activation to classify the digits into ten categories (0 to 9).
  3. Model Training and Evaluation:

    • Compile the model, specifying the optimizer as 'adam' and the loss function as 'sparse_categorical_crossentropy'.
    • Train the model on the training dataset for a predefined number of epochs.
    • Evaluate the trained model's performance on the testing dataset to calculate metrics such as loss and accuracy.
  4. Model Saving and Loading:

    • Implement functionality to save the trained model to disk as 'handwritten_digits.model' for future use.
    • Provide the option to load the pre-trained model from disk if available, allowing for inference on new data without retraining.
  5. Custom Image Prediction:

    • Develop functionality to load custom images containing handwritten digits.
    • Preprocess the custom images to ensure compatibility with the model input format.
    • Utilize the trained model to predict the digit represented by each custom image.
    • Visualize the predicted digit alongside the original image using matplotlib.
  6. Error Handling and Robustness:

    • Implement robust error handling mechanisms to manage exceptions during image loading, preprocessing, and prediction.
    • Ensure the system's reliability by addressing potential issues such as incorrect image paths or corrupted image files.

About

This project leverages TensorFlow and Keras to implement deep learning techniques, focusing on CNNs for recognizing handwritten digits from images. Integrated with OpenCV, it ensures precise digit extraction through robust image preprocessing and manipulation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published