{"id":15157700,"url":"https://github.com/behradsadeghi/flower-classification-efficientnet","last_synced_at":"2026-01-21T01:02:01.458Z","repository":{"id":255432781,"uuid":"849602032","full_name":"Behradsadeghi/flower-classification-efficientnet","owner":"Behradsadeghi","description":"Classifying images of flowers into 17 categories using EfficientNet-B0 and PyTorch.","archived":false,"fork":false,"pushed_at":"2024-08-29T23:16:52.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T16:53:49.643Z","etag":null,"topics":["cnn","deep-learning","efficientnet","gradient-accumulation","image-classification","mixed-precision","pytorch","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Behradsadeghi.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}},"created_at":"2024-08-29T22:29:37.000Z","updated_at":"2024-08-29T23:21:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"1e87438d-6fe0-4c85-bfd7-e0d38c721314","html_url":"https://github.com/Behradsadeghi/flower-classification-efficientnet","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"b8e57db3e383243011ade7f2ade96eaa71667392"},"previous_names":["behradsadeghi/flower-classification-efficientnet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Behradsadeghi%2Fflower-classification-efficientnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Behradsadeghi%2Fflower-classification-efficientnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Behradsadeghi%2Fflower-classification-efficientnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Behradsadeghi%2Fflower-classification-efficientnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Behradsadeghi","download_url":"https://codeload.github.com/Behradsadeghi/flower-classification-efficientnet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247668603,"owners_count":20976245,"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":["cnn","deep-learning","efficientnet","gradient-accumulation","image-classification","mixed-precision","pytorch","transfer-learning"],"created_at":"2024-09-26T20:01:43.367Z","updated_at":"2026-01-21T01:02:01.341Z","avatar_url":"https://github.com/Behradsadeghi.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌸 Flower Classification using EfficientNet-B0\n\nThis project demonstrates a deep learning pipeline to classify images of flowers into 17 different categories using a pre-trained EfficientNet-B0 model. It utilizes PyTorch and TIMM (PyTorch Image Models) for training, validation, and testing, implementing mixed precision training to optimize performance. The dataset used is the [**17 Flower Classes**](https://www.kaggle.com/datasets/aima138/17flowerclasses) dataset.\n\n## 📚 Table of Contents\n\n- [🌟 Introduction](#-introduction)\n- [✨ Features](#-features)\n- [⚙️ Installation](#️-installation)\n- [📂 Dataset](#-dataset)\n- [🛠️ Training](#-training)\n- [📊 Results](#-results)\n- [📝 License](#-license)\n\n## 🌟 Introduction\n\nThe goal of this project is to classify flowers into 17 different classes using deep learning. We leverage transfer learning with the EfficientNet-B0 model pre-trained on ImageNet and fine-tune it on our flower dataset. The model training and evaluation are conducted using mixed precision training to reduce memory usage and improve training speed.\n\n## ✨ Features\n\n- **Transfer Learning:** Utilizes the EfficientNet-B0 model pre-trained on ImageNet.\n- **Mixed Precision Training:** Reduces memory consumption and accelerates training.\n- **Dataset Augmentation:** Resizing and normalization of images to improve model generalization.\n- **Gradient Accumulation:** Handles larger batch sizes without exceeding GPU memory.\n- **Training, Validation, and Test Phases:** Clearly separated phases for training, validation, and testing to monitor performance.\n\n## ⚙️ Installation\n\n### Prerequisites\n\nEnsure you have the following installed:\n\n- Python 3.7+\n- PyTorch\n- TIMM (PyTorch Image Models)\n- Other dependencies: `numpy`, `PIL`, `matplotlib`, `torchvision`, `tqdm`, `gc`\n\n## 📂 Dataset\n\nThe dataset contains images of 17 different flower classes. It is divided into training, validation, and test sets. You can download the dataset from Kaggle using the following link: [17 Flower Classes Dataset](https://www.kaggle.com/datasets/aima138/17flowerclasses).\n\n- **Train Directory:** Contains the images used for training the model.\n- **Validation:** A portion (20%) of the training dataset is set aside for validation to monitor model performance and avoid overfitting.\n- **Test Directory:** Contains the images used for testing the model.\n\n## 🛠️ Training\n\nThe model is trained using a PyTorch script that includes functions for:\n\n- **Loading and Transforming Data:** Resize to 299x299, normalization using ImageNet mean and std.\n- **Training Loop:** Implements gradient accumulation for better memory management.\n- **Validation:** A separate validation set, comprising 20% of the training data, is used to evaluate the model after each epoch to monitor validation accuracy and loss.\n- **Saving Best Model:** The model with the best validation accuracy is saved.\n\n## 📊 Results\n\n- The best model weights based on validation accuracy are saved during training.\n- After training, the model was evaluated on the test set to determine its classification accuracy.\n- **Test Accuracy:** The model achieved an accuracy of **96.47%** on the test set.\n\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%2Fbehradsadeghi%2Fflower-classification-efficientnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbehradsadeghi%2Fflower-classification-efficientnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehradsadeghi%2Fflower-classification-efficientnet/lists"}