|
Download Garbage_Clf_CNN/Readme.md from EmanHussein/ResNet50_Garbage_Classifier: direct link, hf CLI and curl.
- Browser
- Download file 2.85 kB
-
https://huggingface.co/spaces/EmanHussein/ResNet50_Garbage_Classifier/resolve/main/Garbage_Clf_CNN/Readme.md
- Command line
-
hf download hf://spaces/EmanHussein/ResNet50_Garbage_Classifier/Garbage_Clf_CNN/Readme.md
-
curl -L -o Readme.md https://huggingface.co/spaces/EmanHussein/ResNet50_Garbage_Classifier/resolve/main/Garbage_Clf_CNN/Readme.md
2.85 kB
β»οΈ Waste Category Image Classifier (Streamlit + Keras)
An interactive web app for classifying waste images into 10 distinct categories using a custom-trained Convolutional Neural Network (CNN). Built with TensorFlow/Keras and deployed via Streamlit, this app demonstrates the power of deep learning in sustainability-oriented image classification.
π Demo
Upload an image and instantly get a class prediction with confidence and full class-wise probabilities.
π§ Model Summary
- Architecture: Custom CNN
- Input Shape: 224Γ224 RGB
- Layers:
- Convolutional layers with BatchNorm and ReLU
- MaxPooling
- Global Average Pooling
- Dense layers with Dropout
- Optimizer: Adam (
lr=1e-5) - Loss: Categorical Crossentropy
- Final Layer: Softmax (10 classes)
π Dataset
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 | 15,806 |
| Validation | 1,976 |
| Testing | 1,980 |
π§Ό Preprocessing
- All images resized to
224Γ224 - Normalized using:
rescale=1./255
ποΈ Model Architecture (Keras Sequential)
Input(shape=(224, 224, 3)) β
Conv2D(32) β BN β ReLU β
Conv2D(64) β BN β ReLU β MaxPool(4Γ4) β
Conv2D(128) β BN β ReLU β
Conv2D(128) β BN β ReLU β MaxPool(2Γ2) β
Conv2D(256) β BN β ReLU β MaxPool(2Γ2) β
Conv2D(512) β BN β ReLU β MaxPool(2Γ2) β
GlobalAveragePooling β
Dense(256) β Dropout(0.4) β
Dense(10, activation='softmax')
π₯οΈ 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
- Clone the repo
git clone https://github.com/Amr1Moussa/NTI-final_projects.git
cd NTI-final_projects
- (Optional) Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies
pip install -r requirements.txt
- Run the app
streamlit run app.py
π Requirements
See requirements.txt:
streamlit
tensorflow
numpy
pillow
pandas
matplotlib
π License
MIT License β use freely, contribute openly, credit kindly.