Download as pdf or txt
Download as pdf or txt
You are on page 1of 58

CHAPTER 1 INTRODUCTION

1.1 Machine learning


Machine Learning is a system of computer algorithms that can learn from example
through self- improvement without being explicitly coded by a programmer. Machine
learning is a part of artificial Intelligence which combines data with statistical tools to
predict an output which can be used to make actionable insights.
The breakthrough comes with the idea that a machine can singularly learn from the data
(i.e., example) to produce accurate results. Machine learning is closely related to data
mining and Bayesian predictive modelling. The machine receives data as input and uses
an algorithm to formulate answers.
A typical machine learning tasks are to provide a recommendation. For those who have a
Netflix account, all recommendations of movies or series are based on the user's
historical data. Tech companies are using unsupervised learning to improve the user
experience with personalising recommendations.
Machine learning is also used for a variety of tasks like fraud detection, predictive
maintenance, portfolio optimization, automatizing task and so on.

1.2 Deep Learning


Deep learning is a subset of machine learning that uses multi-layered neural networks,
called deep neural networks, to simulate the complex decision-making power of the
human brain. Some form of deep learning powers most of the artificial intelligence (AI)
in our lives today a deep neural network, or DNN, is a neural network with three or more
layers. In practice, most DNNs have many more layers. DNNs are trained on large
amounts of data to identify and classify phenomena, recognize patterns and relationships,
evaluate possibilities, and make predictions and decisions. While a single-layer neural
network can make useful, approximate predictions and decisions, the additional layers in
a deep neural network help refine and optimize those outcomes for greater accuracy.
Deep learning drives many applications and services that improve automation,
performing analytical and physical tasks without human intervention. It lies behind
everyday products and services—e.g., digital assistants, voice-enabled TV remotes,

1
credit card fraud detection—as well as still emerging technologies such as self-driving
cars and generative AI.

1.3 Deep Learning V/S Machine Learning.


If deep learning is a subset of machine learning, how do they differ? Deep learning
distinguishes itself from classical machine learning by the type of data that it works with
and the methods in which it learns.
Machine learning algorithms leverage structured, labelled data to make
predictions—meaning that specific features are defined from the input data for the model
and organised into tables. This doesn’t necessarily mean that it doesn’t use unstructured
data; it just means that if it does, it generally goes through some pre-processing to
organise it into a structured format.
Deep learning eliminates some of data pre-processing that is typically involved with
machine learning. These algorithms can ingest and process unstructured data, like text
and images, and it automates feature extraction, removing some of the dependency on
human experts. For example, let’s say that we had a set of photos of different pets, and
we wanted to categorize by “cat”, “dog”, “hamster”, et cetera. Deep learning algorithms
can determine which features (e.g. ears) are most important to distinguish each animal
from another. In machine learning, this hierarchy of features is established manually by a
human expert.
Then, through the processes of gradient descent and backpropagation, the deep learning
algorithm adjusts and fits itself for accuracy, allowing it to make predictions about a new
photo of an animal with increased precision.
Machine learning and deep learning models are capable of different types of learning as
well, which are usually categorised as supervised learning, unsupervised learning, and
reinforcement learning.
Supervised learning utilises labelled datasets to categorise or make predictions; this
requires some kind of human intervention to label input data correctly. In contrast,
unsupervised learning doesn’t require labelled datasets, and instead, it detects patterns in
the data, clustering them by any distinguishing characteristics. Reinforcement learning is

2
a process in which a model learns to become more accurate for performing an action in
an environment based on feedback in order to maximize the reward.

1.4 How deep learning Works


Deep learning neural networks, or artificial neural networks, attempts to mimic the
human brain through a combination of data inputs, weights, and bias. These elements
work together to accurately recognize, classify, and describe objects within the data.
Deep neural networks consist of multiple layers of interconnected nodes, each building
upon the previous layer to refine and optimize the prediction or categorization. This
progression of computations through the network is called forward propagation. The
input and output layers of a deep neural network are called visible layers. The input layer
is where the deep learning model ingests the data for processing, and the output layer is
where the final prediction or classification is made.
Another process called backpropagation uses algorithms, like gradient descent, to
calculate errors in predictions and then adjusts the weights and biases of the function by
moving backwards through the layers in an effort to train the model. Together, forward
propagation and backpropagation allow a neural network to make predictions and correct
for any errors accordingly. Over time, the algorithm becomes gradually more accurate.
The above describes the simplest type of deep neural network in the simplest terms.
However, deep learning algorithms are incredibly complex, and there are different types
of neural networks to address specific problems or datasets. For example,
Convolutional neural networks (CNNs), used primarily in computer vision and image
classification applications, can detect features and patterns within an image, enabling
tasks, like object detection or recognition. In 2015, a CNN bested a human in an object
recognition challenge for the first time.
Recurrent neural network (RNNs) are typically used in natural language and speech
recognition applications as it leverages sequential or times series data.

1.5 Deep learning application


Real-world deep learning applications are a part of our daily lives, but in most cases, they
are so well-integrated into products and services that users are unaware of the complex

3
data processing that is taking place in the background. Some of these examples include
the following:
1. Law enforcement:- Deep learning algorithms can analyse and learn from
transactional data to identify dangerous patterns that indicate possible fraudulent
or criminal activity. Speech recognition, computer vision, and other deep learning
applications can improve the efficiency and effectiveness of investigative analysis
by extracting patterns and evidence from sound and video recordings, images, and
documents, which helps law enforcement analyse large amounts of data more
quickly and accurately.
2. Financial services:- Financial institutions regularly use predictive analytics to
drive algorithmic trading of stocks, assess business risks for loan approvals, detect
fraud, and help manage credit and investment portfolios for clients.
3. Customer service :- Many organisations incorporate deep learning technology
into their customer service processes. Chatbots—used in a variety of applications,
services, and customer service portals—are a straightforward form of AI.
Traditional chatbots use natural language and even visual recognition, commonly
found in call centre-like menus. However, more sophisticated chatbot solutions
attempt to determine, through learning, if there are multiple responses to
ambiguous questions. Based on the responses it receives, the chatbot then tries to
answer these questions directly or route the conversation to a human user.
4. Healthcare:- The healthcare industry has benefited greatly from deep learning
capabilities ever since the digitization of hospital records and images. Image
recognition applications can support medical imaging specialists and radiologists,
helping them analyse and assess more images in less time.
5. Deep learning:- The core objective of machine learning is the learning and
inference. First of all, the machine learns through the discovery of patterns. This
discovery is made thanks to the data. One crucial part of the data scientist is to
choose carefully which data to provide to the machine. The list of attributes used
to solve a problem is called a feature vector. You can think of a feature vector as a
subset of data that is used to tackle a problem.

4
1.6 Inferring
When the model is built, it is possible to test how powerful it is on never-seen-before
data. The new data are transformed into a features vector, go through the model and give
a prediction. This is all the beautiful part of machine learning. There is no need to update
the rules or train again the model. You can use the model previously trained to make
inference on new data.

Fig 1.6 Inference from model


The life of Machine Learning programs is straightforward and can be summarized in the
following points:
1. Define a question
2. Collect data
3. Visualize data
4. Train algorithm
5. Test the Algorithm
6. Collect feedback
7. Refine the algorithm
8. Loop 4-7 until the results are satisfying
9. Use the model to make a prediction

Once the algorithm gets good at drawing the right conclusions, it applies that knowledge
to new sets of data.

5
1.7 Machine Learning Algorithms and where they are used?
1.7.1 Convolutional Neural Networks (CNNs)
Convolutional Neural Networks (CNNs) are a class of deep neural networks, most
commonly applied to analysing visual imagery. They have revolutionised various fields
such as computer vision, image recognition, and even natural language processing.
key components and concepts of CNNs:
1. Convolutional Layer: This is the core building block of a CNN. In this layer, a
set of learnable filters (also called kernels) slide over the input image, computing
dot products between the filter and localised portions of the input. This operation
enables the network to detect features like edges, textures, and patterns at
different spatial locations in the image.
2. Pooling Layer: After the convolutional layer, pooling layers are often added to
progressively reduce the spatial size of the representation, reducing the amount of
parameters and computation in the network. Max pooling is a common pooling
technique where the maximum value within a region is selected.
3. Activation Function: Typically, CNNs use activation functions like ReLU
(Rectified Linear Unit) to introduce non-linearity into the network, allowing it to
learn complex patterns.
4. Fully Connected Layer: After several convolutional and pooling layers, the
high-level reasoning in the neural network is done via fully connected layers.
These layers take the high-level features from the convolutional layers and use
them to classify the input into various classes.
5. Softmax Layer: In classification tasks, the softmax layer is often used as the
output layer. It converts the raw scores (output of the previous layer) into
probability values, indicating the likelihood of each class.
6. Training: CNNs are typically trained using supervised learning, where the
network learns to map input images to their respective class labels by minimizing
a loss function, such as cross-entropy loss. This is done through backpropagation
and optimization algorithms like Stochastic Gradient Descent (SGD) or Adam.
7. Transfer Learning: Due to the computational resources required to train deep
CNNs from scratch, transfer learning is a common practice. Pre-trained CNN

