# vignesh12398/ecoinsight architecture

> Architecture diagram of the GitHub repository vignesh12398/ecoinsight, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vignesh12398/ecoinsight
- Repository: https://github.com/vignesh12398/ecoinsight

## Overview

CarbonAI is a Streamlit sustainability app with two user-facing workflows: estimating monthly carbon emissions from lifestyle inputs and classifying uploaded waste images. Users can submit classification feedback, which is reviewable in an admin dashboard. A separate documented training workflow prepares carbon-emission data and trains the regression model. The graph preserves these stages and model artifacts; implementation details for unsampled app sections and the waste-classifier training notebook are based on README descriptions, not inspected source.

Main entry points: [`app.py`](https://github.com/vignesh12398/ecoinsight/blob/main/app.py) (Streamlit app), [`feature_engineering.py`](https://github.com/vignesh12398/ecoinsight/blob/main/feature_engineering.py) (Feature encoding), [`model/carbon_model.pkl`](https://github.com/vignesh12398/ecoinsight/blob/main/model/carbon_model.pkl) (Emission model), [`model/encoders.pkl`](https://github.com/vignesh12398/ecoinsight/blob/main/model/encoders.pkl) (Feature encoders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_streamlit["Streamlit app<br/>[app.py]"]
  node_calculator["Footprint calculator<br/>[app.py]"]
  node_feedback["Feedback capture<br/>[app.py]"]
  node_admin["Feedback dashboard<br/>[app.py]"]
  node_feedbacklog[("Feedback log")]
end

subgraph group_prediction["Carbon prediction"]
  node_carbonmodel["Emission model<br/>[carbon_model.pkl]"]
  node_encoders["Feature encoders<br/>[encoders.pkl]"]
end

subgraph group_waste["Waste classification"]
  node_wasteclassifier["Waste classifier"]
end

subgraph group_training["Carbon model training"]
  node_rawdata[("Raw emissions data")]
  node_preprocessing["Data cleaning<br/>[preprocessing.py]"]
  node_cleaneddata[("Cleaned dataset<br/>[CleanedDataset.csv]")]
  node_engineering["Feature encoding"]
  node_processeddata[("Encoded dataset")]
  node_trainingmodel["Model training<br/>[train_model.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_streamlit
node_streamlit -->|"offers"| node_calculator
node_streamlit -->|"loads model"| node_wasteclassifier
node_streamlit -->|"loads model"| node_carbonmodel
node_streamlit -->|"loads encoders"| node_encoders
node_calculator -->|"predicts with"| node_carbonmodel
node_calculator -->|"encodes inputs"| node_encoders
node_user -->|"uploads image"| node_streamlit
node_streamlit -->|"classifies image"| node_wasteclassifier
node_user -->|"rates prediction"| node_feedback
node_feedback -->|"writes"| node_feedbacklog
node_admin -->|"reviews"| node_feedbacklog
node_rawdata -->|"read by"| node_preprocessing
node_preprocessing -->|"writes"| node_cleaneddata
node_cleaneddata -->|"read by"| node_engineering
node_engineering -->|"writes"| node_processeddata
node_processeddata -->|"read by"| node_trainingmodel
node_trainingmodel -->|"saves model"| node_carbonmodel
node_engineering -->|"saves encoders"| node_encoders

click node_streamlit "https://github.com/vignesh12398/ecoinsight/blob/main/app.py"
click node_calculator "https://github.com/vignesh12398/ecoinsight/blob/main/app.py"
click node_feedback "https://github.com/vignesh12398/ecoinsight/blob/main/app.py"
click node_admin "https://github.com/vignesh12398/ecoinsight/blob/main/app.py"
click node_carbonmodel "https://github.com/vignesh12398/ecoinsight/blob/main/model/carbon_model.pkl"
click node_encoders "https://github.com/vignesh12398/ecoinsight/blob/main/model/encoders.pkl"
click node_wasteclassifier "https://github.com/vignesh12398/ecoinsight/blob/main/model/mobilenet_finetuned_best.keras"
click node_rawdata "https://github.com/vignesh12398/ecoinsight/blob/main/data/Carbon%20Emission.csv"
click node_preprocessing "https://github.com/vignesh12398/ecoinsight/blob/main/preprocessing.py"
click node_cleaneddata "https://github.com/vignesh12398/ecoinsight/blob/main/data/CleanedDataset.csv"
click node_engineering "https://github.com/vignesh12398/ecoinsight/blob/main/feature_engineering.py"
click node_processeddata "https://github.com/vignesh12398/ecoinsight/blob/main/data/ProcessedDataset.csv"
click node_trainingmodel "https://github.com/vignesh12398/ecoinsight/blob/main/train_model.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_streamlit,node_calculator,node_feedback,node_admin,node_feedbacklog,node_user toneBlue
class node_carbonmodel,node_encoders toneAmber
class node_wasteclassifier toneMint
class node_rawdata,node_preprocessing,node_cleaneddata,node_engineering,node_processeddata,node_trainingmodel toneRose
```

## Components

### User experience

- [Streamlit app](https://github.com/vignesh12398/ecoinsight/blob/main/app.py): `app.py`
- [Footprint calculator](https://github.com/vignesh12398/ecoinsight/blob/main/app.py): `app.py`
- [Feedback capture](https://github.com/vignesh12398/ecoinsight/blob/main/app.py): `app.py`
- [Feedback dashboard](https://github.com/vignesh12398/ecoinsight/blob/main/app.py): `app.py`
- **Feedback log**

### Carbon prediction

- [Emission model](https://github.com/vignesh12398/ecoinsight/blob/main/model/carbon_model.pkl): `model/carbon_model.pkl`
- [Feature encoders](https://github.com/vignesh12398/ecoinsight/blob/main/model/encoders.pkl): `model/encoders.pkl`

### Waste classification

- [Waste classifier](https://github.com/vignesh12398/ecoinsight/blob/main/model/mobilenet_finetuned_best.keras): `model/mobilenet_finetuned_best.keras`

### Carbon model training

- [Raw emissions data](https://github.com/vignesh12398/ecoinsight/blob/main/data/Carbon%20Emission.csv): `data/Carbon Emission.csv`
- [Data cleaning](https://github.com/vignesh12398/ecoinsight/blob/main/preprocessing.py): `preprocessing.py`
- [Cleaned dataset](https://github.com/vignesh12398/ecoinsight/blob/main/data/CleanedDataset.csv): `data/CleanedDataset.csv`
- [Feature encoding](https://github.com/vignesh12398/ecoinsight/blob/main/feature_engineering.py): `feature_engineering.py`
- [Encoded dataset](https://github.com/vignesh12398/ecoinsight/blob/main/data/ProcessedDataset.csv): `data/ProcessedDataset.csv`
- [Model training](https://github.com/vignesh12398/ecoinsight/blob/main/train_model.py): `train_model.py`

### Other components

- **User**

## Connections

- User → Streamlit app: uses (evidence: `README.md`)
- Streamlit app → Footprint calculator: offers (evidence: `README.md`)
- Streamlit app → Waste classifier: loads model (evidence: `app.py`)
- Streamlit app → Emission model: loads model (evidence: `app.py`)
- Streamlit app → Feature encoders: loads encoders (evidence: `app.py`)
- Footprint calculator → Emission model: predicts with (evidence: `README.md`)
- Footprint calculator → Feature encoders: encodes inputs (evidence: `README.md`)
- User → Streamlit app: uploads image (evidence: `README.md`)
- Streamlit app → Waste classifier: classifies image (evidence: `README.md`)
- User → Feedback capture: rates prediction (evidence: `README.md`)
- Feedback capture → Feedback log: writes (evidence: `app.py`)
- Feedback dashboard → Feedback log: reviews (evidence: `README.md`)
- Raw emissions data → Data cleaning: read by (evidence: `preprocessing.py`)
- Data cleaning → Cleaned dataset: writes (evidence: `preprocessing.py`)
- Cleaned dataset → Feature encoding: read by (evidence: `feature_engineering.py`)
- Feature encoding → Encoded dataset: writes (evidence: `feature_engineering.py`)
- Encoded dataset → Model training: read by (evidence: `train_model.py`)
- Model training → Emission model: saves model (evidence: `README.md`)
- Feature encoding → Feature encoders: saves encoders (evidence: `feature_engineering.py`)
