Skip to content

morenoh149/plantdisease

Repository files navigation

Plant disease

Adapted from https://github.com/ClaudeCoulombe/deep-learning-with-python-notebooks/blob/master/5.3-using-a-pretrained-convnet.ipynb

data

The data was generated by crawling google and reddit. It was manually curated after reading about canabis diseases by a nonexpert. Please consult a professional if your marijuana is sick.

One source identifies 30 types of cannabis ailments:

  1. boron deficiency
  2. broad mites
  3. bud rot
  4. calcium deficiency
  5. copper deficiency
  6. fungus gnats
  7. heat light stress
  8. iron deficiency
  9. yellow leaf spot leaf septoria
  10. light burn
  11. magnesium deficiency
  12. male plants bananas hermies
  13. manganese deficiency
  14. molybdenum deficiency
  15. nitrogen deficiency
  16. nitrogen toxicity
  17. nutrient burn
  18. overwatering
  19. bugs pests symptoms marijuana grow
  20. ph fluctuations
  21. phosphorus deficiency
  22. potassium deficiency
  23. root problems
  24. root rot
  25. spider mites
  26. sulfur deficiency
  27. underwatering
  28. white powdery mildew
  29. wind burn
  30. zinc deficiency

resources:

the "other" dataset was generated from:

Data distribution

healthy 1120 sick 946 not_weed 964

train/validation/test 60/20/20

Notes

  • data augmentation make validation accuracy worse on first attempt. Must mean the transformations are not representative of valid data for our problem.
    • find transformations that produce valid data for our problem
  • resnet50 may overfit on datasets < 10K images
    • try VGG16
  • visualize misclassified samples to gain intuition about where the model is struggling
  • curate more data
  • consider dropping photos of groups of plants

gcloud notes

  • see projects gcloud projects list
  • see current project gcloud config list project
  • change project gcloud config set project <project name>
  • set bucket name BUCKET_NAME="keras-class-191806"
  • set your preferred region REGION=us-east1
  • copy model over gsutil cp src gs://$BUCKET_NAME/saved_model.pg NOTE: ml-engine expects your model's protocol buffer file to be name saved_model.{pb,pbtxt}
  • register ml-engine entry gcloud ml-engine models create <model name>
  • deploy version of model gcloud ml-engine versions create v4 --model=plantDisease01 --origin=gs://keras-class-191806/plantDisease01/vgg16_data_augmented-tf --runtime-version=1.4 the origin arg must be a local dir with the full tf model (protocol buffer and variables)
  • see models gcloud ml-engine models list
  • craft request payload python -c 'import base64, sys, json; img = base64.b64encode(open(sys.argv[1], "rb").read()).decode(); print(json.dumps({"foo-input": {"b64": img}}))' test_healthy.jpg &> request.json
  • craft request python -c 'req = []; [req.append(0.2) for i in range(224*224)]; print(req)' &> request-float32.json
  • inference gcloud ml-engine predict --model=plantDisease01 --json-instances=request.json

About

Predictive model for cannabis sickness

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published