How haroon423/plantdiseaseai works
Project Type and Purpose
• This is a machine‑learning–powered plant‐disease detection tool with both training and real‑time inference capabilities.
• Key use cases:
• Training/fine‑tuning a pretrained CNN on leaf images via notebooks.
• Serving predictions via a lightweight web app (Flask or Streamlit).
File Structure
Top‑level items:
• PlantDiseaseAI-kggle-Datasets-links (dataset pointers)
• PlantDiseaseAI_FYP.ipynb & plantdiseaseai-fyp.ipynb (training/exploration notebooks)
• plantdiseaseai_fyp.py (training or reusable module)
• app.py (web‑service entry point)
• README.md (project overview)
No separate frontend folder—UI is embedded in the Flask/Streamlit app.
README for Insights
• Frameworks: TensorFlow or PyTorch for model, Flask or Streamlit for UI.
• Features: transfer learning, real‑time prediction, easy deployment.
Main Components and Their Interactions
a. Data Ingestion & Preprocessing
• Source: “PlantDiseaseAI-kggle–Datasets-links” → local dataset or cloud bucket.
• Processed in notebooks and plantdiseaseai_fyp.py.
b. Model Training & Storage
• Jupyter notebooks load pretrained CNN (e.g., ResNet, MobileNet).
• Fine‑tune on plant leaf dataset.
• Serialize final model (e.g., .h5 or .pth) to disk or model registry.
c. Inference API / Web App
• app.py launches a Flask/Streamlit server.
• Loads the trained model into memory.
• Exposes a REST endpoint (Flask) or interactive UI (Streamlit) for image upload.
d. Client Interaction
• User uploads leaf image via web UI.
• Image sent to server → preprocessing → model.predict → result displayed.
e. (Optional) Deployment Infrastructure
• Docker container or cloud VM hosting the app.
• GPU instance can be used during training; CPU at inference.
Architectural Patterns & Technologies
• Pattern: Separate “Training Pipeline” vs. “Serving Pipeline.”
• Transfer Learning: uses pretrained CNN + custom head.
• Single‑process web server for inference (no microservices).
• Reproducible notebooks for experimentation.
Final Checklist
• Clear, concise labels for every node.
• Call out where real‑time prediction happens vs. offline training.