{"id":20812466,"url":"https://github.com/chandkund/image-classification-using-the-mnist-dataset","last_synced_at":"2026-04-08T20:35:14.372Z","repository":{"id":254320447,"uuid":"846173337","full_name":"chandkund/Image-classification-using-the-mnist-dataset","owner":"chandkund","description":"Image Classification using the MNIST dataset. This project leverages a Convolutional Neural Network (CNN) to recognize and classify handwritten digits with high accuracy. Includes data preprocessing, model architecture, and evaluation. Explore the code and results here!","archived":false,"fork":false,"pushed_at":"2025-03-08T18:29:05.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-12T23:39:55.878Z","etag":null,"topics":["computer-vision","data-science","machine-learning","matplotlib","numpy","pandas","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chandkund.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-22T17:09:16.000Z","updated_at":"2025-03-08T18:29:09.000Z","dependencies_parsed_at":"2025-12-12T00:08:31.703Z","dependency_job_id":null,"html_url":"https://github.com/chandkund/Image-classification-using-the-mnist-dataset","commit_stats":null,"previous_names":["chandkund/image-classification-using-the-mnist-dataset"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chandkund/Image-classification-using-the-mnist-dataset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandkund%2FImage-classification-using-the-mnist-dataset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandkund%2FImage-classification-using-the-mnist-dataset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandkund%2FImage-classification-using-the-mnist-dataset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandkund%2FImage-classification-using-the-mnist-dataset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chandkund","download_url":"https://codeload.github.com/chandkund/Image-classification-using-the-mnist-dataset/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandkund%2FImage-classification-using-the-mnist-dataset/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31573788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["computer-vision","data-science","machine-learning","matplotlib","numpy","pandas","python"],"created_at":"2024-11-17T20:54:38.771Z","updated_at":"2026-04-08T20:35:14.316Z","avatar_url":"https://github.com/chandkund.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image-classification-using-the-mnist-dataset\n\nThis project focuses on building and training a model to classify handwritten digits using the MNIST dataset. The MNIST dataset consists of 60,000 training images and 10,000 test images, each representing a digit from 0 to 9.  \n \n## Table of Contents     \n   \n- [Project Overview](#project-overview)          \n- [Installation](#installation)       \n- [Usage](#usage)               \n- [Code Explanation](#code-explanation)                      \n- [Model Evaluation](#model-evaluation)            \n- [License](#license)       \n               \n## Project Overview    \n   \nThe goal of this project is to develop a machine learning model that can accurately classify handwritten digits. This is a common benchmark problem in machine learning, especially in the field of deep learning. The project uses a simple convolutional neural network (CNN) to achieve high accuracy on the test set.\n\n## Installation\n\nTo run this project, you will need Python along with the following libraries:\n\n- `tensorflow`\n- `keras`\n- `numpy`\n- `matplotlib`\n-  `seaborn`\n\nYou can install the required packages using `pip`:\n\n```bash\npip install tensorflow keras numpy matplotlib\n```\n\n## Usage\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/chandkund/Image-classification-using-the-mnist-dataset.git\n    cd Image-classification-using-the-mnist-dataset\n    ```\n\n2. Run the script to train and evaluate the model:\n\n    ```bash\n    python train_model.py\n    ```\n\n## Code Explanation\n\n- **Import Libraries**:\n\n    ```python\n  import tensorflow as tf\n  import pandas as pd\n  import numpy as np\n  import matplotlib.pyplot as plt\n  import seaborn as sns\n  from tensorflow.keras import models\n  import tensorflow_datasets as tfds\n\n    ```\n\n- **Load and Preprocess Data**:\n\n    ```python\n    \n  # Load the MNIST dataset\n  (x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()\n\n  # Check the shape of the training data\n  print(\"Training data shape:\", x_train.shape)\n  print(\"Training labels shape:\", y_train.shape)\n\n  x_train,x_test = x_train/255.0,x_test/255.0 \n\n    ```\n\n - **Visualize  **:\n  ```python\n  # Display the first 25 images from the training set and their class names\n  class_names=['0','1','2','3','4','5','6','7','8','9']\n  import matplotlib.pyplot as plt\n  plt.figure(figsize=(10,10))\n  for i in range(25):\n     plt.subplot(5,5,i+1)\n     plt.xticks([])\n     plt.yticks([])\n     plt.grid(False)\n     plt.imshow(x_train[i], cmap=plt.cm.binary)\n     plt.xlabel(class_names[y_train[i]])\n  plt.show()\n```\n\n\n- **Build the CNN Model**:\n\n    ```python\n  hidden_layer= 64\n  output_layer=10\n  model = models.Sequential([\n    tf.keras.layers.Flatten(input_shape=(28,28,1)),\n    tf.keras.layers.Dense(128,activation='relu'),\n    tf.keras.layers.Dense(64,activation='relu'),\n    tf.keras.layers.Dense(10,activation='softmax')\n  ])\n    ```\n\n- **Compile and Train the Model**:\n\n    ```python\n     model.compile(optimizer = 'adam', loss ='categorical_crossentropy',metrics=['accuracy'])\n\n    history=model.fit(x_train,y_train,epochs=10,batch_size=32,validation_data=(x_test,y_test),verbose=2)\n    ```\n\n- **Evaluate the Model**:\n\n    ```python\n  test_loss,test_accuracy=model.evaluate(x_test,y_test)    print(f'Test Accuracy: {test_acc}')\n  print('Test loss:{0:2f}.Test accuracy:{1:.2f}%'.format(test_loss,test_accuracy*100))\n    \n    ```\n\n- **Visualize Training History**:\n\n    ```python\n    # Assuming class names are the digits from 0 to 9\n    class_names=['0','1','2','3','4','5','6','7','8','9']\n\n  # Make predictions on the test set\n  predictions = model.predict(x_test)\n\n  # Display the first 5 predictions and actual labels\n  for i in range(5):\n    predicted_label = tf.argmax(predictions[i]).numpy()\n    actual_label = tf.argmax(y_test[i]).numpy()\n    print(f\"Predicted: {class_names[predicted_label]}, Actual: {class_names[actual_label]}\"\n\n    ```\n\n## Model Evaluation\n\nAfter training, the model is evaluated on the test dataset to determine its accuracy in classifying handwritten digits. The evaluation metrics include accuracy and loss.\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchandkund%2Fimage-classification-using-the-mnist-dataset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchandkund%2Fimage-classification-using-the-mnist-dataset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchandkund%2Fimage-classification-using-the-mnist-dataset/lists"}