Deep learning waste classification application evaluating input images across dual EfficientNet neural networks with a 60% confidence threshold guardrail.
Single-model vision classifiers can suffer from high prediction variance on ambiguous images. Garbage Classifier addresses this by routing image streams through two parallel vision architectures:
- Model V2 (EfficientNetB4): Trained on 9 waste categories with a 380x380px input shape.
- Model V3 (EfficientNetB3): Trained on 8 waste categories with a 300x300px input shape.
A logical gate compares prediction probability distributions in real time, selecting the top prediction while enforcing a 60% confidence threshold to flag low-confidence inputs as "Unknown".
ext ┌─────────────────────────────────────────┐ │ Input Image / Camera │ └────────────────────┬────────────────────┘ │ ┌──────────────┴──────────────┐ ▼ ▼ ┌──────────────────────┐ ┌──────────────────────┐ │ Model V2 Preprocess │ │ Model V3 Preprocess │ │ (380 × 380) │ │ (300 × 300) │ └───────────┬──────────┘ └───────────┬──────────┘ ▼ ▼ ┌──────────────────────┐ ┌──────────────────────┐ │ EfficientNetB4 (9-cl)│ │ EfficientNetB3 (8-cl)│ └───────────┬──────────┘ └───────────┬──────────┘ │ │ └──────────────┬──────────────┘ ▼ ┌─────────────────────────────┐ │ Max-Confidence Comparator │ │ np.max(P1) vs np.max(P2) │ └──────────────┬──────────────┘ │ [Confidence >= 60%] / \ YES NO / \ ▼ ▼ Winning Waste Category Flagged as "Unknown State"
- Dual Model Inference: Runs parallel predictions through EfficientNetB4 and EfficientNetB3 networks.
- Confidence Threshold Gate: Flags predictions below 60% confidence to prevent confident misclassifications.
- Dynamic Resizing: Preprocesses inputs into RGB tensors matching each model's native resolution.
- Streamlit Web Dashboard: Interactive UI displaying individual model predictions, confidence scores, and probability distribution charts.
| Pipeline Component | Model V2 Specs | Model V3 Specs |
|---|---|---|
| Base Architecture | EfficientNetB4 | EfficientNetB3 |
| Input Shape | 380 × 380 × 3 RGB | 300 × 300 × 3 RGB |
| Classes Evaluated | 9 Classes | 8 Classes |
| Ensemble Logic | Max-Confidence Comparison Gate | Max-Confidence Comparison Gate |
| Safety Threshold | 60.0% Minimum Peak Probability | 60.0% Minimum Peak Probability |
- Language: Python 3.10
- Deep Learning: TensorFlow / Keras
- Image Processing: Pillow (PIL), NumPy
- Dashboard: Streamlit
`�ash
git clone https://github.com/wajahat2005/garbage-classifier.git cd garbage-classifier
pip install -r requirements.txt
streamlit run app.py `
Distributed under the MIT License.