{"id":19531417,"url":"https://github.com/ranpy13/digit_recognition_rmodel","last_synced_at":"2026-02-07T08:32:25.753Z","repository":{"id":261939879,"uuid":"885717743","full_name":"ranpy13/digit_recognition_Rmodel","owner":"ranpy13","description":"Implementing handwriting recognition for digits in a grayscale image grid stored in csv files, implemented using single layer and multi layer convolution neural networks through mxnet on R","archived":false,"fork":false,"pushed_at":"2024-11-09T19:39:20.000Z","size":19874,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T17:52:00.919Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ranpy13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2024-11-09T07:48:09.000Z","updated_at":"2025-02-23T09:15:09.000Z","dependencies_parsed_at":"2024-11-09T12:26:14.081Z","dependency_job_id":"b255d6c9-3d35-43e7-b96d-0fbd6fdabf6b","html_url":"https://github.com/ranpy13/digit_recognition_Rmodel","commit_stats":null,"previous_names":["ranpy13/digit_recognition_rmodel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ranpy13/digit_recognition_Rmodel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranpy13%2Fdigit_recognition_Rmodel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranpy13%2Fdigit_recognition_Rmodel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranpy13%2Fdigit_recognition_Rmodel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranpy13%2Fdigit_recognition_Rmodel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ranpy13","download_url":"https://codeload.github.com/ranpy13/digit_recognition_Rmodel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranpy13%2Fdigit_recognition_Rmodel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29190201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T07:37:03.739Z","status":"ssl_error","status_checked_at":"2026-02-07T07:37:03.029Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2024-11-11T01:42:47.865Z","updated_at":"2026-02-07T08:32:25.733Z","avatar_url":"https://github.com/ranpy13.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Handwritten Digit Recognition using Convolutional Neural Networks\n\nThis project implements a handwritten digit recognition system using various machine learning techniques, including logistic regression, single-layer neural networks, multi-layer neural networks, and convolutional neural networks (CNNs). The dataset used is the popular MNIST dataset, which consists of 28x28 pixel images of handwritten digits (0-9).\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Data Exploration](#data-exploration)\n- [Modeling Techniques](#modeling-techniques)\n  - [Logistic Regression](#logistic-regression)\n  - [Single-layer Neural Networks](#single-layer-neural-networks)\n  - [Multi-layer Neural Networks](#multi-layer-neural-networks)\n  - [Convolutional Neural Networks](#convolutional-neural-networks)\n- [Results](#results)\n- [Visualizations](#visualizations)\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n\n## Introduction\n\nThe goal of this project is to classify handwritten digits using deep learning techniques. The project explores different models and evaluates their performance on the MNIST dataset.\n\n## Data Exploration\n\nThe dataset is loaded from a CSV file, and the following steps are performed:\n\n- Dimensions and structure of the data are examined.\n- Unique labels and pixel value ranges are analyzed.\n- Sample images are visualized.\n- The target variable is transformed from integer to factor for classification.\n\n```r\ndata \u003c- read.csv(\"train.csv\")\ndim(data)\nhead(data[1:6])\nsummary(data$label)\n```\n\n## Modeling Techniques\n\n### Logistic Regression\n\nA multinomial logistic regression model is trained and evaluated.\n\n```r\nlibrary(nnet)\nmodel_lr \u003c- multinom(label ~ ., data=data_train)\nprediction_lr \u003c- predict(model_lr, data_test, type = \"class\")\n```\n\n### Single-layer Neural Networks\n\nA single-layer neural network is implemented using the `nnet` package.\n\n```r\nmodel_nn \u003c- nnet(label ~ ., data=data_train, size=50)\nprediction_nn \u003c- predict(model_nn, data_test, type = \"class\")\n```\n\n### Multi-layer Neural Networks\n\nA multi-layer neural network is built using the `mxnet` package.\n\n```r\nrequire(mxnet)\nmodel_dnn \u003c- mx.model.FeedForward.create(softmax, X=data_train.x, y=data_train.y)\n```\n\n### Convolutional Neural Networks\n\nA convolutional neural network is constructed to improve classification accuracy.\n\n```r\nconv1 \u003c- mx.symbol.Convolution(data=data, kernel=c(5,5), num_filter=20)\nmodel_cnn \u003c- mx.model.FeedForward.create(softmax, X=train.array, y=data_train.y)\n```\n\n## Results\n\nThe performance of each model is evaluated using confusion matrices and accuracy metrics.\n\n```r\ncm_lr \u003c- table(data_test$label, prediction_lr)\naccuracy_lr \u003c- mean(prediction_lr == data_test$label)\n```\n\n## Visualizations\n\nVisualizations include:\n\n- Sample images from the dataset.\n- Activation maps from convolutional layers.\n- Learning curves for model training.\n\n```r\npar(mfrow=c(4,4))\nfor (i in 1:16) {\n  outputData \u003c- as.array(executor$ref.outputs$activation15_output)[,,i,1]\n  image(outputData, xaxt='n', yaxt='n', col=grey.colors(255))\n}\n```\n\n## Installation\n\nTo run this project, you need to have R and the following packages installed:\n\n- `nnet`\n- `caret`\n- `mxnet`\n\nYou can install the required packages using:\n\n```r\ninstall.packages(c(\"nnet\", \"caret\"))\n```\n\nFor `mxnet`, follow the installation instructions on the [MXNet R package page](https://mxnet.apache.org/get_started/).\n\n## Usage\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/ranpy13/digit_recognition_Rmodel.git\n   cd digit_recognition_Rmodel\n   ```\n\n2. Load the dataset and run the R script:\n   ```r\n   source(\"main.R\")\n   ```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\nFeel free to modify the content as needed to better fit your project specifics!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Franpy13%2Fdigit_recognition_rmodel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Franpy13%2Fdigit_recognition_rmodel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Franpy13%2Fdigit_recognition_rmodel/lists"}