6
models, like VGG, ResNet, or Inception, which have been trained on large
datasets like ImageNet, are fine-tuned on specific tasks with smaller datasets.
8. Data Augmentation: To improve generalization and prevent overfitting, data
augmentation techniques are often employed. These techniques involve
generating new training samples through transformations like rotations, flips, and
shifts on the original dataset.
9. Applications: CNNs have a wide range of applications including image
classification, object detection, facial recognition, medical image analysis,
autonomous vehicles, and more. They have achieved state-of-the-art performance
in many of these tasks.
10. Overall, CNNs have significantly advanced the field of computer vision and
continue to be a cornerstone of research and applications in artificial intelligence.

1.7.2 Long Short Term Memory Networks (LSTMs)


Long Short-Term Memory (LSTM) networks are a type of recurrent neural network
(RNN) architecture, designed to address the vanishing gradient problem often
encountered in traditional RNNs. LSTMs are particularly well-suited for sequence
prediction problems and have been widely used in tasks such as language modelling,
speech recognition, machine translation, and more.
Here's a breakdown of the key components and concepts of LSTMs:
1. Memory Cells: LSTMs contain memory cells that maintain a cell state, which
serves as the long-term memory of the network. This enables LSTMs to retain
information over long sequences, making them effective for capturing temporal
dependencies.
2. Gates: LSTMs use three gates to control the flow of information into and out of
the memory cell:
3. Forget Gate: Determines which information from the cell state should be
discarded or forgotten. It takes input from the previous hidden state and current
input, and outputs a forget gate vector (values between 0 and 1) indicating how
much of each cell state element to forget.

7
4. Input Gate: Determines which new information to store in the cell state. It
consists of two parts:
5. Input Gate: Determines which values from the input should be updated. It
computes a candidate value vector.
6. Update Gate: Combines the candidate values with the forget gate output to
update the cell state.
7. Output Gate: Controls which information from the cell state should be exposed
as the output. It takes input from the previous hidden state and current input, and
outputs an output gate vector that is multiplied element-wise with the cell state.
8. Hidden State: LSTMs also have a hidden state that acts as the short-term
memory of the network. It is updated based on the cell state and input at each time
step.
9. Training: LSTMs are trained using backpropagation through time (BPTT), an
extension of backpropagation that considers the unfolding of the network over
time. The parameters (weights and biases) of the LSTM network are updated to
minimise a loss function, typically using gradient descent-based optimization
algorithms like Adam or RMSProp.
10. Bidirectional LSTMs: In some cases, bidirectional LSTMs are used, which
process the input sequence both forwards and backwards. This allows the network
to capture dependencies from both past and future contexts.
11. Applications: LSTMs have been successfully applied in various tasks such as:
12. Natural Language Processing (NLP): Language modeling, text generation,
sentiment analysis, machine translation.
13. Speech Recognition: Phoneme recognition, speech synthesis.
14. Time Series Prediction: Stock price prediction, weather forecasting.
15. Gesture Recognition: Handwriting recognition, action recognition in videos.

1.7.3 Recurrent Neural Networks (RNNs)


Recurrent Neural Networks (RNNs) are a class of neural networks designed to work with
sequential data by maintaining a hidden state that captures information about previous
elements in the sequence. Unlike traditional feedforward neural networks, RNNs have

8
connections that form directed cycles, allowing them to exhibit temporal dynamics and
handle inputs of variable length.
key components and concepts of RNNs:
1. Recurrent Connections: RNNs have recurrent connections that enable them to
maintain information over time by feeding the output of a neuron back to itself as
input in the next time step. This loop allows the network to retain memory and
process sequences of arbitrary length.
2. Hidden State: At each time step, an RNN computes a hidden state vector based
on the current input and the previous hidden state. This hidden state serves as the
memory of the network and encodes information about past inputs in the
sequence.
3. Activation Function: Similar to other neural networks, RNNs use activation
functions (e.g., sigmoid, tanh, ReLU) to introduce non-linearity into the model,
enabling it to learn complex patterns in the data.
4. Training: RNNs are typically trained using backpropagation through time
(BPTT), which is an extension of the standard backpropagation algorithm for
feedforward networks. BPTT involves unfolding the network over time and
computing gradients at each time step to update the parameters (weights and
biases) of the network.
5. Vanishing Gradient Problem: One challenge with training RNNs is the
vanishing gradient problem, where gradients become very small as they propagate
back through time, leading to difficulties in learning long-range dependencies.
This problem can be mitigated to some extent using techniques like gradient
clipping, using alternative activation functions, or employing specialized RNN
architectures like Long Short-Term Memory (LSTM) networks or Gated
Recurrent Units (GRUs).
6. Applications: RNNs have been successfully applied in various tasks involving
sequential data, including:
7. Natural Language Processing (NLP): Language modeling, text generation,
sentiment analysis, machine translation.

9
8. Time Series Analysis: Stock market prediction, weather forecasting,
physiological signal analysis.
9. Speech Recognition: Phoneme recognition, speech synthesis.
10. Video Analysis: Action recognition, video captioning.
11. Genomics: DNA sequence analysis, gene expression prediction.
12. Despite their effectiveness in modelling sequential data, RNNs have limitations
such as difficulties in learning long-range dependencies and challenges in
parallelization due to their sequential nature. However, they serve as the basis for
more advanced architectures like LSTM and GRU, which address some of these
limitations while retaining the ability to process sequential data.

1.7.4 Generative Adversarial Networks (GANs)


Generative Adversarial Networks (GANs) are a class of generative models introduced by
Ian Goodfellow and his colleagues in 2014. GANs consist of two neural networks, the
generator and the discriminator, which are trained simultaneously through a minimax
game framework. GANs are particularly powerful in generating realistic synthetic data,
such as images, audio, text, and more, and have found applications in various fields
including computer vision, natural language processing, and drug discovery.
key components and concepts of GANs:
1. Generator: The generator network takes random noise (often sampled from a
simple distribution like Gaussian or uniform) as input and learns to generate
synthetic data samples that resemble the training data. It transforms the input
noise into data samples that are indistinguishable from real data.
2. Discriminator: The discriminator network is a binary classifier that learns to
distinguish between real data samples from the training set and fake data samples
generated by the generator. It is trained to assign high probabilities to real data
and low probabilities to fake data.
3. Adversarial Training: GANs are trained using a minimax game framework,
where the generator and discriminator are trained simultaneously in a competitive
manner. The generator aims to generate realistic data samples to fool the

10
discriminator, while the discriminator aims to distinguish between real and fake
data accurately.
4. Loss Functions: The generator aims to generate realistic data samples to fool the
discriminator, while the discriminator aims to distinguish between real and fake
data accurately.
5. Generator Loss: The generator's objective is to minimize the probability that the
discriminator correctly classifies its generated samples as fake. This is typically
achieved by maximizing the log-probability of the discriminator making a
mistake, effectively encouraging the generator to produce realistic samples.
6. Discriminator Loss: The discriminator's objective is to correctly classify real and
fake samples. It aims to minimize the sum of the negative log-probabilities
assigned to the correct labels for both real and fake samples.
7. Training Procedure: During training, the generator and discriminator are updated
alternately. First, the discriminator is trained on a batch of real and fake samples.
Then, the generator is trained to generate more realistic samples to better fool the
discriminator. This process continues iteratively until convergence.
8. Mode Collapse: One common challenge in training GANs is mode collapse,
where the generator produces limited varieties of samples or ignores certain
modes of the data distribution. Mode collapse can occur when the generator
overfits to a small subset of the training data or when the discriminator becomes
too effective at distinguishing fake samples.
9. Applications: GANs have been applied in various domains, including:
10. Image Generation: Generating high-resolution images, image-to-image
translation, style transfer.
11. Data Augmentation: Generating synthetic data for training machine learning
models in scenarios with limited data.
12. Super-Resolution: Upscaling low-resolution images to higher resolutions.
13. Anomaly Detection: Identifying anomalies or outliers in data distributions.
14. Drug Discovery: Generating novel molecular structures with desired properties.
15. Overall, GANs have demonstrated remarkable capabilities in generating
high-quality synthetic data and have spurred significant research and development

