Huddy2022 / milestone-project-mildew-detection-in-cherry-leaves

0 stars 1 forks source link

Cherry Leaf Powdery Mildew Detector

Deployed version : Cherry leaf powdery mildew detector app

Dataset Content

Business Requirements

The cherry plantation crop from Farmy & Foods is facing a challenge where their cherry plantations have been presenting powdery mildew. Currently, the process is manual verification if a given cherry tree contains powdery mildew. An employee spends around 30 minutes in each tree, taking a few samples of tree leaves and verifying visually if the leaf tree is healthy or has powdery mildew. If there is powdery mildew, the employee applies a specific compound to kill the fungus. The time spent applying this compound is 1 minute. The company has thousands of cherry trees, located on multiple farms across the country. As a result, this manual process is not scalable due to the time spent in the manual process inspection.

To save time in this process, the IT team suggested an ML system that detects instantly, using a leaf tree image, if it is healthy or has powdery mildew. A similar manual process is in place for other crops for detecting pests, and if this initiative is successful, there is a realistic chance to replicate this project for all other crops. The dataset is a collection of cherry leaf images provided by Farmy & Foods, taken from their crops.

Rationale to map the business requirements to the Data Visualizations and ML tasks

Business Requirement 1: Conduct a study to visually differentiate a healthy cherry leaf from one with powdery mildew.

Business Requirement 2: Develop a predictive model to determine if a cherry leaf is healthy or contains powdery mildew.

Hypothesis and how to validate?

Hypothesis 1: Does infected leaves have clear marks differentiating them from the healthy leaves.

Hypothesis 2: Does SoftMax perform better than sigmoid as the activation function for the CNN output layer.

ML Business Case

Development and Machine Learning Model Iterations

Conclusion and Potential Course of Actions

In this project, we formulated and validated hypotheses related to the detection of powdery mildew in cherry leaves. Through research, analysis, and machine learning model development, we have gained valuable insights and achieved the following conclusions:

Based on these conclusions, several potential course of actions can be considered:

1 - Further Research: Conduct additional research to explore other factors or variables that may contribute to powdery mildew detection in cherry leaves. This could involve investigating different image processing techniques, exploring advanced machine learning algorithms, or considering the integration of other data sources.

2 - Implementation Strategies: Explore strategies for implementing the validated hypotheses into practical applications. This may involve collaborating with agricultural experts and stakeholders to develop automated detection systems or integrating the model into existing agricultural processes.

3 - Decision-Making: Utilize the validated hypotheses and model predictions to support decision-making processes in the agricultural industry. This could include assisting farmers in identifying and managing powdery mildew outbreaks, optimizing resource allocation for disease prevention, or improving crop quality control measures.

By considering these potential course of actions, we can leverage the insights gained from this project to address the challenges posed by powdery mildew in cherry plantations and potentially extend the application to other crops.

Dashboard Design & features

Page 1: Quick Project Summary

Quick project summary page

Page 2: Cherry Leaves Visualizer

Answers business requirements 1

Difference between average and variability images

Difference between average powdery mildew cherry leaves and average healthy cherry leaves

Image Montage

Page 3: Powdery Mildew Detector

Answers business requirements 2

Powdery mildew detector

Predictions report

Page 4: Project Hypothesis & validation

Project hypothesis page

Page 5: ML Performance & evaluation

Bar chart (label distribution) & pie chart (dataset distribution)

Model history

Confusion matrix and classification report

The CRISP-DM Methodology

My CRISP-DM provides a structured approach for the data mining project. It outlines the different phases of a project, the tasks within each phase, and the relationships between these tasks.

To document this process for the Powdery Mildew detection project, a Kanban Board provided by GitHub was used in the repository's project section. A Kanban board is an agile project management tool that helped visualize the work, limit work-in-progress, and improve efficiency. It uses cards and columns to organize tasks and facilitate continuous improvement.

Kanban board

In this project, the CRISP-DM process was divided into sprints. Each sprint is associated with epics based on the CRISP-DM tasks. These epics were further broken down into individual tasks. Throughout the workflow, tasks can progress through different statuses such as To Do, In Progress, and Done, providing a clear overview of the project's progress.

Sprints

In addition to the tasks and epics within the CRISP-DM process, the Powdery Mildew detection project also incorporated user stories. User stories represent specific functionalities or features from the perspective of end users.

To capture these user stories, comments were used within the Kanban board to provide detailed information about the tasks. These comments outlined the specific requirements, objectives, and expectations related to each user story.

Commented user stories

By including user stories in the comments section, I could ensure that the implementation of each task aligned with the desired functionalities and provided value to the end users. This approach helped to prioritize development efforts, track progress, and maintain a user-centric focus throughout the project.

Unfixed Bugs

Images producing false predictions

wrong image

Deployment

Heroku

  1. Log in to Heroku and create an App with desired name
  2. At the Deploy tab, select GitHub as the deployment method.
  3. Select your repository name and click Search. Once it is found, click Connect
  4. Log into Heroku CLI in IDE workspace terminal using the bash command: heroku login -i and enter user credentials
  5. In terminal set heroku stack:set heroku-20 -a appname, for compatibility with the Python 3.8.12 version used for this project
  6. Select the main branch, then click Deploy Branch.
  7. Wait for the logs to run while the dependencies are installed and the app is being built.
  8. Once finished and successfully deployed I could open the app from the button at the top.
  9. If the slug size was too large then I added large files not required for the app to the .slugignore file.

Main Data Analysis and Machine Learning Libraries

Other technologies used

Testing

Manual Testing

Testing

Validation

Credits

Content

Acknowledgements

Deployed version at Cherry leaf powdery mildew detector app