{"id":28554401,"url":"https://github.com/mmerlyn/fertilizer-recommendation","last_synced_at":"2025-07-06T21:31:48.114Z","repository":{"id":283887726,"uuid":"886032581","full_name":"mmerlyn/fertilizer-recommendation","owner":"mmerlyn","description":"Helping smallholder farmers make smarter fertilizer decisions through deep learning–based nutrient diagnosis.","archived":false,"fork":false,"pushed_at":"2025-05-03T07:23:32.000Z","size":6324,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-10T05:06:33.871Z","etag":null,"topics":["agriculture","cnn-model","deep-learning","fertilizer-recommendation","image-classification","jupyter-notebook","machine-learning","nutrient-analysis","opencv","plant-health","python","streamlit-webapp"],"latest_commit_sha":null,"homepage":"https://uijrt.com/paper/nitrogen-deficiency-detection-paddy-urea-fertilizer-management","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mmerlyn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-10T02:19:23.000Z","updated_at":"2025-05-03T07:26:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa72d98b-bb88-4139-9368-0e292ebd0b76","html_url":"https://github.com/mmerlyn/fertilizer-recommendation","commit_stats":null,"previous_names":["mmerlyn/fertilizer-recommendation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mmerlyn/fertilizer-recommendation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmerlyn%2Ffertilizer-recommendation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmerlyn%2Ffertilizer-recommendation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmerlyn%2Ffertilizer-recommendation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmerlyn%2Ffertilizer-recommendation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmerlyn","download_url":"https://codeload.github.com/mmerlyn/fertilizer-recommendation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmerlyn%2Ffertilizer-recommendation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263975358,"owners_count":23538310,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agriculture","cnn-model","deep-learning","fertilizer-recommendation","image-classification","jupyter-notebook","machine-learning","nutrient-analysis","opencv","plant-health","python","streamlit-webapp"],"created_at":"2025-06-10T05:06:26.225Z","updated_at":"2025-07-06T21:31:48.108Z","avatar_url":"https://github.com/mmerlyn.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌿 Fertilizer Recommendation System\r\n\r\nA smart diagnostic tool designed to empower Indian farmers with accurate **nutrient deficiency detection** and **personalized fertilizer recommendations**, using deep learning and rule-based logic. By analyzing leaf images and combining them with contextual input, this system helps **reduce costs**, **improve yield**, and **prevent overfertilization** — especially for smallholder farmers without access to expert advice.\r\n\r\n## Project Objective\r\n\r\nTo support data-driven fertilizer usage by identifying specific nutrient deficiencies in rice, wheat, and maize crops using:\r\n- Leaf image classification via CNNs\r\n- Additional user inputs (leaf age, visual symptoms)\r\n- Rule-based mapping to nutrient deficiencies\r\n- Fertilizer dosage recommendation based on land size and deficiency\r\n\r\n## Impact\r\n\r\n\u003e More than 70% of Indian farmers are smallholders who rely on informal advice for fertilizer use. This often leads to **overapplication**, **yield loss**, and **environmental harm**.\r\n\r\nThis project addresses that by:\r\n- Providing **instant, accurate diagnosis** via mobile or web\r\n- **Reducing fertilizer waste** and costs by up to 40%\r\n- Helping avoid **soil and water pollution** caused by excess runoff\r\n- Encouraging **sustainable agriculture** through informed decisions\r\n\r\n## Publication\r\n\r\nThe initial phase of this project was published in the *United International Journal for Research \u0026 Technology (UIJRT)*:\r\n\r\n🔗 [Read the paper](https://uijrt.com/paper/nitrogen-deficiency-detection-paddy-urea-fertilizer-management)\r\n\r\n\r\n## Highlights\r\n- 🌾 Targets major crops in India: **rice, wheat, maize**\r\n- 📈 Dataset expanded from 100 to 400+ images using augmentation\r\n- 🧠 CNN model trained on real, labeled leaf image data\r\n- ✅ Achieved **88.24% final test accuracy** in identifying nutrient deficiency symptoms\r\n- 🧪 Research-based rules from Montana State University \u0026 USDA for fertilizer recommendation\r\n\r\n\r\n## Crops \u0026 Nutrients Covered\r\n\r\n### 🌱 Crops\r\n- Rice\r\n- Wheat\r\n- Maize\r\n\r\n### 💊 Nutrients\r\n- Potassium\r\n- Magnesium\r\n- Zinc\r\n- Iron\r\n- Manganese\r\n- Copper\r\n- Boron\r\n- Sulphur\r\n- **Nitrogen** (only for rice)\r\n\r\n## 🛠️ Tech Stack\r\n\r\n- Python\r\n- TensorFlow / Keras\r\n- OpenCV\r\n- Streamlit (for app UI)\r\n- Pandas / NumPy / Matplotlib\r\n- Excel (fertilizer database)\r\n\r\n## ⚙️ Working\r\n\r\n1. **User uploads a leaf image** showing symptoms (e.g. chlorosis, necrosis).\r\n2. The image is classified into one of five categories:  \r\n   `['interveinal', 'margin', 'normal', 'spotty', 'tip']`\r\n3. User inputs:\r\n   - Leaf age (new / middle / old)\r\n   - Additional symptoms (stunted growth, red spots, twisted leaves, yellowing)\r\n4. **Deficiency is predicted** based on model + rules\r\n5. **Fertilizer type and quantity** are recommended using stored expert data\r\n6. Land size input is used to calculate dosage precisely\r\n\r\n## 📁 Project Files\r\n\r\n| File | Description |\r\n|------|-------------|\r\n| `fertilizer.xls` | Fertilizer info for all crops and deficiencies |\r\n| `first_app.py` | Streamlit web app UI |\r\n| `200_epoch_97_87_soft.h5` | Trained CNN model (5 leaf classes) |\r\n| `plain2model.tflite` | Nitrogen classifier (rice only, LCC based) |\r\n| `nn_model_basic.ipynb` | CNN training notebook |\r\n| `SessionState.py` | Streamlit session management helper |\r\n\r\n\r\n## 📊 Results\r\n\r\n- **Validation Accuracy**: 90%\r\n- **Final Test Accuracy**: 88.24%\r\n\r\nModel performance drops slightly on real webcam images vs. ideal training images, highlighting the importance of consistent preprocessing in deployment environments.\r\n\r\nDetailed analysis and performance metrics are available in the `project_report` file.\r\n\r\n## 📜 License\r\n\r\n© All rights reserved.  \r\nThis project was undertaken in partial fulfillment of the requirements for the Bachelor of Engineering degree in Computer Science at BMS Institute of Technology and Management, Bengaluru, India.\r\n\r\n**Team Members:**\r\n1. Aishwarya M\r\n2. Merlyn Mercylona Maki Reddy\r\n3. Namrata Karki\r\n\r\n\r\n## Acknowledgments\r\n\r\n- Montana State University – Nutrient Deficiency Research\r\n- US Department of Agriculture (USDA) – Fertilizer usage guidelines\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmerlyn%2Ffertilizer-recommendation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmerlyn%2Ffertilizer-recommendation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmerlyn%2Ffertilizer-recommendation/lists"}