CropDamageClf is a machine learning model designed to classify crop damage using images. This project is part of the “Eyes on the Ground” initiative, a collaboration between ACRE Africa, the Kenya Agricultural & Livestock Research Organization (KALRO), the International Food Policy Research Institute (IFPRI), and the Lacuna Fund, aimed at developing a Picture Based Insurance framework for smallholder farmers.
The CropDamageClf project aims to help farmers across Africa manage agricultural risk by using image data to settle insurance claims and carry out loss assessment. ACRE Africa reviews smartphone pictures of insured crops sent by farmers to verify crop damage and provide agricultural advisories. These advisories depend on whether a crop is damaged and the cause of that damage, such as weather, pests, diseases, or man-made factors.
The project uses a collection of smartphone images of crops categorized into the following damage types:
The dataset is divided into training (train directory) and test (test directory) sets. The training set includes labeled images, while the test set contains images without labels for evaluation.
The project follows a structured approach to classify crop damage accurately:
Follow these steps to set up the project on your local machine:
git clone https://github.com/yash-raj202134/CropDamageClf.git
python -m venv cropdamageclf
source cropdamageclf/bin/activate # On Windows, use `cropdamageclf\Scripts\activate`
pip install -r requirements.txt
To use the CropDamageClf project, follow these steps:
python preprocess_data.py
python train_model.py
python evaluate_model.py
python classify_image.py --image_path path/to/image/file
The evaluation metric for this project is Log Loss. Your submission should look like:
| ID | DR | G | ND | WD | Other |
|---|---|---|---|---|---|
| ID_YMXCDK | 0.73 | 0.19 | 0.01 | 0.67 | 0.92 |
| ID_B3HJ3N | 0.03 | 0.45 | 0.99 | 0.46 | 0.20 |
The values should be between 0 and 1. Do not set thresholds or round your probabilities to improve your place on the leaderboard. This ensures the client receives the best solution and can set thresholds according to their needs.
The model should be lightweight and able to train and run inference within reasonable time constraints:
We welcome contributions from the community! If you would like to contribute, please follow these steps:
For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License. See the LICENSE file for more details.
Feel free to reach out with any questions or feedback:
Happy Coding!