11
in the field of generative modelling. However, training GANs can be challenging
due to issues like mode collapse, instability, and hyperparameter sensitivity,
which continue to be active areas of research

1.7.5 Radial Basis Function Networks (RBFNs)


Radial Basis Function Networks (RBFNs) are a type of artificial neural network that uses
radial basis functions as activation functions. Unlike traditional feedforward neural
networks, which typically use sigmoid or ReLU activation functions, RBFNs have a
different architecture and activation mechanism.
The key components and concepts of RBFNs:
Radial Basis Functions (RBFs): The core of RBFNs lies in the radial basis functions,
which are mathematical functions that depend only on the distance from a reference point
(or centre). The most commonly used RBF is the Gaussian function, which is defined as:
Architecture: RBFNs typically consist of three layers:
1. Input Layer: The input layer receives the input features.
2. Hidden Layer: The hidden layer contains radial basis functions, each centered at
a specific point in the input space. The output of each RBF neuron in the hidden
layer is computed based on the distance between the input vector and the center of
the RBF.
3. Output Layer: The output layer combines the outputs of the hidden layer neurons
to produce the final output. This layer often performs a linear combination of the
outputs from the hidden layer neurons.
Training: Training RBFNs involves two main steps:
1. Centroid Selection: The centres of the radial basis functions need to be
determined. This can be done using clustering algorithms such as k-means
clustering, where the centres are initialised randomly and then adjusted iteratively
to minimise the overall distance between data points and their assigned cluster
centres.
2. Weight Adjustment: Once the centres are fixed, the weights between the hidden
and output layers are adjusted using techniques like least squares regression or

12
gradient descent to minimise the error between the network's output and the
desired output.
Advantages:
1. RBFNs are particularly effective for function approximation tasks, interpolation,
and pattern recognition.
2. They have a simple and interpretable architecture.
3. RBFNs can provide smooth and continuous outputs due to the use of radial basis
functions.
Disadvantages:
1. Determining the optimal number and positions of radial basis functions can be
challenging.
2. RBFNs may suffer from overfitting, especially when the number of radial basis
functions is too large relative to the size of the training data.
Applications: RBFNs have been used in various fields, including:
1. Function approximation and interpolation.
2. Time series prediction.
3. Classification and pattern recognition.
4. Financial forecasting.
Overall, RBFNs offer an alternative approach to traditional neural networks, particularly
suitable for tasks where smooth interpolation or function approximation is desired.
However, they require careful tuning of hyperparameters and may not always generalize
well to unseen data.

13
Chapter 2 LITERATURE REVIEW
1. CRY—an improved crop yield prediction model using bee hive
clustering approach for agricultural data sets
Agricultural researchers over the world insist on the need for an efficient mechanism to
predict and improve the crop growth. The need for an integrated crop growth control with
accurate predictive yield management methodology is highly felt among farming
community. The complexity of predicting the crop yield is highly due to multi
dimensional variable metrics and unavailability of predictive modeling approach, which
leads to loss in crop yield. This research paper suggests a crop yield prediction model
(CRY) which works on an adaptive cluster approach over dynamically updated historical
crop data set to predict the crop yield and improve the decision making in precision
agriculture. CRY uses bee hive modeling approach to analyze and classify the crop based
on crop growth pattern, yield. CRY classified dataset had been tested using Clementine
over existing crop domain knowledge. The results and performance shows comparison of
CRY over with other cluster approaches.

2. An intelligent system based on kernel methods for crop yield


prediction
This paper presents work on developing a software system for predicting crop yield from
climate and plantation data. At the core of this system is a method for unsupervised
partitioning of data for finding spatio-temporal patterns in climate data using kernel
methods which offer strength to deal with complex data. For this purpose, a robust
weighted kernel k-means algorithm incorporating spatial constraints is presented. The
algorithm can effectively handle noise, outliers and auto-correlation in the spatial data,
for effective and efficient data analysis, and thus can be used for predicting oil-palm yield
by analyzing various factors affecting the yield.

14
3. Fuzzy Logic based Crop Yield Prediction using Temperature and
Rainfall parameters predicted through ARMA, SARIMA, and ARMAX
models
Agriculture plays a significant role in the economy of India. This makes crop yield
prediction an important task to help boost India's growth. Crops are sensitive to various
weather phenomena such as temperature and rainfall. Therefore, it becomes crucial to
include these features when predicting the yield of a crop. Weather forecasting is a
complicated process. In this work, three methods are used to forecast- ARMA (Auto
Regressive Moving Average), SARIMA (Seasonal Auto Regressive Integrated Moving
Average) and ARMAX (ARMA with exogenous variables). The performance of the three
is compared and the best model is used to predict rainfall and temperature which are in
turn used to predict the crop yield based on a fuzzy logic model.

4) Crop Yield Prediction Using Data Analytics and Hybrid Approach


Agricultural data is being produced constantly and enormously. As a result, agricultural
data has come in the era of big data. Smart technologies contribute in data collection
using electronic devices. In our project we are going to analyse and mine this agricultural
data to get useful results using technologies like data analytics and machine learning and
this result will be given to farmers for better crop yield in terms.

5) A study on various data mining techniques for crop yield prediction


India is a country where agriculture and agriculture related industries are the major
source of living for the people. Agriculture is a major source of economy of the country.
It is also one of the country which suffer from major natural calamities like drought or
flood which damages the crop. This leads to huge financial loss for the farmers thus
leading to the suicide. Predicting the crop yield well in advance prior to its harvest can
help the farmers and Government organizations to make appropriate planning like
storing, selling, fixing minimum support price, importing/exporting etc. Predicting a crop
well in advance requires a systematic study of huge data coming from various variables
like soil quality, pH, EC, N, P, K etc. As Prediction of crop deals with large set of

15
database thus making this prediction system a perfect candidate for application of data
mining. Through data mining we extract the knowledge from the huge size of data. This
paper presents the study about the various data mining techniques used for predicting the
crop yield. The success of any crop yield prediction system heavily relies on how
accurately the features have been extracted and how appropriately classifiers have been
employed. This paper summarizes the results obtained by various algorithms which are
being used by various authors for crop yield prediction, with their accuracy and
recommendation

6. Crop Yield Prediction Using CNN and RNN model


Evaluating nutrition, health, and development initiatives, as well as guiding government
policy across many sectors, all rely on accurate measurements of food security. This is
also true for directing food and economic relief, providing early famine warning, and
supporting global monitoring networks. The wide variety of methods and instruments
available for gauging food security makes this vital endeavor more difficult. As a result,
we've compiled a review of food security assessment methods, including the
aforementioned difficulties of nomenclature, measurement, and validity. We start with a
discussion of the changing meaning of food security and use it as a framework for a look
at the state of the art in terms of existing measuring techniques for gauging food security.
We evaluate the goals of these instruments, the areas of food security they measure, the
underlying conceptualizations of food security, and the methods employed to validate
them. We detail methods for measuring things like 1) the availability of food in a country,
2) the effectiveness of food distribution networks, 3) the ease with which individuals may
obtain and consume food, and 4) how much food is wasted. Having outlined a variety of
unresolved measurement issues that could be investigated in subsequent

7. Syngenta Crop challenge Using CNN and RNN model.


The training data included three sets: crop genotype, yield performance, and environment
(weather and soil). The genotype dataset contained genetic information for all
experimental hybrids, each having 19,465 genetic markers. The yield performance
dataset contained the observed yield, check yield (average yield across all hybrids of the

16
same location), and yield difference of 148,452 samples for different hybrids planted in
different years and locations. Yield difference is the difference between yield and check
yield, and indicates the relative performance of a hybrid against other hybrids at the same
location (Marko et al., 2017). The environment dataset contained 8 soil variables and 72
weather variables (6 weather variables measured for 12 months of each year). The soil
variables included percentage of clay, silt and sand, available water capacity (AWC), soil
pH, organic matter (OM), cation-exchange capacity (CEC), and soil saturated hydraulic
conductivity (KSAT). The weather data provided in the 2018 Syngenta Crop Challenge
were normalized and anonymized. Based on the pattern of the data, we hypothesized that
they included day length, precipitation, solar radiation, vapor pressure, maximum
temperature, and minimum temperature. Part of the challenge was to predict the 2017
weather variables and use them for yield prediction of the same year.
The goal of the 2018 Syngenta Crop Challenge was to predict the performance of corns
in 2017, but the ground truth response variables for 2017 were not released after the
competition. In this paper, we used the 2001–2015 data and part of the 2016 data as the
training dataset (containing 142,952 samples) and the remaining part of the 2016 data as
the validation dataset (containing 5,510 samples). All validation samples were unique
combinations of hybrids and locations, which did not have any overlap with training data.

