PlantGuard AI

About MyAgriScan

MyAgriScan helps farmers quickly identify plant diseases from a single photo and provides short, practical treatment and prevention advice generated by an expert AI. The site combines a lightweight image classifier running in a FastAPI backend with a server-side generative model that produces farmer-friendly recommendations.

How it solves the problem

How it works (technical overview)

  1. The frontend uploads the image to a Next.js API route which proxies the file to a FastAPI classifier.
  2. FastAPI runs a PyTorch model (ResNet9) on the image and returns the top prediction and confidence.
  3. The frontend calls a separate Next.js server route which asks a generative model (server-side) for short structured advice about the predicted disease.
  4. The frontend displays both the classification and the parsed advice (prevention, treatment, tips). If the generative step fails, the UI still shows the classification and a friendly message.

Step-by-step: How farmers can use this site

  1. Take a clear photo of the affected leaf (good lighting, close-up of spots or symptoms).
  2. Open the Diagnose page and upload the photo using the "Analyze" button.
  3. Wait for the classification to finish — you'll see the predicted disease name and confidence score.
  4. The site will then fetch short prevention and treatment tips; read these and follow the simple steps recommended.
  5. If you're unsure or the confidence is low, save the image to your history and consult a local extension officer with the saved report.

Privacy & Safety

Uploaded photos are not published publicly. The generative AI key is stored server-side and is never exposed to the browser. For production deployments you should add logging, rate-limiting and explicit consent flows before collecting large numbers of images.

Need help?

If you run into issues or want to improve model accuracy, please:

← Back to Home