# chinmoydeb/mobilenetv2-plant-disease-detection architecture

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

- Interactive diagram: https://gitdiagram.com/chinmoydeb/mobilenetv2-plant-disease-detection
- Repository: https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection

## Overview

This repository presents a PlantDoc plant-disease classifier built by adapting a pretrained MobileNetV2 model. The documented workflow uses PlantVillage pretraining, then trains a custom head with the backbone frozen before progressively fine-tuning deeper blocks on PlantDoc, followed by evaluation. The README also describes experiment tracking and an inference example. The notebook is the only listed implementation source, but its contents were not sampled, so internal call relationships cannot be verified; edges below reflect README-documented workflow and capabilities.

Main entry points: [`plantdoc_transfer_learning.ipynb`](https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb) (Frozen-head training), [`plantdoc_mobilenetv2.pth`](https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_mobilenetv2.pth) (Saved model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data and Adaptation"]
  node_plantvillage[("PlantVillage data")]
  node_plantdoc[("PlantDoc data")]
end

subgraph group_model["Model Training"]
  node_pretrained["Pretrained MobileNetV2"]
  node_phase1["Frozen-head training"]
  node_phase2["Progressive fine-tuning"]
  node_classifier["Classification head"]
  node_checkpoint["Saved model"]
end

subgraph group_use["Evaluation and Use"]
  node_evaluation["PlantDoc evaluation"]
  node_tracking["Experiment tracking"]
  node_processor["Image preprocessing"]
  node_inference["Disease prediction"]
end

node_developer(("Training user"))
node_wandb["Weights &amp; Biases"]
node_imageuser(("Image user"))

node_plantvillage -->|"pretrains"| node_pretrained
node_pretrained -->|"initializes"| node_phase1
node_phase1 -->|"trains head"| node_classifier
node_phase1 -->|"continues as"| node_phase2
node_plantdoc -->|"trains on"| node_phase1
node_plantdoc -->|"fine-tunes on"| node_phase2
node_phase2 -.->|"saves"| node_checkpoint
node_phase2 -->|"evaluates"| node_evaluation
node_developer -->|"runs training"| node_phase1
node_developer -->|"tracks runs"| node_tracking
node_tracking -->|"logs metrics"| node_wandb
node_imageuser -->|"provides image"| node_processor
node_processor -->|"prepares input"| node_inference
node_checkpoint -.->|"loads model"| node_inference
node_inference -->|"returns prediction"| node_imageuser

click node_phase1 "https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb"
click node_phase2 "https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb"
click node_classifier "https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb"
click node_checkpoint "https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_mobilenetv2.pth"
click node_evaluation "https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb"
click node_tracking "https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb"
click node_processor "https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb"
click node_inference "https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb"

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_plantvillage,node_plantdoc,node_developer,node_imageuser toneBlue
class node_pretrained,node_phase1,node_phase2,node_classifier,node_checkpoint toneAmber
class node_evaluation,node_tracking,node_processor,node_inference toneMint
class node_wandb toneIndigo
```

## Components

### Data and Adaptation

- **PlantVillage data**
- **PlantDoc data**

### Model Training

- **Pretrained MobileNetV2**
- [Frozen-head training](https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb): `plantdoc_transfer_learning.ipynb`
- [Progressive fine-tuning](https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb): `plantdoc_transfer_learning.ipynb`
- [Classification head](https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb): `plantdoc_transfer_learning.ipynb`
- [Saved model](https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_mobilenetv2.pth): `plantdoc_mobilenetv2.pth`

### Evaluation and Use

- [PlantDoc evaluation](https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb): `plantdoc_transfer_learning.ipynb`
- [Experiment tracking](https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb): `plantdoc_transfer_learning.ipynb`
- [Image preprocessing](https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb): `plantdoc_transfer_learning.ipynb`
- [Disease prediction](https://github.com/chinmoydeb/mobilenetv2-plant-disease-detection/blob/main/plantdoc_transfer_learning.ipynb): `plantdoc_transfer_learning.ipynb`

### Other components

- **Training user**
- **Weights & Biases**
- **Image user**

## Connections

- PlantVillage data → Pretrained MobileNetV2: pretrains (evidence: `README.md`)
- Pretrained MobileNetV2 → Frozen-head training: initializes (evidence: `README.md`)
- Frozen-head training → Classification head: trains head (evidence: `README.md`)
- Frozen-head training → Progressive fine-tuning: continues as (evidence: `README.md`)
- PlantDoc data → Frozen-head training: trains on (evidence: `README.md`)
- PlantDoc data → Progressive fine-tuning: fine-tunes on (evidence: `README.md`)
- Progressive fine-tuning → Saved model: saves
- Progressive fine-tuning → PlantDoc evaluation: evaluates (evidence: `README.md`)
- Training user → Frozen-head training: runs training (evidence: `README.md`)
- Training user → Experiment tracking: tracks runs (evidence: `README.md`)
- Experiment tracking → Weights & Biases: logs metrics (evidence: `README.md`)
- Image user → Image preprocessing: provides image (evidence: `README.md`)
- Image preprocessing → Disease prediction: prepares input (evidence: `README.md`)
- Saved model → Disease prediction: loads model
- Disease prediction → Image user: returns prediction (evidence: `README.md`)