2.2 Model Architecture


Due to the nonlinearity and complexity of the features, it is important to build a deep
learning framework for yield prediction. Inspired by the success of CNN and RNN, a
CNN-LSTM network was proposed in the study, which mainly consists of 2-Dimensional
Convolutional neural networks (Conv2D) and LSTM networks [55]. CNN can learn the
relevant features from an image at different levels similar to a human brain. An LSTM
has the capability of bridging long time lags between inputs over arbitrary time intervals.
The use of LSTM improves the efficiency of depicting temporal patterns at various
frequencies, which is a desirable feature in the analysis of crop growing cycles with
different lengths. The architecture of the proposed CNN-LSTM is shown in Figure 3. The
inputs of the model are the tensors generated from the proposed GEE-based framework.
The output is the predicted soybean yield. Different from traditional pure CNN or pure

17
LSTM architectures, the proposed model mainly has two components: The first is CNN
used for feature extraction, and the second is LSTM, which is used to learn the temporal
features extracted by CNN. The CNN starts from two Conv2D layers with a kernel size
of 1×2 , the first Conv2D has 32 filters and the second has 64 counterparts. Feature maps
are first followed by a batch normalization layer and then followed by a 2-dimensional
max-pooling layer with 1×2 kernel. This improves generalization, robustness to small
distortions, and also reduces dimensionality. Note that batch normalization is employed
after each convolutional layer, which is another method to regularize a CNN. In addition
to providing a regularizing effect, batch normalization also gives CNN resistance to the
vanishing gradient during training, which can decrease training time and result in better
performance [56]. By the TimeDistributed wrapper, the two stacked Conv2D layers are
applied to every temporal slice of the inputs for feature extraction. Then, each output is
flattened and batch normalized successively before they are fed into an LSTM layer.
There is only one LSTM layer in the LSTM part. The neurons’ number of the LSTM is
set to 256, which is followed by a dense layer with 64 neurons. After that, all temporal
output is flattened into a long vector, which is sent into a Dropout layer with 0.5 dropout
probability; the dropout layer can randomly turn off a percentage of neurons during
training, which can help prevent groups of neurons from all overfitting to themselves.
Finally, a one neuron dense layer is used to output predicted yield.

Fig 2. CNN FEATURE EXTRACTION

18
2.3 OBJECTIVES
This project aims at predicting the crop yield at a particular weather condition and
thereby recommending suitable crops for that field. It involves the following steps.
1. Collect the weather data, crop yield data, soil type data and the rainfall data and
merge these datasets in a structured form and clean the data. Data Cleaning is
done to remove inaccurate, incomplete and unreasonable data that increases the
quality of the data and hence the overall productivity.
2. Perform Exploratory Data Analysis (EDA) that helps in analysing the complete
dataset and summarising the main characteristics. It is used to discover patterns,
spot anomalies and to get graphical representations of various attributes. Most
importantly, it tells us the importance of each attribute, the dependence of each
attribute on the class attribute and other crucial information.
3. Divide the analysed crop data into training and testing sets and train the model
using the training data to predict the crop yield for given inputs.
4. Compare various Algorithms by passing the analysed dataset through them and
calculating the error rate and accuracy for each. Choose the algorithm with the
highest accuracy and lowest error rate.
5. Implement a system in the form of a mobile application and integrate the
algorithm at the Dept of CSE, CMRIT 2019-2020 Page 4 Crop Yield Prediction
based on Weather using Machine Learning back end.
6. Test the implemented system to check for accuracy and failure

2.4 Model data Points:


1. Identifying Trends: Look for common methodologies or data types to see what’s
popular in the field or perhaps overly relied on.
2. Spotting Gaps: Focus on the 'Research Gaps' column to identify where there are
consistent issues or shortcomings across different studies. This can indicate
where new research could be most valuable.
3. Guiding Research: Use the gaps to propose y findings to different crops, regions,
or data type.

19
India is a country where agriculture and agriculture related industries are the major
source of living for the people. Agriculture is a major source of the economy of the
country. It is also one of the countries which suffer from major natural calamities like
drought or flood which damages the crop. This leads to huge financial loss for the
farmers thus leading to the suicide. Predicting the crop yield well in advance prior to its
harvest can help the farmers and Government organisations to make appropriate planning
like storing, selling, fixing minimum support price, importing/exporting etc. Predicting a
crop well in advance requires a systematic study of huge data coming from various
variables like soil quality, pH, EC, N, P, K etc. Prediction of crops deals with a large set
of databases thus making this prediction system a perfect candidate for application of
data mining. Through data mining we extract knowledge from the huge size of data.
Its harvest can help the farmers and Government organisations to make appropriate
planning like storing, selling, fixing minimum support price, importing/exporting etc.
Predicting a crop well in advance requires a systematic study of huge data coming from
various variables like soil quality, pH, EC, N, P, K etc. Prediction of crops deals with a
large set of databases thus making this prediction system a perfect candidate for
application of data mining. Through data mining we extract the knowledge from the huge
size of data

20
Chapter 3 Tool & Technology
3.1 System Requirements:
3.1.1 Hardware Requirement

SYSTEM INTEL i9 4900K

HARD DISK 2TB NVME M.2 SSD

FLOPPY DISK 1.44 Mb.

MONITOR LG 49Wl95C 49-Inch Curved 32

MOUSE Logitech MX Master 3.

RAM 24GB 6000 mhz DDR5.

3.1.2 Software Requirements

Operating System Windows 11

Coding Languages Python

Database MySql

3.2 Software Environment


3.2.1 Python:
Python is a high-level, interpreted, interactive and object-oriented scripting language.
Python is designed to be highly readable. It uses English keywords frequently where as
other languages use punctuation, and it has fewer syntactic constructions than other
languages.
1. Python is Interpreted −Python is processed at runtime by the interpreter. You do
not need to compile your program before executing it. This is similar to PERL
and PHP.n.
2. Python is Interactive −You can sit at a Python prompt and interact with the
interpreter directly to write your programs.

21
3. Python is Object-Oriented −Python supports Object-Oriented style or technique of
programming that encapsulates code within objects.
4. Python is a Beginner's Language −Python is a great language for the
beginner-level programmers and supports the development of a wide range of
applications from simple text processing to WWW browsers to games.

3.2.2 History of Python


1. Python was developed by Guido van Rossum in the late eighties and early
nineties at the National Research Institute for Mathematics and Computer Science
in the Netherlands.
2. Python is derived from many other languages, including ABC, Modula-3, C, C++,
Algol-68, Small Talk, and Unix shell and other scripting languages.
3. Python is copyrighted. Like Perl, Python source code is now available under the
GNU General Public License (GPL).
4. Python is now maintained by a core development team at the institute, although
Guido van Rossum still holds a vital role in directing its progress.
5. Python was developed by Guido van Rossum in the late eighties and early
nineties at the National Research Institute for Mathematics and Computer Science
in the Netherlands.
6. Python is derived from many other languages, including ABC, Modula-3, C, C++,
Algol-68, Small Talk, and Unix shell and other scripting languages.
7. Python is copyrighted. Like Perl, Python source code is now available under the
GNU General Public License (GPL).

3.2.3 Python Features


Python's features include−
1. Easy-to-learn −Python has few keywords, simple structure, and a clearly defined
syntax. This allows the student to pick up the language quickly.
2. Easy-to-read −Python code is more clearly defined andvisible to the eyes.
3. Easy-to-maintain −Python's source code is fairly easy-to-maintain.

22
4. A broad standard library −Python's bulk of the library is very portable and cross-
platform compatible on UNIX, Windows, and Macintosh.
5. Interactive Mode −Python has support for an interactive mode which allows
interactive testing and debugging of snippets of code.
6. Portable −Python can run on a wide variety of hardware platforms and has the
same interface on all platforms.
7. Extendable −You can add low-level modules to the Python interpreter. These
modules enable programmers to add to or customize their tools to be more
efficient.
8. Databases −Python provides interfaces to all major commercial databases.
9. GUI Programming −Python supports GUI applications that can be created and
ported to many system calls, libraries and windows systems, such as Windows
MFC, Macintosh, and the X Window system of Unix.
10. Scalable −Python provides a better structure and support for large programs than
shell scripting.
11. Apart from the above-mentioned features, Python has a big list of good features,
few are listed below−
12. It supports functional and structured programming methods as well as OOP.
13. It can be used as a scripting language or can be compiled to byte-code for
building large applications.

