https://github.com/samarth4023/shell-internship-1
🌱 Crop & Fertilizer Recommendation System using Machine Learning This project is developed as part of my AICTE-Shell Internship and aims to optimize agriculture by leveraging Machine Learning (ML) and Artificial Intelligence (AI). The system provides real-time recommendations for crop selection and fertilizer application.
https://github.com/samarth4023/shell-internship-1
ai artificial-intelligence ensemble-model machine-learning ml streamlit
Last synced: 2 months ago
JSON representation
🌱 Crop & Fertilizer Recommendation System using Machine Learning This project is developed as part of my AICTE-Shell Internship and aims to optimize agriculture by leveraging Machine Learning (ML) and Artificial Intelligence (AI). The system provides real-time recommendations for crop selection and fertilizer application.
- Host: GitHub
- URL: https://github.com/samarth4023/shell-internship-1
- Owner: Samarth4023
- Created: 2025-01-23T05:56:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-15T13:03:27.000Z (over 1 year ago)
- Last Synced: 2025-08-20T21:40:40.653Z (10 months ago)
- Topics: ai, artificial-intelligence, ensemble-model, machine-learning, ml, streamlit
- Language: Jupyter Notebook
- Homepage: https://crop-fertilizer-recommendation.streamlit.app/
- Size: 19.7 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
license: apache-2.0
title: 🌱 Crop & Fertilizer Recommendation System
sdk: streamlit
emoji: 🌍
colorFrom: green
colorTo: blue
pinned: false
thumbnail: >-
https://cdn-uploads.huggingface.co/production/uploads/6686260107019f3fe482ce08/1bMo8NSG3us4-ggFtRyM5.jpeg
short_description: The system provides real-time recommendations for crp & fert
sdk_version: 1.43.2
---
# **🌱 Crop & Fertilizer Recommendation System**
## **📌 Introduction**
This project is a **AI Powered Crop & Fertilizer Recommendation System**, developed as part of my **AICTE-Shell Internship**. The system provides **personalized crop and fertilizer recommendations** based on soil composition, weather conditions, and crop requirements.
🔗 **Deployed Application:** [Crop & Fertilizer Recommendation System](https://huggingface.co/spaces/SamarthPujari/Crop-and-Fertilizer-Recommendation-System)
## **🎯 Project Goals**
✅ Integrate **AI and Green Skills** into agriculture.
✅ Explore **Machine Learning techniques** for precision farming.
✅ Develop a **real-time recommendation system** for farmers.
✅ Enhance **data preprocessing, model selection, and optimization skills**.
✅ Deploy an **interactive web app** using **Streamlit**.
## **📂 Datasets Used**
The project uses two datasets:
### **1️⃣ Crop Dataset**
- **Features:** Nitrogen, Phosphorous, Potassium, Temperature, Humidity, pH, Rainfall
- **Target Variable:** Crop Label (Crop Name)
### **2️⃣ Fertilizer Dataset**
- **Features:** Temperature, Humidity, Moisture, Soil Type, Crop Type, Nitrogen, Phosphorous, Potassium
- **Target Variable:** Fertilizer Name
## **📊 Methodology**
### **Step 1: Data Collection & Preprocessing**
🔹 **Performed Exploratory Data Analysis (EDA)** to understand data distributions.
🔹 **Encoded categorical variables** using Label Encoding.
🔹 **Split the dataset** into **train & test sets** using Scikit-Learn.
### **Step 2: Model Selection & Training**
🔹 Tested multiple **ML algorithms**, including:
- Logistic Regression, GaussianNB, SVC, KNN, DecisionTree, ExtraTree, RandomForest, Bagging, Gradient Boosting, AdaBoost, CatBoost, and LGBM.
🔹 Compared **model performance** based on accuracy & validation metrics.
### **Step 3: Ensemble Learning for Optimization**
🔹 Evaluated different ensemble techniques:
- **Voting Classifier, Stacking, Averaging Probabilities, Weighted Ensemble, Blend Ensemble (Custom Blending).**
🔹 **Blend Ensemble provided the best results**, so it was selected.
🔹 **Cross-validation** was performed to validate model performance.
### **Step 4: Deployment & Integration**
🔹 Exported trained models as **.pkl files** (`crop_recommendation.pkl`, `fertilizer_recommendation.pkl`).
🔹 Integrated models into a **Streamlit app** for real-time predictions.
🔹 **Deployed the application on Streamlit Cloud.**
## **🔍 Key Features**
✅ **Real-time Model Performance Metrics** (Accuracy Tracking).
✅ **Feature Importance Analysis** for better interpretability.
✅ **Feature Distributions** to understand data variations.
✅ **Prediction Probabilities** to assess model confidence.
## **🚀 Technologies Used**
| Category | Tools & Libraries |
|---------------------|-------------------|
| **Development** | Python, Jupyter Notebook, Anaconda |
| **ML Frameworks** | Scikit-Learn, CatBoost, LGBM |
| **Data Processing**| Pandas, NumPy |
| **Visualization** | Matplotlib, Seaborn, Plotly |
| **Deployment** | HuggingFace, Streamlit, Streamlit Cloud |
## **📷 Screenshots**
| **Streamlit App - Crop Recommendation** |
|-----------------------------------------|
||
| **Streamlit App - Fertilizer Recommendation** |
|-----------------------------------------------|
||
## **🎯 Future Improvements**
🔹 Expand the dataset to include **more crop varieties & soil types**.
🔹 Integrate **real-time weather data** for better recommendations.
🔹 Incorporate **IoT & satellite data** for advanced precision farming.
🔹 Optimize **model efficiency & deployment** for faster predictions.
## **📥 Installation & Setup**
### **🔹 Clone the Repository**
```bash
git clone https://github.com/Samarth4023/Shell-Internship-1.git
cd Shell-Internship-1
```
### **🔹 Install Required Dependencies**
```bash
pip install -r requirements.txt
```
### **🔹 Run the Streamlit App**
```bash
streamlit run app.py
```
## **📜 License**
This project is **open-source** and free to use. Feel free to contribute!
## **📧 Contact**
📌 **Author:** Samarth Pujari
📌 **GitHub:** [Samarth4023](https://github.com/Samarth4023)
📌 **LinkedIn:** [Samarth Pujari](https://www.linkedin.com/in/samarth-pujari-328a1326a)