{"id":24625375,"url":"https://github.com/sar-dul/convolutional-neural-network","last_synced_at":"2026-05-06T04:32:46.317Z","repository":{"id":273751237,"uuid":"920733987","full_name":"sar-dul/Convolutional-Neural-Network","owner":"sar-dul","description":"Repository showcasing CNN implementations (VGG-11 \u0026 AlexNet) and transfer learning experiments with custom and pre-trained models (ResNet, ConvNeXtV2). Includes Gradio-based UI and FastAPI backend for inference.","archived":false,"fork":false,"pushed_at":"2025-01-22T18:19:39.000Z","size":90461,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T19:28:51.573Z","etag":null,"topics":["backpropagation","cnn","fastapi","transfer-learning"],"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/sar-dul.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":"2025-01-22T17:22:20.000Z","updated_at":"2025-01-22T18:23:06.000Z","dependencies_parsed_at":"2025-01-22T19:39:18.424Z","dependency_job_id":null,"html_url":"https://github.com/sar-dul/Convolutional-Neural-Network","commit_stats":null,"previous_names":["sar-dul/convolutional-neural-network"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sar-dul%2FConvolutional-Neural-Network","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sar-dul%2FConvolutional-Neural-Network/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sar-dul%2FConvolutional-Neural-Network/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sar-dul%2FConvolutional-Neural-Network/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sar-dul","download_url":"https://codeload.github.com/sar-dul/Convolutional-Neural-Network/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244394469,"owners_count":20445634,"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","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":["backpropagation","cnn","fastapi","transfer-learning"],"created_at":"2025-01-25T04:33:27.672Z","updated_at":"2026-05-06T04:32:46.286Z","avatar_url":"https://github.com/sar-dul.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CNN Transfer Learning Repository\n\nThis repository contains implementations and experiments with Convolutional Neural Networks (CNNs), focusing on transfer learning for image classification tasks. Below is a detailed overview of the contents and methodology.\n\n## Table of Contents\n\n1. [Overview](#overview)\n2. [Implemented Models](#implemented-models)\n3. [Datasets](#datasets)\n4. [Transfer Learning](#transfer-learning)\n5. [Project Structure](#project-structure)\n6. [Inference](#inference)\n7. [How to Use](#how-to-use)\n8. [Results](#results)\n9. [Dependencies](#dependencies)\n\n## Overview\n\nThis project demonstrates the following workflows:\n\n- Implementation of VGG-11 and AlexNet from scratch.\n- Training these models on a subset of the ImageNet dataset with 10 classes.\n- Transfer learning for binary classification (cats vs. dogs).\n- Transfer learning using pre-trained ResNet and ConvNeXtV2 models from Hugging Face.\n- Model inference using Gradio for the frontend and FastAPI for the backend.\n\n## Implemented Models\n\n1. **VGG-11**\n\n   - Built and trained from scratch using PyTorch.\n   - Optimized for classification on a 10-class ImageNet subset.\n\n2. **AlexNet**\n\n   - Implemented and trained similarly to VGG-11.\n\n## Datasets\n\n- **ImageNet Subset (10 Classes):** Used for initial training of VGG-11 and AlexNet.\n- **Cats vs. Dogs Dataset:** Used for transfer learning experiments.\n\n## Transfer Learning\n\n1. **Custom Models (VGG-11 and AlexNet):**\n\n   - The classification head was modified to handle binary classification (cats vs. dogs).\n   - Pre-trained weights from the 10-class ImageNet training were utilized.\n\n2. **Pre-trained ResNet and ConvNeXtV2:**\n\n   - Leveraged models available on Hugging Face.\n   - Fine-tuned on the cats vs. dogs dataset.\n\n## Project Structure\n\n- **Root Folder:**\n\n  - `CNN_AlexNet.ipynb`: Implementation of AlexNet from scratch.\n  - `CNN_manual_backpropagation.ipynb`: Manual backpropagation implementation.\n  - `CNN_VGG.ipynb`: Implementation of VGG-11 from scratch.\n  - `Transfer_learning_on_own_AlexNet_model.ipynb`: Transfer learning experiments with custom AlexNet.\n  - `Transfer_learning_on_pretrained_models.ipynb`: Transfer learning experiments with pre-trained models (ResNet, ConvNeXtV2).\n\n- **App Folder:**\n\n  - `test_images/`: Sample images for testing.\n  - `gradio_UI.py`: Gradio interface for model inference.\n  - `inference.py`: Backend logic for inference.\n  - `main.py`: FastAPI app entry point.\n  - `ResNet_model.pth`: Pre-trained ResNet model file.\n\n## Inference\n\n- **Frontend:**\n  - Built using [Gradio](https://gradio.app) for user-friendly interaction.\n- **Backend:**\n  - Implemented using [FastAPI](https://fastapi.tiangolo.com) for fast and scalable API endpoints.\n\n## How to Use\n\n1. **Clone the Repository:**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd \u003crepository-folder\u003e\n   ```\n\n2. **Run Inference Server:**\n   ```bash\n   uvicorn app:app --reload\n   ```\n3. **Launch Gradio Interface:**\n   ```bash\n   python gradio_UI.py\n   ```\n\n## Results\n\n| Model           | Dataset             | Accuracy |\n| --------------- | ------------------- | -------- |\n| VGG-11          | ImageNet (10-class) | 62.90%      |\n| AlexNet         | ImageNet (10-class) | 74.62%      |\n| AlexNet (TL)    | Cats vs. Dogs       | 66.88%      |\n| ResNet (TL)     | Cats vs. Dogs       | 97.75%      |\n| ConvNeXtV2 (TL) | Cats vs. Dogs       | 85.12%      |\n\n## Dependencies\n\n- PyTorch\n- Gradio\n- FastAPI\n- Hugging Face Transformers\n\n## Contributing\n\nFeel free to fork this repository, submit issues, or create pull requests for improvements and bug fixes.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsar-dul%2Fconvolutional-neural-network","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsar-dul%2Fconvolutional-neural-network","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsar-dul%2Fconvolutional-neural-network/lists"}