Skip to content

For correctly predicting the crops from the images provided

Notifications You must be signed in to change notification settings

KartikeyJadli/Crop_Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Crop_Prediction

A project based on a model built by Deep Learning Algorithm, Convolutional Neural Network which can be used to predict crops like wheat, maize, rice, sugarcane, etc. from images. The Dataset for the project can be accessed by the link :- https://drive.google.com/file/d/1v-nHlweQA1lVadwW2gBmMXiDaRMbWu6v/view?usp=share_link . The main purpose of this project is to get a simple understanding of how the Convolutional Networks work ------>

image

With the help of the above diagram we can easily identify the layers made in the Convolutional Neural Networks and these are not restricted to just 1 or 5 layers, we can make n number of hidden layers for our model.

Overview

The above project contains a dataset consisting of images with crops :- Jute, Maize, Rice, Sugarcane and Wheat where we have to predict which image belongs to which class. We also have a csv file containing the details of the classes. The images can be as follows: image image image
image image

Also we can see the intesity of the images by using grayscale from OpenCV and easily visualize it in the dataset via graphs. For example, image

Now as we know that a machine cannot recognize or work omn strings or any other values except numerical values. So, to overcome this hurdle LabelEncoders are used to give a unique numerical value to each class. These classes can be easily used in the Convolutional Neural Networks.

The below code demonstrates the use of the Sequential. A CNN can be instantiated as a Sequential model because each layer has exactly one input and output and is stacked together to form the entire network. from tensorflow.keras.models import SequentialCNN = Sequential().

image

In the above piece of code we have used a an input layer, one output layer and in between are the hidden layers. With these layers we find out the features for the recognition also known as feature extraction. Then these features are stored in a higher dimensional array i.e., the matrix. Furthermore this matrix us flattened and then we classify the features which have been extracted. This part is known as Classification.

We can also see that the model has been trained 10 times with the help of epochs. An epoch is when all the training data is used at once and is defined as the total number of iterations of all the training data in one cycle for training the machine learning model.

Another way to define an epoch is the number of passes a training dataset takes around an algorithm. One pass is counted when the data set has done both forward and backward passes.

The number of epochs is considered a hyperparameter. It defines the number of times the entire data set has to be worked through the learning algorithm.

At last we can see the Validation Accuracy and Training Accuracy graph, also the Validation Loss and the Training Loss graph.

image

You can have the full project from the given link - https://drive.google.com/drive/folders/1RYqL7Js5VJk8oyb69ULHKM-CIh-9mtTy?usp=share_link

About

For correctly predicting the crops from the images provided

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published