Commit Β·
1334d72
1
Parent(s): 4d42d1c
..
Browse files1234567891011121314151617181920212223242526272829303132331353637383940414243234567891011121314464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131151613317181351920# Garbage Classification Using ResNet50
This project implements an image classification model using **Transfer Learning with ResNet50** to categorize images of garbage into multiple classes. The model is trained on the ["Garbage Classification V2"](https://www.kaggle.com/datasets/sumn2u/garbage-classification-v2) dataset and built with TensorFlow and Keras.
---
## π Demo
Upload an image and instantly get a class prediction with confidence and full class-wise probabilities.

## π Dataset
* **Source**: [Kaggle - Garbage Classification V2](https://www.kaggle.com/datasets/sumn2u/garbage-classification-v2)* **Classes**: Mixed garbage categories such as cardboard, glass, metal, paper, plastic, trash, etc.* **Format**: Folder-based classification (i.e., one subfolder per class)
The dataset consists of images from 10 waste-related categories:
| Class | Count ||---------------|-------|| battery | 944 || biological | 997 || cardboard | 1825 || clothes | 5327 || glass | 3061 || metal | 1020 || paper | 1680 || plastic | 1984 || shoes | 1977 || trash | 947 |
---
### π Data Split
| Split | Images ||-----------|--------|| Training | 13,833 || Validation| 3,952 || Testing | 1,976 |
title: ResNet50 Garbage Classifieremoji: πcolorFrom: redcolorTo: redsdk: dockerapp_port: 8501tags:- streamlitpinned: falseshort_description: Streamlit template spacelicense: mit---
### π§Ό Preprocessing
- ```tensorflow.keras.applications.resnet50.preprocess_input```
---
## π§ Model Architecture```Input Image (224x224x3) βResNet50 Base (Frozen) βGlobalAveragePooling2D() βDense(256, activation='relu') βDropout(0.5) βDense(num_classes, activation='softmax')```---
## π§ͺ Training Configuration
* **Image Size**: 224x224* **Batch Size**: 32* **Epochs**: Customizable (default usually 10β25)* **Optimizer**: Adam* **Loss Function**: Categorical Crossentropy* **Metrics**: Accuracy
---
## π₯οΈ Web App Features
* β
Upload image and classify in real-time* π Display confidence score* π Class probabilities table/bar chart* π§ Show model architecture summary in sidebar
---
## π¦ Installation & Run Locally
1. **Clone the repo**
```bashgit clone https://github.com/Amr1Moussa/NTI-final_projects.gitcd NTI-final_projects```
2. **(Optional)** Create a virtual environment
```bashpython -m venv venvsource venv/bin/activate # On Windows: venv\Scripts\activate```
3. **Install dependencies**
```bashpip install -r requirements.txt```
4. **Run the app**
```bashstreamlit run app.py```
---
## π Requirements
See `requirements.txt`:
```txtstreamlittensorflownumpypillowpandasmatplotlib```
---# Welcome to Streamlit!
## π LicenseEdit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:
MIT License β use freely, contribute openly, credit kindly.If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [communityforums](https://discuss.streamlit.io).README.md+15-130