Corn is a major staple crop that is grown around the world. However, it is vulnerable to various diseases that can significantly impact the yield and quality of the crop. Early detection and treatment of these diseases is crucial for maintaining the health of the crop and ensuring a good harvest.
This project aims to develop a machine learning model for recognizing diseases in corn leaves. The model was trained on a dataset of images of infected and healthy corn leaves, collected and labeled by Acharya (October 2020)
The ultimate goal of this project is to provide a tool for farmers and agricultural professionals to quickly and accurately identify diseases in their corn crops, allowing them to take timely action to prevent the spread of the disease and protect their crops.
The project will include the following steps:
- Data collection: The dataset for this project was downloaded from Kaggle (Acharya, October 2020).
- Data preprocessing: Clean and prepare the data for modeling, including resizing and normalizing the images.
- Model training: Train a machine learning model on the prepared dataset using supervised learning techniques.
- Model evaluation: Evaluate the performance of the trained model on a separate test dataset to assess its accuracy and reliability.
- Android app development: Develop an Android app that allows users to capture and classify images of corn leaves using the trained model.
This project is suitable for individuals with an interest in agriculture and machine learning, and those looking to develop skills in image classification, Android app development, and disease detection
Before training the model and deploying the app, you will need to install the following dependencies:
- Python 3.6 or higher
- TensorFlow 2.0 or higher
- Android Studio 4.0 or higher [OPTIONAL]
If you want to retrain, you can following this step.
Install dependencies
# clone project
git clone https://github.com/adhiiisetiawan/corn-disease-recognition
cd corn-disease-recognition
# [OPTIONAL] create python environment
python3 -m venv [your-python-venv-name]
# install requirements
pip3 install -r requirements.txt
Train model with default configuration
python3 main.py -c configs/corn_disease_config.json
Train model with chosen experiment configuration, you can copy default configuration and change any stuff there such as, learning rate, optimizer, batch size, etc. You also can change with your custom dataset by change in configuration.json
file. Just change in train_dir
and val_dir
key. And you can train with your personal configuration.
python3 main.py -c configs/[your-personal-config].json
An Android app was developed to allow users to capture and classify images of corn leaves using the trained model. The app includes a user-friendly interface for capturing and uploading images, as well as displaying the results of the classification. You can download the android apps here.
You also can export APK manually by opening CornDiseaseRecognitionApp in Android Studio and follow this step.
- Open the project in Android Studio.
- Go to "Build" > "Generate Signed APK" in the menu.
- Follow the prompts to create a signed APK
- Dataset: Corn Leaf Infection Dataset Version 1 by Acharya (October 2020).
- Project Template: Keras Project Template developed by Ahmkel.