Git Product home page Git Product logo

handigit-ai's Introduction

handigit-ai

Develop a neural network that can correctly classify images of handwritten digits. Training using the MNIST dataset.

Handigit Neural Network

Clone the repo:

git clone https://github.com/jacar-javi/handigit-ai.git

To launch application run:

pip install -r requirements.txt
python handigit-ai.py

Step 1: Develop an Artificial Neural Network capable of classifying handwritten digits

We will use a Keras library based secuential Artificial Neural Network with 3 layers:

  1. Flattening Layer: Converts 28x28 pixel 2D images to a 784 element 1D vector.
  2. Dense Hidden Layer: With 128 neurons and ReLU (Rectified Linear Unit) activation function. This layer is responsible for learning the relevant features of the images for digit classification.
  3. Dense Output Layer: With 10 neurons and Softmax activation function. This layer generates the probabilities that the input image belongs to each of the 10 possible classes (digits 0 to 9).

The model is compiled by specifying the optimizer (in this case 'adam'), the loss function (in this case 'categorical_crossentropy'), and the evaluation metric (in this case 'accuracy').

Step 2: Train NN with MNIST dataset and evaluate its accuracy.

  1. Load the MNIST dataset and split it into two subsets: training and testing.
  2. The pixel values of the images are normalized so that they are in the range of 0 to 1.
  3. Labels are converted to one-hot encoding so that they can be used in the neural network.

The model is trained using the training dataset (x_train, y_train) and validating it on the test dataset (x_test, y_test). Training is performed for a specified number of epochs (in this case, 10) and with a specified batch_size (in this case, 32).

Model performance during training is visualized using graphs showing accuracy and loss as a function of the number of epochs. These graphs allow you to assess how the model learns over time and detect potential overfitting or underfitting issues.

model_training_epochs

model_training_performance

After model training is complete, the model's performance is evaluated on the test dataset for loss and accuracy.

model_training_validation

Step 3: Save trained model to use in future apps

Trained model saved as trained-model.h5

handigit-ai's People

Contributors

jacar-javi avatar

Watchers

 avatar Kostas Georgiou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.