# qubitpro/recyclewaste architecture

> Architecture diagram of the GitHub repository qubitpro/recyclewaste, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/qubitpro/recyclewaste
- Repository: https://github.com/qubitpro/recyclewaste

## Overview

##### Project type and purpose
- This is an ML-powered image classification system for household waste, built with transfer learning (TensorFlow/Keras backbones) and exposed via a Gradio web application deployed on Hugging Face Spaces.
- Core use case: train and benchmark CNNs on a local dataset, then serve the best model for real-time inference through a browser interface.

##### File structure
- Dataset/ (six class folders: cardboard, glass, metal, paper, plastic, trash)
- Week 1/ and Week 2/ (exploratory/training notebooks)
- Final Notebook.ipynb (consolidated data prep, training, evaluation)
- app.py (Gradio inference script)
- requirements.txt (dependencies)
- README.md (project description, live demo link, results summary)

##### README for additional insights
- Multiple CNN backbones benchmarked (EfficientNet variants, MobileNetV2, ResNet50)
- Transfer learning with ImageNet weights
- Class-weighting for imbalanced data
- Visualization of metrics (training curves, confusion matrix)
- Deployed serverless on Hugging Face Spaces via Gradio

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Layer
    subgraph "Data Layer"
        direction TB
        Dataset["Dataset/"]:::data
        Cardboard["cardboard"]:::data
        Glass["glass"]:::data
        Metal["metal"]:::data
        Paper["paper"]:::data
        Plastic["plastic"]:::data
        Trash["trash"]:::data
    end

    %% Training Layer
    subgraph "Training Layer"
        direction TB
        Week1["Week1.ipynb"]:::training
        Week2["Week2.ipynb"]:::training
        FinalNotebook["Final Notebook.ipynb"]:::training
    end

    %% Model Artifacts
    subgraph "Model Artifacts"
        direction TB
        SavedModel[(Saved Model Files)]:::artifact
    end

    %% Inference Layer
    subgraph "Inference Layer"
        direction TB
        App["app.py"]:::inference
        Requirements["requirements.txt"]:::inference
        Readme["README.md"]:::inference
    end

    %% Deployment
    subgraph "Deployment / Hosting"
        direction TB
        HFSpaces["Hugging Face Spaces"]:::deployment
    end

    %% End User
    User["End-User (Browser)"]:::user

    %% Connections
    Dataset --> Cardboard
    Dataset --> Glass
    Dataset --> Metal
    Dataset --> Paper
    Dataset --> Plastic
    Dataset --> Trash
    Dataset --> Week1
    Dataset --> Week2
    Week1 --> FinalNotebook
    Week2 --> FinalNotebook
    FinalNotebook --> SavedModel
    SavedModel --> App
    App --> HFSpaces
    HFSpaces --> User

    %% Click Events
    click Dataset "https://github.com/qubitpro/recyclewaste/tree/main/Dataset/"
    click Cardboard "https://github.com/qubitpro/recyclewaste/tree/main/Dataset/cardboard"
    click Glass "https://github.com/qubitpro/recyclewaste/tree/main/Dataset/glass"
    click Metal "https://github.com/qubitpro/recyclewaste/tree/main/Dataset/metal"
    click Paper "https://github.com/qubitpro/recyclewaste/tree/main/Dataset/paper"
    click Plastic "https://github.com/qubitpro/recyclewaste/tree/main/Dataset/plastic"
    click Trash "https://github.com/qubitpro/recyclewaste/tree/main/Dataset/trash"
    click Week1 "https://github.com/qubitpro/recyclewaste/blob/main/Week 1/Week1.ipynb"
    click Week2 "https://github.com/qubitpro/recyclewaste/blob/main/Week 2/Week2.ipynb"
    click FinalNotebook "https://github.com/qubitpro/recyclewaste/blob/main/Final Notebook.ipynb"
    click App "https://github.com/qubitpro/recyclewaste/blob/main/app.py"
    click Requirements "https://github.com/qubitpro/recyclewaste/blob/main/requirements.txt"
    click Readme "https://github.com/qubitpro/recyclewaste/blob/main/README.md"

    %% Styles
    classDef data fill:#ADD8E6,stroke:#333,stroke-width:1px;
    classDef training fill:#90EE90,stroke:#333,stroke-width:1px;
    classDef artifact fill:#F0E68C,stroke:#333,stroke-width:1px;
    classDef inference fill:#87CEFA,stroke:#333,stroke-width:1px;
    classDef deployment fill:#DDA0DD,stroke:#333,stroke-width:1px;
    classDef user fill:#FFFFE0,stroke:#333,stroke-width:1px;
```