3.3 Script Mode Programming


Invoking the interpreter with a script parameter begins execution of the script and
continues until the script is finished. When the script is finished, the interpreter is no
longer active.
Let us write a simple Python program in a script. Python files have extension (.py). Type
the following source code in a test.py file.
Python program is a script based language which involves Type.py and the interpreter is
no longer active.

23
3.4 Flask Framework:
Flask is a web application framework written in Python. Armin Ronacher, who leads an
international group of Python enthusiasts named Pocco, develops it. Flask is based on
Werkzeug WSGI toolkit and Jinja2 template engine. Both are Pocco projects.
Invoking the interpreter with a script parameter begins execution of the script and
continues until the script is finished. When the script is finished, the interpreter is no
longer active.

24
3.5 Tools Used
3.5.1 Visual Studio Code (VSCODE):
Visual Studio Code, also commonly referred to as VS Code, is a source-code editor made
by Microsoft the Electron Framework, for Windows, Linux and macOS] Features include
support for debugging, syntax highlighting, intelligent code completion, snippets, code
refactoring, and embedded Git. Users can change the theme, keyboard shortcuts,
preferences, and install extensions that add additional functionality.
In the Stack Overflow2021 Developer Survey, Visual Studio Code was ranked the most
popular developer environment tool among 82,000 respondents; with 70% reporting that
they use it

Fig 3 VSCODE

3.5.2 Features:
1. Visual Studio Code is a source-code editor that can be used with a variety of
programming languages, including C# , Java, JavaScript, Go, Node.js, Python,
C++, C, Rust and Fortran. It is based on the Electron framework, which is used to
develop Node.js web applications that run on the Blink layout engine. Visual
Studio Code employs the same editor component (codenamed "Monaco") used
Azure DevOps (formerly called Visual Studio Online and Visual Studio Team
Services).
2. Out of the box, Visual Studio Code includes basic support for most common
programming languages. This basic support includes syntax highlighting, bracket
matching, code folding, and configurable snippets. Visual Studio Code also ships

25
with IntelliSense for JavaScript, Type Script, JSON, CSS and HTML, as well as
debugging support for Node.js. Support for additional languages can be provided
by freely available extensions on the VS Code Marketplace.
3. Instead of a project system, it allows users to open one or more directories, which
can then be saved in workspaces for future use. This allows it to operate as a
language-agnostic code editor for any language. It supports many programming
languages and a set of features that differs per language. Unwanted files and
folders can be excluded from the project tree via the settings. Many Visual Studio
Code features are not exposed through menus or the user interface but can be
accessed via the command palette.
4. Visual Studio Code can be extended via extensions available through a central
repository. This includes additions to the editor and language support. A notable
feature is the ability to create extensions that add support for new languages,
themes, debuggers, time travel debuggers, perform static code analysis, and add
code linters using the Language Server Protocol.
5. Source control is a built-in feature of Visual Studio Code. It has a dedicated tab
inside of the menu bar where users can access version control settings and view
changes made to the current project. To use the feature, Visual Studio Code must
be linked to any supported version control system (Git, Apache Sub version,
Perforce, etc.). This allows users to create repositories as well as to make push
and pull requests directly from the Visual Studio Code program.
6. Visual Studio Code includes multiple extensions for FTP, allowing the software to
be used as a free alternative for web development. Code can be synced between
the editor and the server, without downloading any extra software

26
Chapter 4 METHODOLOGY

4.1 SYSTEM DESIGN


4.1.1 SYSTEM ARCHITECTURE:

Fig. 4 SYSTEM ARCHITECTURE

4.2 DATA FLOW DIAGRAM:


1. The DFD is also called a bubble chart. It is a simple graphical formalism that can
be used to represent a system in terms of input data to the system, various
processing carried out on this data, and the output data is generated by this
system.
2. The data flow diagram (DFD) is one of the most important modeling tools. It is
used to model the system components. These components are the system process,
the data used by the process, an external entity that interacts with the system and
the information flows in the system.

27
3. DFD shows how the information moves through the system and how it is
modified by a series of transformations. It is a graphical technique that depicts
information flow and the transformations that are applied as data moves from
input to
4. DFD is also known as a bubble chart. A DFD may be used to represent a system
at any level of abstraction. DFD may be partitioned into levels that represent
increasing information flow and functional detail.
5.

Fig. 5 DFD Diagram

28
4.3 UML DIAGRAMS
1. UML stands for Unified Modelling Language. UML is a standardized
general-purpose modelling language in the field of object-oriented software
engineering. The standard is managed, and was created by, the Object
Management Group.
2. The goal is for UML to become a common language for creating models of object
oriented computer software. In its current form UML is comprised of two major
components: a Meta- model and a notation. In the future, some form of method or
process may also be added to; or associated with, UML.
3. The Unified Modelling Language is a standard language for specifying,
Visualization, Constructing and documenting the artefacts of software system, as
well as for business modelling and other non- software systems.
4. The UML represents a collection of best engineering practices that have proven
successful in the modelling of large and complex systems.
5. The UML is a very important part of developing objects oriented software and the
software development process. The UML uses mostly graphical notations to
express the design of software projects.

4.4 GOALS:
1. The Primary goals in the design of the UML are as follows:
2. Provide users a ready-to-use, expressive visual modelling Language so that they
can develop and exchange meaningful models.
3. Provide extendibility and specialisation mechanisms to extend the core concepts.
4. Be independent of particular programming languages and development process.
5. Provide a formal basis for understanding the modelling language.
6. Encourage the growth of the OO tools market.
7. Support higher level development concepts such as collaborations, frameworks,
patterns and components.
8. Integrate best practices.

29
4.5 USE CASE DIAGRAM
A use case diagram in the Unified Modeling Language (UML) is a type of behavioral
diagram defined by and created from a Use-case analysis. Its purpose is to present a
graphical overview of the functionality provided by a system in terms of actors, their
goals (represented as use cases), and any dependencies between those use cases. The
main purpose of a use case diagram is to show what system functions are performed for
which actor. Roles of the actors in the system can be depicted.

Fig. 6 Use Case Diagram

30
4.6 CLASS DIAGRAM:
In software engineering, a class diagram in the Unified Modelling Language (UML) is a
type of static structure diagram that describes the structure of a system by showing the
system's classes, their attributes, operations (or methods), and the relationships among the
classes. It explains which class contains information.

Fig. 7 Class Diagram

4.7 SEQUENCE DIAGRAM:


A sequence diagram in Unified Modelling Language (UML) is a kind of interaction
diagram that shows how processes operate with one another and in what order. It is a
construct of a Message Sequence Chart. Sequence diagrams are sometimes called event
diagrams, event scenarios, and timing diagrams.

31
Sequence Diagrams show elements as they interact over time and they are organized
according to object (horizontally) and time (vertically):

Fig. 8 Sequence Diagram

4.8 COLLABORATION DIAGRAM:


A collaboration diagram, also known as a communication diagram, is a type of
interaction diagram in Unified Modeling Language (UML) used to visualize the
interactions and relationships between objects in a system or a scenario. It illustrates how
objects communicate with each other to accomplish a specific task or scenario.

32
Fig . 9 Collaboration Diagram

33
Chapter 5 IMPLEMENTATION AND RESULT
5.1 MODULES:
1. Data Collection
2. Dataset
3. Data Preparation
4. Model Selection
5. Analyze and Prediction
6. Accuracy on test set
7. Saving the Trained Model

5.2 MODULES DESCRIPTION:


5.2.1 Data Collection:
1. This is the first real step towards the real development of a machine learning
model, collecting data. This is a critical step that will cascade in how good the
model will be, the more and better data that we get, the better our model will
perform.
2. There are several techniques to collect the data, like web scraping, manual
interventions, etc.
3. We attached data set in the document , The file name is crop_modified.csv

5.2.2 Dataset:
1. The dataset consists of 2232 individual data. There are 9 columns in the dataset,
which are described below.
2. Id: unique id
3. State_Name: India is a union of States and Union Territories for the purposes of
administration, India is divided into 29 States
4. District_Name: District in india
5. Crop_Year: which year crop harvested.
6. Season:
Winter, occurring from December to February. ...

