https://github.com/aidinhamedi/pytorch-garbage-classification-v2
A Pytorch project for garbage classification using the EfficientNet-B6 model to achive a 95.78% accuracy on the test set. π
https://github.com/aidinhamedi/pytorch-garbage-classification-v2
ai artificial-intelligence classification computer-science computer-vision convolutional-neural-networks deep-learning example-project garbage-classification machine-learning python python3 pytorch template
Last synced: 2 months ago
JSON representation
A Pytorch project for garbage classification using the EfficientNet-B6 model to achive a 95.78% accuracy on the test set. π
- Host: GitHub
- URL: https://github.com/aidinhamedi/pytorch-garbage-classification-v2
- Owner: AidinHamedi
- License: mit
- Created: 2024-09-19T16:53:59.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-10-10T07:07:38.000Z (8 months ago)
- Last Synced: 2024-11-26T15:50:20.396Z (6 months ago)
- Topics: ai, artificial-intelligence, classification, computer-science, computer-vision, convolutional-neural-networks, deep-learning, example-project, garbage-classification, machine-learning, python, python3, pytorch, template
- Language: Jupyter Notebook
- Homepage:
- Size: 62.7 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Garbage Classification V2 with PyTorch
![]()
![]()
![]()
[](https://opensource.org/licenses/MIT)
[](https://github.com/astral-sh/ruff)A Pytorch project for garbage classification using the **EfficientNet-B6** model to achieve a **95.78%** accuracy on the test set.
> [!IMPORTANT]
> This project is a new version of the original project, which can be found [here](https://github.com/Aydinhamedi/Pytorch-Garbage-Classification) **but with a significantly improved training process + code and a different dataset**.## π Bonus
This project is not hard coded for this specific dataset, so it can be used for any image classification task and it has all the necessary tools to train a model from scratch and more. **(I will make a pytorch classification template soon)**## π¦ Release
> ### Newest release π
> #### [Go to newest release](https://github.com/Aydinhamedi/Pytorch-Garbage-Classification-V2/releases/latest)## π Dataset
The dataset used for this project is the [Garbage Classification](https://www.kaggle.com/datasets/asdasdasasdas/garbage-classification) from Kaggle. It contains images of garbage, divided into six categories.
### Data Structure
~~~
ββββDatabase
β ββββData # Put all the folders with images here
# Example β¬
β ββββbattery
β ββββbiological
β ββββbrown-glass
β ...
β ββββwhite-glass
~~~## π§ͺ Model
I used the **EfficientNet-B6** model for this project. **EfficientNet-B6** is a convolutional neural network that is pretrained on the ImageNet dataset. It is known for its efficiency and high performance on a variety of image classification tasks. [Original paper](https://arxiv.org/abs/1905.11946)
## π° Installation
To run the code in this repository, you will need to install the required libraries. You can do this by running the following command:
```bash
pip install -r requirements.txt
```> [!WARNING]
> The requirements are auto generated by `pipreqs` and may not contain all the necessary dependencies. like hidden ones like Tensorboard.## π Usage
The main code for this project is in a Jupyter notebook named `Main.ipynb`. To run the notebook, use the following command:
```bash
jupyter notebook Main.ipynb
```## π Results
| Metric | Value |
|----------------------------------|-----------|
| Loss | 0.0330466 |
| F1 Score (macro) | 0.95472 |
| Precision (macro) | 0.952111 |
| Recall (macro) | 0.957959 |
| AUROC | 0.993324 |
| Accuracy | 0.957839 |
| Cohen's Kappa | 0.948292 |
| Matthews Correlation Coefficient | 0.948374 |![alt text]()
![alt text]()## π License
Copyright (c) 2024 Aydin Hamedi
This software is released under the MIT License.
https://opensource.org/licenses/MIT