{"id":28518972,"url":"https://github.com/utkarsh-284/deep-learning","last_synced_at":"2026-05-03T23:33:53.517Z","repository":{"id":297938337,"uuid":"998351949","full_name":"utkarsh-284/Deep-Learning","owner":"utkarsh-284","description":"This repository contains the documents and main project file needed for building DNN from scratch using NumPy.","archived":false,"fork":false,"pushed_at":"2025-06-08T13:33:12.000Z","size":5806,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-09T14:20:27.490Z","etag":null,"topics":["data-science","deep-learning","deep-neural-networks","machine-learning","mnist","mnist-handwriting-recognition","neural-networks","numpy","python3"],"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/utkarsh-284.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,"zenodo":null}},"created_at":"2025-06-08T12:35:06.000Z","updated_at":"2025-06-08T13:33:17.000Z","dependencies_parsed_at":"2025-06-08T13:46:28.481Z","dependency_job_id":null,"html_url":"https://github.com/utkarsh-284/Deep-Learning","commit_stats":null,"previous_names":["utkarsh-284/deep-learning"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/utkarsh-284/Deep-Learning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkarsh-284%2FDeep-Learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkarsh-284%2FDeep-Learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkarsh-284%2FDeep-Learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkarsh-284%2FDeep-Learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utkarsh-284","download_url":"https://codeload.github.com/utkarsh-284/Deep-Learning/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utkarsh-284%2FDeep-Learning/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32589256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"ssl_error","status_checked_at":"2026-05-03T22:09:10.534Z","response_time":103,"last_error":"SSL_read: 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":["data-science","deep-learning","deep-neural-networks","machine-learning","mnist","mnist-handwriting-recognition","neural-networks","numpy","python3"],"created_at":"2025-06-09T06:05:42.845Z","updated_at":"2026-05-03T23:33:53.500Z","avatar_url":"https://github.com/utkarsh-284.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Handwritten Digit Recognition with NumPy: Building a Deep Neural Network from Scratch\n\n![MNIST Digits](https://upload.wikimedia.org/wikipedia/commons/2/27/MnistExamples.png)\n\n## Overview\nThis project implements a **3-layer Deep Neural Network (DNN)** using only NumPy to classify handwritten digits from the MNIST dataset. By building all components from scratch—including forward/backward propagation, activation functions, and gradient descent—we demonstrate the foundational mechanics of deep learning without high-level frameworks like TensorFlow or PyTorch.\n\n**Key Features**:\n- Pure NumPy implementation (no DL frameworks)\n- He initialization for efficient learning\n- Mini-batch gradient descent optimization\n- ReLU activation in hidden layers\n- Softmax output layer with cross-entropy loss\n- Achieves **95% accuracy** on validation set\n\n## Project Structure\n```\n.\n├── DNN_using_NumPy.ipynb                              # Main Jupyter notebook with implementation\n├── Neural Networks and Deep Learning (Notes).pdf      # Notes explaining Mathematical part of Neural Networks\n├── train.csv                                          # MNIST training data (CSV format)\n├── README.md                                          # This documentation\n└── requirements.txt                                   # Python dependencies\n```\n\n## How to Run\n1. **Install Dependencies**:\n   ```bash\n   pip install -r requirements.txt\n   ```\n   Requirements: NumPy, pandas, scikit-learn\n\n2. **Download Data**:\n   - Place `train.csv` in the project directory (available on [Kaggle](https://www.kaggle.com/competitions/digit-recognizer/data))\n\n3. **Execute the Notebook**:\n   ```bash\n   jupyter notebook DNN_using_NumPy.ipynb\n   ```\n\n4. **Training Process**:\n   - 3-layer network (128 → 64 → 10 units)\n   - 20 epochs with batch size 64\n   - Learning rate: 0.01\n   - Loss decreases from 1.12 to 0.13\n\n## Results\n| Epoch | Loss     | Validation Accuracy |\n|-------|----------|---------------------|\n| 1     | 1.1287   | -                   |\n| 10    | 0.2068   | -                   |\n| **20**| **0.1366**| **95.07%**          |\n\n\n## Key Components\n### 1. Network Architecture\n```python\nInput (784) → Hidden 1 (128, ReLU) → Hidden 2 (64, ReLU) → Output (10, Softmax)\n```\n\n### 2. Core Functions\n- **Initialization**: He weight initialization (`init_params()`)\n- **Forward Propagation**: `forward_prop()`\n- **Activation Functions**: ReLU and Softmax\n- **Loss Calculation**: Cross-entropy (`cross_entropy()`)\n- **Backpropagation**: `backward_prop()`\n- **Parameter Update**: Gradient descent (`update_params()`)\n\n### 3. Training\nMini-batch gradient descent with shuffling:\n```python\nfor epoch in range(epochs):\n    perm = np.random.permutation(n)\n    for i in range(0, n, batch_size):\n        # Forward pass, loss calculation, backprop, update\n```\n\n## Future Improvements\n1. **Hyperparameter Tuning**:\n   - Implement learning rate scheduling\n   - Experiment with Adam optimizer\n   \n2. **Regularization Techniques**:\n   - Add L2 regularization\n   - Implement dropout layers\n\n3. **Architecture Enhancements**:\n   - Add batch normalization\n   - Extend to convolutional layers (CNN)\n   \n4. **Deployment**:\n   - Create web interface for real-time predictions\n   - Optimize for mobile devices using ONNX\n\n## Dependencies\n- Python 3.7+\n- NumPy 1.21+\n- pandas 1.3+\n- scikit-learn 1.0+\n\n## Contributor\n**Utkarsh Bhardwaj**  \n[![LinkedIn](https://img.shields.io/badge/LinkedIn-Utkarsh284-blue)](https://www.linkedin.com/in/utkarsh284/)\n[![GitHub](https://img.shields.io/badge/GitHub-utkarsh--284-lightgrey)](https://github.com/utkarsh-284)  \n**Contact**: ubhardwaj284@gmail.com  \n**Publish Date**: 8th June, 2025  \n\n---\n\n**Why This Project Stands Out**: By implementing every neural network component from scratch, we demystify deep learning fundamentals while achieving competitive performance. This serves as both an educational resource and a foundation for more complex architectures.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futkarsh-284%2Fdeep-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futkarsh-284%2Fdeep-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futkarsh-284%2Fdeep-learning/lists"}