# dhotre12/agritech architecture

> Architecture diagram of the GitHub repository dhotre12/agritech, 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/dhotre12/agritech
- Repository: https://github.com/dhotre12/agritech

## Overview

AgriTech is a Streamlit crop-recommendation application with global and Tamil Nadu-specific prediction modes, model information pages, and explainability features. The excerpts show the Tamil Nadu page loading resources and invoking SHAP/LIME analysis; they also identify prediction, research, algorithm, and deployment pages. Most implementation is concentrated in merged.py. Because the README is only a title and source excerpts are partial, several page relationships and artifact-loading details cannot be verified.

Main entry points: [`merged.py`](https://github.com/dhotre12/agritech/blob/main/merged.py) (Regional resources), [`encoders.pkl`](https://github.com/dhotre12/agritech/blob/main/encoders.pkl) (Regional model artifacts), [`MS_SE_BiLSTM_model.pth`](https://github.com/dhotre12/agritech/blob/main/MS_SE_BiLSTM_model.pth) (Regional model files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Application interface"]
  node_app["Streamlit application<br/>[merged.py]"]
  node_deployment["Deployment guidance<br/>[merged.py]"]
end

subgraph group_prediction["Crop prediction"]
  node_global["Global prediction<br/>[merged.py]"]
  node_regional["Tamil Nadu mode<br/>[merged.py]"]
  node_tn_resources["Regional resources<br/>[merged.py]"]
  node_regional_artifacts["Regional model artifacts<br/>[encoders.pkl]"]
  node_regional_models["Regional model files"]
end

subgraph group_insights["Model insights"]
  node_xai["SHAP and LIME<br/>[merged.py]"]
  node_research["Research details<br/>[merged.py]"]
  node_algorithm["Algorithm details<br/>[merged.py]"]
end

node_user(("User"))

node_regional -->|"loads resources"| node_tn_resources
node_regional -->|"invokes explanations"| node_xai
node_tn_resources -->|"requires encoders"| node_regional_artifacts
node_tn_resources -->|"requires models"| node_regional_models

click node_app "https://github.com/dhotre12/agritech/blob/main/merged.py"
click node_global "https://github.com/dhotre12/agritech/blob/main/merged.py"
click node_regional "https://github.com/dhotre12/agritech/blob/main/merged.py"
click node_tn_resources "https://github.com/dhotre12/agritech/blob/main/merged.py"
click node_regional_artifacts "https://github.com/dhotre12/agritech/blob/main/encoders.pkl"
click node_regional_models "https://github.com/dhotre12/agritech/blob/main/MS_SE_BiLSTM_model.pth"
click node_xai "https://github.com/dhotre12/agritech/blob/main/merged.py"
click node_research "https://github.com/dhotre12/agritech/blob/main/merged.py"
click node_algorithm "https://github.com/dhotre12/agritech/blob/main/merged.py"
click node_deployment "https://github.com/dhotre12/agritech/blob/main/merged.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_app,node_deployment,node_user toneBlue
class node_global,node_regional,node_tn_resources,node_regional_artifacts,node_regional_models toneAmber
class node_xai,node_research,node_algorithm toneMint
```

## Components

### Application interface

- [Streamlit application](https://github.com/dhotre12/agritech/blob/main/merged.py): `merged.py`
- [Deployment guidance](https://github.com/dhotre12/agritech/blob/main/merged.py): `merged.py`

### Crop prediction

- [Global prediction](https://github.com/dhotre12/agritech/blob/main/merged.py): `merged.py`
- [Tamil Nadu mode](https://github.com/dhotre12/agritech/blob/main/merged.py): `merged.py`
- [Regional resources](https://github.com/dhotre12/agritech/blob/main/merged.py): `merged.py`
- [Regional model artifacts](https://github.com/dhotre12/agritech/blob/main/encoders.pkl): `encoders.pkl`
- [Regional model files](https://github.com/dhotre12/agritech/blob/main/MS_SE_BiLSTM_model.pth): `MS_SE_BiLSTM_model.pth`

### Model insights

- [SHAP and LIME](https://github.com/dhotre12/agritech/blob/main/merged.py): `merged.py`
- [Research details](https://github.com/dhotre12/agritech/blob/main/merged.py): `merged.py`
- [Algorithm details](https://github.com/dhotre12/agritech/blob/main/merged.py): `merged.py`

### Other components

- **User**

## Connections

- Tamil Nadu mode → Regional resources: loads resources (evidence: `merged.py`)
- Tamil Nadu mode → SHAP and LIME: invokes explanations (evidence: `merged.py`)
- Regional resources → Regional model artifacts: requires encoders (evidence: `merged.py`)
- Regional resources → Regional model files: requires models (evidence: `merged.py`)
