Skip to content

Arunvijay28/Crop-Prediction

Repository files navigation

Crop-Prediction

It a web based application for crop prediction and suggesting fertilizer for a crop based on Aritifical Intelligence algorithm called Constraint Satisfaction Problem (CSP)

Table of Contents

Description
Website Walkthrough
Technologies Used
CSP
Intelligent Backtracking
Naive Bayes
Future works

Description

Given many parameters and different constraints, the system must recommend the suitable crop to be grown such that it should give maximum profit to the farmers as well as meet the market demand. The system also has a feature to suggest a fertilizer based on the nutrient contents present in a particular soil and type of crop to be grown in that particular soil.

Walkthrough

Home Screen

Crop Prediction Page

Sample Input

Sample Ranking of Crops

Fertilizer Suggestion Page

Sample Output for Fertilizer Suggestion

Tools Used

  • HTML - Interactive UI
  • CSS - Styling
  • Python - To implement CSP alogorithm
  • Flask - Web Framework
  • Matplotlib - Data Visualization
  • Sklearn - Data Modelling

CSP(Constraint Satisfaction Problem)

It consist of 3 elements:

  1. Domains
  2. Variables
  3. Constraints

In which :

  • Variables: A list containt crops,
  • Domains: A set of 10 crops,
  • Constraints: Temperature,Precipitation,Humidity etc..,
  • Dataset: It has data taken from government and synthetic data so it has an accuracy of 89% by providing proper dataset it can able to provide crops with an accuracy of 99.5%

Ways of Implementing

It can be implemented in 3 ways:

  1. Forward Chaining
  2. Backtracking
  3. Intelligent Backtracking

In which we have used intelligent Backtracking which is discussed later

Intelligent Backtracking

It get the constraints from the user and based on it finds the specific crops that satisfy that particular constraint and it will be added in the variables once if a contraint is not satisified it add the previous crop in the variables and does the intelligent backtracking and begins with new crop.

Naive Bayes

We have used Naive bayes model to detect the accuracy of the data collected from various websites to make sure that, the prediction made with that particular dataset is mostly accurate.

Future Works

To include a feature to detect disease by uploading an image of the infected plant .