Accidental Coders
Sanchit (Karlex1) for GDG Campus Solution
Small and marginal farmers, who constitute approximately 126 million of India's agricultural sector, face significant challenges due to limited landholdings, resource constraints, and the adverse impacts of climate change. In regions like Siddharthnagar and Balrampur in Uttar Pradesh, erratic rainfall, rising temperatures, and extreme weather events have disrupted traditional farming practices, leading to reduced crop yields, economic difficulties, and environmental degradation.
- Climate Change Impacts: Unpredictable weather patterns and rising temperatures.
- Resource Constraints: Limited access to quality seeds, fertilizers, and modern farming equipment.
- Soil Degradation: Unsustainable farming practices leading to soil erosion and loss of fertility.
- Information Gap: Limited access to accurate and timely agricultural information.
- Inefficient Practices: Resource-intensive traditional methods prone to crop failures.
These challenges result in economic losses, food insecurity, and environmental degradation, threatening the livelihoods of small and marginal farmers and the well-being of rural communities.
Participants are tasked with creating an AI-powered agricultural advisory system to provide timely, relevant, and personalized agricultural information to small and marginal farmers. The solution should leverage machine learning, remote sensing, and IoT technologies to address the challenges and improve agricultural productivity, resilience, and sustainability.
The Crop Yield Prediction project aims to estimate crop yield based on various factors such as pesticide use, item type, and geographical region (country). The model utilizes machine learning techniques and integrates real-time weather data (temperature and rainfall) to enhance prediction accuracy.
- Machine Learning Models: Uses Linear Regression (lr), Lasso (lso), Ridge (rdg), K-Nearest Neighbors (knr), and Decision Tree Regressor (dtr) for prediction.
- Weather API Integration: Automatically fetches temperature and rainfall data for the selected region and year.
- Streamlit Web Application: Provides an interactive UI for users to input data and view predictions.
- Intelligent Year Handling: Ensures proper handling of the year input for meaningful predictions.
- Nova Chatbot Integration: A built-in chatbot to assist users with agricultural-related queries in real-time.
The Nova Chatbot is a virtual assistant integrated into the Crop Yield Prediction web app to provide real-time help with agricultural queries. It offers:
- AI-driven responses to crop-related concerns.
- Recommendations on fertilizers, pesticides, and best farming practices.
- A user-friendly floating chat button in the Streamlit UI.
To access Nova, simply click on the chat button at the bottom right of the web app.
- Clone the repository:
git clone https://github.com/Karlex1/Crop_yield_Prediction.git
- Navigate to the project directory:
cd Crop_yield_Prediction - Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On macOS/Linux venv\Scripts\activate # On Windows
- Install dependencies:
pip install -r requirements.txt
To run the machine learning model, execute the Jupyter Notebook file:
jupyter notebook Crop_Yield_Prediction.ipynbThis will open the notebook interface where you can train and test the model interactively.
To launch the Streamlit web application, run:
streamlit run app.pyThis will start a local server, and you can access the app in your browser.
- Pesticide Usage: Amount of pesticide applied.
- Crop Item: The specific crop type being analyzed.
- Country (Area): The geographical region for prediction.
- Year: The year for which the prediction is being made.
- Enhance the model with additional machine learning algorithms.
- Improve UI/UX for better user interaction.
- Add support for more data sources to improve prediction accuracy.
- Deploy the Streamlit app online.
- Expand Nova Chatbot capabilities for multilingual support and voice assistance.
Contributions are welcome! Feel free to fork the repository, make changes, and submit a pull request.
- Fork the repository.
- Create a new branch for your feature or fix:
git checkout -b feature-branch-name
- Make your changes and commit them:
git commit -m "Add your commit message here" - Push your changes to your fork:
git push origin feature-branch-name
- Open a pull request on GitHub and describe your changes.
This project is licensed under the MIT License.
For any queries or suggestions, connect on LinkedIn or drop an email at sanchit959871@gmail.com. For any queries or suggestions, please reach out via GitHub Issues.