34
Summer or pre-monsoon season, lasting from March to May. ...
Monsoon or rainy season, lasting from June to September. ...
Post-monsoon or autumn season, lasting from October to November.
7. Crop: crop name
Area: how much area? they harvested.
Production: production amount
cat_crop: cat_crop name

5.2.3 Data Preparation:


we will transform the data. By getting rid of missing data and removing some columns.
First we will create a list of column names that we want to keep or retain.
Next we drop or remove all columns except for the columns that we want to retain.
Finally we drop or remove the rows that have missing values from the data set.

5.2.4 Model Selection:


The genotype data were coded in {−1, 0, 1} values, respectively representing aa, aA, and
AA alleles. Approximately 37% of the genotype data had missing values. To address this
issue, we used a two-step approach to preprocess the genotype data before they can be
used by the neural network model. First, we used a 97% call rate to discard genetic
markers whose non-missing values were below this call rate. Then we also discarded
genetic markers whose lowest frequent allele's frequency were below 1%, since these
markers were less heterozygous and therefore less informative. As a result, we reduced
the number of genetic markers from 19,465 to 627. To impute the missing data in the
remaining part of the genotype data, we tried multiple imputation techniques, including
mean, median, and most frequent (Allison, 2001), and found that the median approach
led to the most accurate predictions. The yield and environment datasets were complete
and did not have missing data.
Once the model is trained, we need to Test the model. For that we will pass test_x to the
predict method.
We trained two deep neural networks, one for yield and the other for check yield, and
then used the difference of their outputs as the prediction for yield difference. These

35
models are illustrated in Figure 3. This model structure was found to be more effective
than using one single neural network for yield difference, because the genotype and
environment effects are more directly related to the yield and check yield than their
difference.

5.2.5 Convolutional Neural Networks (CNN)


1. Data Preparation: Ensure your dataset includes images of crops or related visual
data. Each image should be associated with a label indicating the type of crop or
some relevant information.
2. Data Preprocessing: Preprocess your image data, which may include resizing
images to a standard size, normalising pixel values, and augmenting the dataset
with techniques like rotation, flipping, or zooming to increase data diversity.
3. Model Architecture: Define your CNN architecture using libraries like
TensorFlow or Keras. Typically, a CNN consists of convolutional layers, pooling
layers, and fully connected layers. You can design a suitable architecture based on
the complexity of your task and the characteristics of your data.
4. Training: Train your CNN model on the prepared dataset. Use techniques like
batch training and validation to monitor the model's performance and prevent
overfitting. You can train the model using GPUs to speed up the process if
available.
5. Evaluation: Evaluate the trained model on a separate test dataset to assess its
performance metrics such as accuracy, precision, recall, and F1-score. Adjust the
model hyperparameters or architecture as needed to improve performance.
6. Deployment: Once satisfied with the model's performance, deploy it to make
predictions on new, unseen data. You can integrate the trained CNN model into
your existing application or create a separate inference pipeline for making
predictions.

36
5.2.6 Convolutional Neural Networks (CNN)
Using feedforward neural networks (FFNN) involves several key steps, from data
preparation to model evaluation. Here's a comprehensive guide on how to use FFNN in
your project:
1. Data Preparation:Data Collection: Gather the dataset relevant to your problem
domain. Ensure the data is appropriately labelled.
2. Data Preprocessing: Clean the data by handling missing values, outliers, and
formatting inconsistencies. Normalise or scale the features to ensure uniformity in
data distribution.
3. Train-Test Split: Divide the dataset into training and testing sets. The training set
is used to train the model, while the testing set evaluates its performance on
unseen data.
4. Define Architecture: Design the FFNN architecture, including the number of
layers, the number of neurons in each layer, and the activation functions.
5. Compile Model: Compile the model by specifying the loss function, optimizer,
and evaluation metrics.
6. Fit Model: Train the FFNN model using the training dataset. Adjust the
hyperparameters like batch size and number of epochs to optimise performance.
7. Monitor Training: Monitor the training process using metrics such as loss and
accuracy. Utilise techniques like early stopping to prevent overfitting.
8. Evaluate Performance: Evaluate the trained model on the test dataset to assess
its generalisation performance. Measure metrics like accuracy, precision, recall,
and F1-score.
9. Visualise Results: Visualise the model's performance using plots like confusion
matrices or ROC curves.
10. Hyperparameter Tuning: Experiment with different hyperparameters to
fine-tune the model's performance. Use techniques like grid search or random
search for optimization.
11. Regularisation: Apply regularisation techniques like L1/L2 regularisation or
dropout to prevent overfitting.

37
12. Deploy Model: Deploy the trained FFNN model in a production environment to
make predictions on new data.
13. Integration: Integrate the model into your application or system for real-time
inference.

5.2.7 Analyze and Prediction:


● In the actual dataset, we chose only 6 features :
● State_Name: India is a union of States and Union Territories for the purposes of
administration, India is divided into 29 States
● District_Name: District in india
● Crop_Year: which year the crop harvested.

● Season:
○ Winter, occurring from December to February. ...pre-monsoon season,
lasting from March to May.
○ Monsoon or rainy season, lasting from June to September. Post-monsoon
or autumn season, lasting from October to November.
● Crop: crop name
○ Area: how much area? they harvested.
○ Accuracy on test set:
○ We got a accuracy of 80.1% on test set.

5.3 INPUT DESIGN AND OUTPUT DESIGN


5.3.1 INPUT DESIGN
The input design is the link between the information system and the user. It comprises the
developing specification and procedures for data preparation and those steps are
necessary to put transaction data in to a usable form for processing can be achieved by
inspecting the computer to read data from a written or printed document or it can occur
by having people keying the data directly into the system. The design of input focuses on
controlling the amount of input required, controlling the errors, avoiding delay, avoiding
extra steps and keeping the process simple. The input is designed in such a way so that it

38
provides security and ease of use with retaining privacy. Input Design considered the
following things:
● What data should be given as input?
● How should the data be arranged or coded?
● The dialog to guide the operating personnel in providing input.
● Methods for preparing input validations and steps to follow when errors occur.

5.3.2 OBJECTIVES
Input Design is the process of converting a user-oriented description of the input into a
computer-based system. This design is important to avoid errors in the data input process
and show the correct direction to the management for getting correct information from
the computerised system.
1. It is achieved by creating user-friendly screens for the data entry to handle large
volumes of data. The goal of designing input is to make data entry easier and to
be free from errors. The data entry screen is designed in such a way that all the
data can be performed. It also provides record viewing facilities.
2. When the data is entered it will check for its validity. Data can be entered with the
help of screens. Appropriate messages are provided as when needed so that the
user will not be in maize instant. Thus the objective of input design is to create an
input layout that is easy to follow

5.4 OUTPUT DESIGN


A quality output is one, which meets the requirements of the end user and presents the
information clearly. In any system results of processing are communicated to the users
and to other systems through outputs. In output design it is determined how the
information is to be displaced for immediate need and also the hard copy output. It is the
most important and direct source of information to the user. Efficient and intelligent
output design improves the system’s relationship to help user decision-making.
1. Designing computer output should proceed in an organised, well thought out
manner; the right output must be developed while ensuring that each output
element is designed so that people will find the system can be used easily and

39
effectively. When analysis design computer output, they should Identify the
specific output that is needed to meet the requirements.
2. Select methods for presenting information.
3. Create documents, reports, or other formats that contain information produced.

5.5 SYSTEM STUDY


5.5.1 FEASIBILITY STUDY
The feasibility of the project is analysed in this phase and the business proposal is put
forth with a very general plan for the project and some cost estimates. During system
analysis the feasibility study of the proposed system is to be carried out. This is to ensure
that the proposed system is not a burden to the company. For feasibility analysis, some
understanding of the major requirements for the system is essential.
Three key considerations involved in the feasibility analysis are
1. ECONOMICAL FEASIBILITY
2. TECHNICAL FEASIBILITY
3. SOCIAL FEASIBILITY

5.5.2 ECONOMICAL FEASIBILITY


This study is carried out to check the economic impact that the system will have on the
organisation. The amount of funds that the company can pour into the research and
development of the system is limited. The expenditures must be justified. Thus the
developed system as well within the budget and this was achieved because most of the
technologies used are freely available. Only the customised products had to be purchased.

5.5.3 TECHNICAL FEASIBILITY


This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand on the
available technical resources. This will lead to high demands on the available technical
resources. This will lead to high demands being placed on the client. The developed
system must have a modest requirement, as only minimal or null changes are required for
implementing this system.

