# loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso architecture

> Architecture diagram of the GitHub repository loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso
- Repository: https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso

## Overview

This repository is primarily a Karnataka crop-yield prediction research pipeline, with a minimal, empty React shell. The main workflow prepares the crop dataset, trains and compares CNN-BiGRU variants, and tunes hyperparameters using single- and multi-objective particle swarm optimization. Preprocessing artifacts and experiment outputs are persisted for evaluation and report figures. The Python pipeline appears in both the root `src/` tree and `crop_yield_project/src/`; both are represented. The React app has no demonstrated product behavior. Relationships reflect the excerpts and source index; unsampled details are not inferred.

Main entry points: [`src/train.py`](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/src/train.py) (Experiment orchestration), [`crop_yield_project/src/train.py`](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/crop_yield_project/src/train.py) (Project experiments), [`src/preprocess.py`](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/src/preprocess.py) (Data preprocessing), [`crop_yield_project/src/preprocess.py`](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/crop_yield_project/src/preprocess.py) (Project preprocessing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_crop_csv["Karnataka crop data"]
  node_preprocess["Data preprocessing<br/>[preprocess.py]"]
  node_root_results["Root results artifacts"]
end

subgraph group_modeling["Modeling and tuning"]
  node_model["CNN-BiGRU model<br/>[model_cnn_bigru.py]"]
  node_optimizer["PSO and NSPSO<br/>[pso_nspso.py]"]
end

subgraph group_experiments["Experiment workflow"]
  node_train["Experiment orchestration<br/>[train.py]"]
end

subgraph group_analysis["Evaluation and reporting"]
  node_evaluate["Evaluation figures<br/>[evaluate.py]"]
end

subgraph group_duplicate["Project copy"]
  node_project_csv["Project crop data"]
  node_project_preprocess["Project preprocessing<br/>[preprocess.py]"]
  node_project_results["Project results artifacts"]
  node_project_model["Project CNN-BiGRU<br/>[model_cnn_bigru.py]"]
  node_project_optimizer["Project PSO and NSPSO<br/>[pso_nspso.py]"]
  node_project_train["Project experiments<br/>[train.py]"]
  node_project_evaluate["Project figures<br/>[evaluate.py]"]
end

node_researcher(("Researcher"))

node_researcher -.->|"runs experiments"| node_train
node_crop_csv -->|"loads data"| node_preprocess
node_preprocess -->|"writes encoders and scaler"| node_root_results
node_train -->|"uses preparation"| node_preprocess
node_train -->|"trains variants"| node_model
node_train -->|"obtains tuned parameters"| node_optimizer
node_optimizer -->|"evaluates candidates"| node_model
node_optimizer -->|"uses cross-validation splits"| node_preprocess
node_train -->|"saves predictions"| node_root_results
node_evaluate -->|"reads prediction and metric files"| node_root_results
node_project_csv -->|"loads data"| node_project_preprocess
node_project_preprocess -->|"writes encoders and scaler"| node_project_results
node_project_train -->|"uses preparation"| node_project_preprocess
node_project_train -->|"trains variants"| node_project_model
node_project_train -->|"obtains tuned parameters"| node_project_optimizer
node_project_optimizer -->|"evaluates candidates"| node_project_model
node_project_optimizer -->|"uses cross-validation splits"| node_project_preprocess
node_project_train -->|"saves predictions"| node_project_results
node_project_evaluate -->|"reads prediction and metric files"| node_project_results

click node_crop_csv "https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/data/karnataka_multi_crop_master.csv"
click node_preprocess "https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/src/preprocess.py"
click node_root_results "https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/tree/main/results"
click node_model "https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/src/model_cnn_bigru.py"
click node_optimizer "https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/src/pso_nspso.py"
click node_train "https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/src/train.py"
click node_evaluate "https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/src/evaluate.py"
click node_project_csv "https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/crop_yield_project/data/karnataka_multi_crop_master.csv"
click node_project_preprocess "https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/crop_yield_project/src/preprocess.py"
click node_project_results "https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/tree/main/crop_yield_project/results"
click node_project_model "https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/crop_yield_project/src/model_cnn_bigru.py"
click node_project_optimizer "https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/crop_yield_project/src/pso_nspso.py"
click node_project_train "https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/crop_yield_project/src/train.py"
click node_project_evaluate "https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/crop_yield_project/src/evaluate.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_crop_csv,node_preprocess,node_root_results toneBlue
class node_model,node_optimizer toneAmber
class node_train toneMint
class node_evaluate toneRose
class node_project_csv,node_project_preprocess,node_project_results,node_project_model,node_project_optimizer,node_project_train,node_project_evaluate,node_researcher toneIndigo
```

## Components

### Data preparation

- [Karnataka crop data](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/data/karnataka_multi_crop_master.csv): `data/karnataka_multi_crop_master.csv`
- [Data preprocessing](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/src/preprocess.py): `src/preprocess.py`
- [Root results artifacts](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/tree/main/results): `results`

### Modeling and tuning

- [CNN-BiGRU model](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/src/model_cnn_bigru.py): `src/model_cnn_bigru.py`
- [PSO and NSPSO](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/src/pso_nspso.py): `src/pso_nspso.py`

### Experiment workflow

- [Experiment orchestration](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/src/train.py): `src/train.py`

### Evaluation and reporting

- [Evaluation figures](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/src/evaluate.py): `src/evaluate.py`

### Project copy

- [Project crop data](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/crop_yield_project/data/karnataka_multi_crop_master.csv): `crop_yield_project/data/karnataka_multi_crop_master.csv`
- [Project preprocessing](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/crop_yield_project/src/preprocess.py): `crop_yield_project/src/preprocess.py`
- [Project results artifacts](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/tree/main/crop_yield_project/results): `crop_yield_project/results`
- [Project CNN-BiGRU](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/crop_yield_project/src/model_cnn_bigru.py): `crop_yield_project/src/model_cnn_bigru.py`
- [Project PSO and NSPSO](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/crop_yield_project/src/pso_nspso.py): `crop_yield_project/src/pso_nspso.py`
- [Project experiments](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/crop_yield_project/src/train.py): `crop_yield_project/src/train.py`
- [Project figures](https://github.com/loukya2006/crop-_yield_prediction-with-cnn-bigru-and-pso-nspso/blob/main/crop_yield_project/src/evaluate.py): `crop_yield_project/src/evaluate.py`

### Other components

- **Researcher**

## Connections

- Researcher → Experiment orchestration: runs experiments
- Karnataka crop data → Data preprocessing: loads data (evidence: `src/preprocess.py`)
- Data preprocessing → Root results artifacts: writes encoders and scaler (evidence: `src/preprocess.py`)
- Experiment orchestration → Data preprocessing: uses preparation (evidence: `src/train.py`)
- Experiment orchestration → CNN-BiGRU model: trains variants (evidence: `src/train.py`)
- Experiment orchestration → PSO and NSPSO: obtains tuned parameters (evidence: `src/train.py`)
- PSO and NSPSO → CNN-BiGRU model: evaluates candidates (evidence: `src/pso_nspso.py`)
- PSO and NSPSO → Data preprocessing: uses cross-validation splits (evidence: `src/pso_nspso.py`)
- Experiment orchestration → Root results artifacts: saves predictions (evidence: `src/train.py`)
- Evaluation figures → Root results artifacts: reads prediction and metric files (evidence: `src/evaluate.py`)
- Project crop data → Project preprocessing: loads data (evidence: `crop_yield_project/src/preprocess.py`)
- Project preprocessing → Project results artifacts: writes encoders and scaler (evidence: `crop_yield_project/src/preprocess.py`)
- Project experiments → Project preprocessing: uses preparation (evidence: `crop_yield_project/src/train.py`)
- Project experiments → Project CNN-BiGRU: trains variants (evidence: `crop_yield_project/src/train.py`)
- Project experiments → Project PSO and NSPSO: obtains tuned parameters (evidence: `crop_yield_project/src/train.py`)
- Project PSO and NSPSO → Project CNN-BiGRU: evaluates candidates (evidence: `crop_yield_project/src/pso_nspso.py`)
- Project PSO and NSPSO → Project preprocessing: uses cross-validation splits (evidence: `crop_yield_project/src/pso_nspso.py`)
- Project experiments → Project results artifacts: saves predictions (evidence: `crop_yield_project/src/train.py`)
- Project figures → Project results artifacts: reads prediction and metric files (evidence: `crop_yield_project/src/evaluate.py`)
