{"id":15176672,"url":"https://github.com/innocentsinner08/digit-recognition","last_synced_at":"2026-02-12T23:03:33.757Z","repository":{"id":255235202,"uuid":"848939834","full_name":"InnocentSinner08/digit-recognition","owner":"InnocentSinner08","description":"Digit-recognition","archived":false,"fork":false,"pushed_at":"2024-08-28T18:01:43.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T18:50:13.613Z","etag":null,"topics":["cnn","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InnocentSinner08.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-28T17:23:43.000Z","updated_at":"2024-08-28T18:03:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"ea1e8a03-f9bd-4db1-bf4d-d247732cd05d","html_url":"https://github.com/InnocentSinner08/digit-recognition","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"c71925618924057dfb4093858aad23e5f3789eb9"},"previous_names":["innocentsinner08/digit-recognition"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/InnocentSinner08/digit-recognition","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InnocentSinner08%2Fdigit-recognition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InnocentSinner08%2Fdigit-recognition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InnocentSinner08%2Fdigit-recognition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InnocentSinner08%2Fdigit-recognition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InnocentSinner08","download_url":"https://codeload.github.com/InnocentSinner08/digit-recognition/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InnocentSinner08%2Fdigit-recognition/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274051312,"owners_count":25214024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","tensorflow"],"created_at":"2024-09-27T13:40:14.789Z","updated_at":"2026-02-12T23:03:33.713Z","avatar_url":"https://github.com/InnocentSinner08.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Handwritten Digit Recognition using Keras and TensorFlow\n## Introduction\nIn this project, I will develop a deep learning model to achieve a near state-of-the-art performance on the MNIST handwritten dataset. I'm going to use Keras with TensorFlow.\n\n### MNIST Dataset\nThis dataset was constructed from a number of scanned document datasets availabe from the National Institute of Standards and Technology (NIST). These images were normalized in size and centered. Each image is in a 28x28 square (784 pixels). 60,000 images were used to train a model and 10,000 were used to test it. Excellent results achieve a prediction error of 1%. State-of-the-art results are approximately 0.2% which could be achieved with a large convolutional neural network.\n\n## Baseline Model with Multilayer Perceptrons\nWe start with a baseline model so we can compare our convolutional neural network that we will use later.\nTo do a multilayer perceptron model, we flatten our 28 by 28 pixel images into a single 784 length vector for each image.\nWe then change the grayscale values from 0-255 to 0-1 to make things easier on our neural network. (Normalization)\nFinally, we change the categories 1-9 into a binary matrix.\nOur current neural network structure is as follows:\n\n**Visible Layer (784 Inputs) \u003e\u003e Hidden Layer (784 Neurons) \u003e\u003e Output Layer (10 Outputs)**\n\n## Simple Convolutional Neural Network for MNIST\nAs expected, we achieved around 1-2% error which is great. However, we can do better. Here, we take advantage of Kera's capability of creating convolutional neural networks. We will use all aspects of a modern CNN implementation, including convolutional layers, pooling layers, and dropout layers.\nHere are our changes for the baseline model:\nWe add a convolutional layer with 32 feature maps, with a size of 5 x 5. This is also our input layer which expects images to be added.\nWe then define a pool size of 2 x 2.\nWe randomly dropout 20% of our neurons to reduce the amount of overfitting.\nWe then flatten our data.\nWe add 128 neurons with a rectifer activation function like above.\nFinally we use 10 neurons for the 10 prediction classes with a softmax activation function to output probability-like prediction for each class.\nOur current neural network structure is as follows:\n\n**Visible Layer (1x28x28 Inputs) \u003e\u003e Convolutional Layer (32 maps, 5x5) \u003e\u003e Max Pooling Layer (2x2) \u003e\u003e Dropout Layer (20%) \u003e\u003e Flatten Layer \u003e\u003e Hidden Layer (128 Neurons) \u003e\u003e Output Layer (10 Outputs)**\n\n## Larger Convolutional Neural Network for MNIST\nHere we achieved around 1% error which is excellent. However, we can hit state-of-the-art results. Here, we deepen and widen our neural network.\nOur current neural network structure is as follows:\n\n**Visible Layer (1x28x28 Inputs) \u003e\u003e Convolutional Layer (30 maps, 5x5) \u003e\u003e Max Pooling Layer (2x2) \u003e\u003e Convolutional Layer (15 maps, 3x3) \u003e\u003e Max Pooling Layer (2x2) \u003e\u003e Dropout Layer (20%) \u003e\u003e Hidden Layer (128 Neurons) \u003e\u003e Hidden Layer (50 Neurons) \u003e\u003e Output Layer (10 Outputs)**\n\n## Conclusion\nWith our ability to take advantage of larger convolutional neural network with Keras, we were able to go from 1-2% prediction error to less than 1%, near-state-of-the-art results! However, even with this model there are still further improvements which we can do with image augmentation and a much more powerful GPU.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnocentsinner08%2Fdigit-recognition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finnocentsinner08%2Fdigit-recognition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnocentsinner08%2Fdigit-recognition/lists"}