40
5.6 SOCIAL FEASIBILITY
The aspect of study is to check the level of acceptance of the system by the user. This
includes the process of training the user to use the system efficiently. The user must not
feel threatened by the system, instead must accept it as a necessity. The level of
acceptance by the users solely depends on the methods that are employed to educate the
user about the system and to make him familiar with it. His level of confidence must be
raised so that he is also able to make some constructive criticism, which is welcomed, as
he is the final user of the system.

5.7 SYSTEM TESTING


The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, sub-assemblies, assemblies and/or a finished product It is
the process of exercising software with the intent of ensuring that Software system meets
its requirements and user expectations and does not fail in an unacceptable manner. There
are various types of test. Each test type addresses a specific testing requirement.

5.8 TYPES OF TESTS


5.8.1 Unit testing
Unit testing involves the design of test cases that validate that the internal program logic
is functioning properly, and that program inputs produce valid outputs. All decision
branches and internal code flow should be validated. It is the testing of individual
software units of the application .it is done after the completion of an individual unit
before integration. This is a structural testing, that relies on knowledge of its construction
and is invasive. Unit tests perform basic tests at component level and test a specific
business process, application, and/or system configuration. Unit tests ensure that each
unique path of a business process performs accurately to the documented specifications
and contains clearly defined inputs and expected results
The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, sub-assemblies, assemblies and/or a finished product It is

41
the process of exercising software with the intent of ensuring that Software system meets
its requirements and user expectations and does not fail in an unacceptable manner. There
are various types of test. Each test type addresses a specific testing requirement.
Unit tests perform basic tests at component level and test a specific business process,
application, and/or system configuration. Unit tests ensure that each unique path of a
business process performs accurately to the documented specifications and contains
clearly defined inputs and expected results
The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, sub-assemblies, assemblies and/or a finished product It is
the process of exercising software with the intent of ensuring that Software system meets
its requirements and user expectations and does not fail in an unacceptable manner. There
are various types of test. Each test type addresses a specific testing requirement.

5.8.2 Integration testing


Integration tests are designed to test integrated software components to determine if they
run as one program. Testing is event driven and is more concerned with the basic
outcome of screens or fields. Integration tests demonstrate that although the components
were individually satisfaction, as shown by successfully unit testing, the combination of
components is correct and consistent. Integration testing is specifically aimed at exposing
the problems that arise from the combination of components.

5.8.3 Functional test


Functional tests provide systematic demonstrations that functions tested are available as
specified by the business and technical requirements, system documentation, and user
manuals.
Functional testing is centred on the following items:

Valid Input : identified classes of valid input must be accepted.


Invalid Input : identified classes of invalid input must be rejected.
Functions : identified functions must be exercised.

42
Output : identified classes of application outputs must be exercised.
Systems/Procedures: interfacing systems or procedures must be invoked.
Organisation and preparation of functional tests is focused on requirements, key
functions, or special test cases. In addition, systematic coverage pertaining to identifying
Business process flows; data fields, predefined processes, and successive processes must
be considered for testing. Before functional testing is complete, additional tests are
identified and the effective value of current tests is determined.

5.8.4 System Test


System testing ensures that the entire integrated software system meets requirements. It
tests a configuration to ensure known and predictable results. An example of system
testing is the configuration-oriented system integration test. System testing is based on
process descriptions and flows, emphasising pre-driven process links and integration
points.
The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, sub-assemblies, assemblies and/or a finished product. It is
the process of exercising software with the intent of ensuring that the Software system
meets its requirements and user expectations and does not fail in an unacceptable manner.
There are various types of tests. Each test type addresses a specific testing requirement.
Unit tests perform basic tests at component level and test a specific business process,
application, and/or system configuration. Unit tests ensure that each unique path of a
business process performs accurately to the documented specifications and contains
clearly defined inputs and expected results
The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, sub-assemblies, assemblies and/or a finished product It is
the process of exercising software with the intent of ensuring that Software system meets
its requirements and user expectations and does not fail in an unacceptable manner.

43
5.8.5 White Box Testing
White Box Testing is a testing in which the software tester has knowledge of the inner
workings, structure and language of the software, or at least its purpose. It has a purpose.
It is used to test areas that cannot be reached from a black box level.

5.8.6 Black Box Testing


Black Box Testing is testing the software without any knowledge of the inner workings,
structure or language of the module being tested. Black box tests, as most other kinds of
tests, must be written from a definitive source document, such as specification or
requirements document, such as specification or requirements document. It is a testing in
which the software under test is treated as a black box .you cannot “see” into it. The test
provides inputs and responds to outputs without considering how the software works.

5.8.6.1 Test strategy and approach


1. Field testing will be performed manually and functional tests will be written in
detail.

5.8.6.2 Test objectives


1. All field entries must work properly.
2. Pages must be activated from the identified link.
3. The entry screen, messages and responses must not be delayed.

5.8.6.3 Features to be tested


1. Verify that the entries are of the correct format.
2. No duplicate entries should be allowed.
3. All links should take the user to the correct page.

5.8.7 Integration Testing:


Software integration testing is the incremental integration testing of two or more
integrated software components on a single platform to produce failures caused by
interface defects.

44
The task of the integration test is to check that components or software applications, e.g.
components in a software system or – one step up – software applications at the
company level – interact without error.

5.8.8 Test Results:


All the test cases mentioned above passed successfully. No defects encountered.

5.8.9 Acceptance Testing


User Acceptance Testing is a critical phase of any project and requires significant
participation by the end user. It also ensures that the system meets the functional
requirements.

45
Chapter 6 Results
6.1 Dataset
To implement this project we are using agriculture production dataset and then training
above 3 neural networks algorithms on that dataset and building neural network model,
we can apply new test data on that model to predict crop yield will be HIGH or LESS. In
test data we will have values of location, current year, and agriculture land area and then
neural model will predict production. To test neural model we are using below test
dataset.

Fig 10 DATASET

In above test data in last column there is no production values and neural network will
predict production will be high or less. In above dataset we have area name, crop name,
year and area size.

46
6.2 SCREENSHOTS OF PROJECT

● In above screen click on ‘Upload Agriculture Dataset’ button to upload dataset

In above screen selecting and uploading ‘dataset’ folder which contains agriculture and
rainfall dataset and then click on ‘Select Folder’ button to load dataset and to get below
screen

47
In above screen dataset loaded and above dataset contains missing values and string
values and neural network will not accept missing or string values so we need to
preprocess above dataset to replace missing and string values with numeric data. So click
on ‘Preprocess Dataset’ button to get below screen

In above screen all dataset converted to numeric values and now dataset is ready and now
click on ‘Run RNN Algorithm’ button to build RNN model on loaded dataset

48
In above screen RNN model generate with accuracy as 58% and now click on ‘Run
LSTM Algorithm’ button to build LSTM model

In above screen LSTM model generated with accuracy 78% and now click on ‘Run
FeedForward Neural Network’ button to build feed forward model

49
In above screen feed forward model generated with accuracy 62% and now click
‘Accuracy Comparison Graph’ button to get below graph

In above graph x-axis represents algorithm name and y-axis represents accuracy of those
algorithms and in all algorithms LSTM giving better prediction accuracy and now click

50
on ‘Predict Disease using Test Data’ button to upload test data and then neural network
will give below prediction result

In above screen selecting and uploading ‘testData.csv’ and then click on ‘Open’ button to
get below result

51
In above screen in square brackets we have test values from dataset which converted to
numeric format and after square bracket we can see prediction result as HIGH or LESS.
Based on given agriculture input neural network will give prediction result. Now click on
‘Top 6 Crop Yield Graph’ button to get below graph

In above graph x-axis represents state names and y-axis represents rainfall, rice, coconut,
sugarcane and various top6 crops in other states. First graph is for state vs rainfalls, state.

52
Chapter 7

7.1 FUTURE SCOPE

Discussing the future and scope of a project focused on crop yield prediction using
machine learning is crucial for understanding the potential evolution and impact of this
technology in agriculture. As you draft your project report, consider outlining the
opportunities for advancement and expansion, along with the broader impacts on
agriculture, economics, and society. Here are some key areas to highlight:

7.1.1 Advancements in Machine Learning Techniques

1. Computational Learning: As computing power increases and more sophisticated


algorithms are developed, computational learning could provide significant
improvements in modelling complex interactions within agricultural data.
2. Hybrid Models: Combining traditional agricultural models with machine learning
approaches could enhance the accuracy and relevance of predictions by
leveraging the strengths of both methodologies.
3. Reinforcement Learning: This could be used to not only predict yields but also to
optimise agricultural practices in real-time, adapting to changing conditions and
learning from new data.

7.2 Enhanced Data Collection and Integration

1. Remote Sensing Technology: Advances in satellite imagery, drones, and IoT


devices could improve data collection, providing real-time, high-resolution data
on crop health, soil conditions, and environmental factors.
2. Big Data: Leveraging big data technologies to integrate diverse data sources,
including weather patterns, market demands, and genetic information on crops,
can lead to more robust predictive models.

53
7.3 Broader Application Scope

1. Diverse Geographic and Crop Types: Expanding the application of machine


learning models to a wider range of geographic areas and different types of crops,
including those less commonly studied, can help improve food security globally.
2. Precision Agriculture: Machine learning can play a crucial role in precision
agriculture, enabling farmers to apply the exact amount of resources needed (like
water, nutrients, and pesticides), thus optimizing input usage and minimizing
environmental impact.

7.4 Addressing Global Challenges

1. Climate Change: Machine learning models can help predict and mitigate the
impacts of climate change on agriculture by modeling complex scenarios
involving weather extremes and crop adaptability.
2. Food Security: Improved yield predictions can directly contribute to better food
supply planning and management, crucial for addressing food security issues,
especially in vulnerable regions.

7.5 Economic Impact and Commercial Viability

1. Cost Reduction: As technology advances, the cost of relevant technologies (e.g.,


sensors, AI computation) is likely to decrease, making these innovations more
accessible to a broader range of farmers, including smallholders and those in
developing countries.
2. New Markets and Business Models: Machine learning in agriculture could lead to
new business models, such as yield-as-a-service, where companies offer yield
predictions as a service to farmers, or data-driven agricultural consulting.

7.6 Societal and Ethical Implications

1. Inclusivity: Ensuring that the benefits of machine learning in agriculture are


accessible to all farmers, including those in low-income countries, is crucial.

54
2. Data Privacy and Security: Developing secure systems to protect farmers' data
and ensuring that the use of such technologies adheres to ethical guidelines is
essential.

7.7 Regulatory and Policy Development

1. Standards and Guidelines: Establishing international standards and guidelines for


the use of AI in agriculture to ensure safety, reliability, and fairness.
2. Supportive Policies: Encouraging policies that support research and deployment
of AI technologies in agriculture, including subsidies, grants, and educational
programs to train farmers and agronomists in high-tech agricultural techniques.

55
REFERENCES
[1] “data.gov.in.” [Online]. Available: https://data.gov.in/
[2] Ananthara, M. G., Arunkumar, T., &Hemavathy, R. (2013,
February).CRY—an improved crop yield prediction model using bee hive clustering
approach for agricultural data sets. In 2013 International Conference on Pattern
Recognition, Informatics and Mobile Engineering (pp. 473-478).IEEE.
[3] Awan, A. M., & Sap, M. &. M. (2006, April). An intelligent system based on
kernel methods for crop yield prediction. In Pacific-Asia Conference on Knowledge
Discovery and Data Mining (pp. 841-846).Springer, Berlin, Heidelberg.
[4] Bang, S., Bishnoi, R., Chauhan, A. S., Dixit, A. K., &Chawla, I.
(2019,August). Fuzzy Logic based Crop Yield Prediction using Temperature and
Rainfall parameters predicted through ARMA, SARIMA, and ARMAX models. In
2019 Twelfth International Conference on Contemporary Computing (IC3) (pp. 1-6).
IEEE.
[5] Bhosale, S. V., Thombare, R. A., Dhemey, P. G., &Chaudhari, A. N.(2018,
August). Crop Yield Prediction Using Data Analytics and Hybrid Approach. In 2018
Fourth International Conference on Computing Communication Control and
Automation (ICCUBEA) (pp. 1-5).IEEE.
[6] Gandge, Y. (2017, December). A study on various data mining techniques for
crop yield prediction. In 2017 International Conference on Electrical, Electronics,
Communication, Computer, and Optimization Techniques (ICEECCOT) (pp.
420-423).IEEE.
[7] Gandhi, N., Petkar, O., & Armstron0\g, L. J. (20 16, July). Rice crop yield
prediction using artificial neural networks. In 2016 IEEE Technological Innovations
in ICT for Agriculture and Rural Development (TIAR) (pp.105-110).IEEE.
[8] Gandhi, N., Armstrong, L. J., Petkar, O., & Tripathy, A. K. (2016, July).Rice crop
yield prediction in India using support vector machines.In2016 13th International
Joint Conference on Computer Science and Software Engineering (JCSSE) (pp.
1-5).IEEE.
[9] Gandhi, N., Armstrong, L. J., &Petkar, O. (2016, July). Proposeddecision
support system (DSS) for Indian rice crop yield prediction.In2016 IEEE

56
Technological Innovations in ICT for Agriculture and RuralDevelopment (TIAR) (pp.
13-18).IEEE.
[10] Islam, T., Chisty, T. A., &Chakrabarty, A. (2018, December). A DeepNeural
Network Approach for Crop Selection and Yield Prediction inBangladesh. In 2018
IEEE Region 10 Humanitarian TechnologyConference (R10-HTC) (pp. 1-6). IEEE.
[11] Jaikla, R., Auephanwiriyakul, S., &Jintrawet, A. (2008, May). Riceyield
prediction using a support vector regression method. In 2008 5thInternational
Conference on Electrical Engineering/Electronics,Computer, Telecommunications and
Information Technology (Vol. 1,pp. 29-32). IEEE.
[12] Kadir, M. K. A., Ayob, M. Z., &Miniappan, N. (2014, August). Wheatyield
prediction: Artificial neural network based approach. In 2014 4thInternational
Conference on Engineering Technology andTechnopreneuship (ICE2T) (pp. 161-165).
IEEE.
[13] Manjula, A., &Narsimha, G. (2015, January). XCYPF: A flexible
andextensible framework for agricultural Crop Yield Prediction. In 2015IEEE 9th
International Conference on Intelligent Systems and Control(ISCO) (pp. 1-5). IEEE.
[14] Mariappan, A. K., & Das, J. A. B. (2017, April). A paradigm for riceyield
prediction in Tamilnadu. In 2017 IEEE Technological Innovationsin ICT for
Agriculture and Rural Development (TIAR) (pp. 18-21).IEEE.
[15] Paul, M., Vishwakarma, S. K., &Verma, A. (2015, December).Analysis of soil
behaviour and prediction of crop yield using datamining approach. In 2015
International Conference on ComputationalIntelligence and Communication
Networks (CICN) (pp. 766-771).IEEE.
[16] Shah, A., Dubey, A., Hemnani, V., Gala, D., &Kalbande, D. R. (2018).Smart
Farming System: Crop Yield Prediction Using RegressionTechniques. In Proceedings
of International Conference on WirelessCommunication (pp. 49-56).Springer,
Singapore.
[17] Ahamed, A. M. S., Mahmood, N. T., Hossain, N., Kabir, M. T., Das,
K.,Rahman, F., &Rahman, R. M. (2015, June). Applying data miningtechniques to
predict annual yield of major crops and recommendplanting different crops in
different districts in Bangladesh. In 2015IEEE/ACIS 16th International Conference on

57
Software Engineering,Artificial Intelligence, Networking and Parallel/Distributed
Computing(SNPD) (pp. 1-6). IEEE.
[18] Shastry, A., Sanjay, H. A., &Hegde, M. (2015, June). A parameterbased
ANFIS model for crop yield prediction. In 2015 IEEEInternational Advance
Computing Conference (IACC) (pp. 253-257).IEEE.
[19] Sujatha, R., &Isakki, P. (2016, January). A study on crop yieldforecasting
using classification techniques.In 2016 InternationalConference on Computing
Technologies and Intelligent DataEngineering (ICCTIDE'16) (pp. 1-4).IEEE.
[20] Suresh, A., Kumar, P. G., &Ramalatha, M. (2018, October). Predictionof
major crop yields of Tamilnadu using K-means and Modified KNN.In 2018 3rd
International Conference on Communication andElectronics Syst ems (ICCES) (pp.
88-93).IEEE.
[21] Veenadhari, S., Misra, B., & Singh, C. D. (2014, January). Machinelearning
approach for forecasting crop yield based on climaticparameters. In 2014 International
Conference on ComputerCommunication and Informatics (pp. 1-5).IEEE.

58

You might also like