0% found this document useful (0 votes)
39 views34 pages

MajorProject Report

Uploaded by

vchaudhari20comp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views34 pages

MajorProject Report

Uploaded by

vchaudhari20comp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

A PROJECT REPORT

On

Farmic.ai: Farmers’s Assistant System


Submitted in partial fulfillment of the requirement of

University of Mumbai for the Degree of

Bachelor of Technology
In

Computer Engineering
Submitted By

Bhavesh Chaudhari
Vrushali Chaudhari
Yusuf Ansari
Yash Kamble
Supervisor

Dr. Nitish Kumar Agarwal

Department Of Computer Engineering


PILLAI COLLEGE OF ENGINEERING(AUTONOMOUS)
New Panvel – 410 206
UNIVERSITY OF MUMBAI
Academic Year 2023– 24
DEPARTMENT OF COMPUTER ENGINEERING

Pillai College of Engineering

New Panvel – 410 206

CERTIFICATE
This is to certify that the requirements for the project report entitled ‘Farmic.ai: Farmer’s
Assistant System’ have been successfully completed by the following students:

Name Roll No.

Bhavesh Chaudhari A742


Vrushali Chaudhari A743
Yusuf Ansari A739
Yash Kamble A804

In partial fulfilment of Bachelor of Technology of Mumbai University in the Department of


Computer Engineering, Pillai College of Engineering, New Panvel – 410 206 during the
Academic Year 2023 – 2024.

Supervisor
(Dr.Nitish Kumar Agarwal)

Head, Department of Computer Engineering Principal


(Dr. Sharvari Govilkar) (Dr. Sandeep M. Joshi)
DEPARTMENT OF COMPUTER ENGINEERING

Pillai College of Engineering

New Panvel – 410 206

PROJECT APPROVAL FOR B.Tech

This project entitled ‘Farmic.ai: Farmer’s Assistant System’ by Bhavesh Chaudhari, Vrushali
Chaudhari, Yusuf Ansari, and Yash Kamble are approved for the degree of Bachelor of
Technology in Computer Engineering.

Examiners:

1.

2.

Supervisors:

1.

2.

Chairman:

1.

Date:

Place:
DEPARTMENT OF COMPUTER ENGINEERING

Pillai College of Engineering

New Panvel – 410 206

DECLARATION

We declare that this written submission for the B.Tech project entitled ‘Farmic.ai: Farmers’s
Assistant System’ represents our ideas in our own words and where others' ideas or words have
been included, we have adequately cited and referenced the original sources. We also declare
that we have adhered to all principles of academic honesty and integrity and have not
misrepresented or fabricated or falsified any ideas/data/facts/sources in our submission. We
understand that any violation of the above will cause disciplinary action by the institute and also
evoke penal action from the sources which have not been properly cited or from whom prior
permission has not been taken when needed.

Project Group Members:

Bhavesh Chaudhari:

Vrushali Chaudhari:

Yusuf Ansari:

Yash Kamble:

Date:

Place:
Table of Contents

Abstract................................................................................................................................ i

List of Figures...................................................................................................................... ii

List of Tables....................................................................................................................... iii

1. Introduction............................................................................................................... 1

1.1 Fundamentals................................................................................................. 1

1.2 Objectives...................................................................................................... 2

1.3 Scope.............................................................................................................. 2

1.4 Organization of the Project Report…............................................................ 3

2. Literature Survey....................................................................................................... 4

2.1 Introduction…….……………………........................................................... 4

2.2 Literature Review.................................................................................................4

2.2.1 Limitation of Existing System 6

2.3 Summary of Literature Survey.………………………….............................. 7

3. Implemented System ............ 9

3.1 Overview……………….......................................................................... 9

3.1.1 Proposed System Architecture ……………………………. 9

3.2 Implementation Details….....................................................................................13

3.2.1 Use Case Diagram………...... 15

3.2.2 Hardware and Software Specifications…....................... 16

4 Result and Discussion…...................................................................................................17

4.1 Dataset.......................................................................................... 17

4.2 Output Screenshots…………………………………………………….. 18


4.3 Evaluation Parameters..........................................................................................20

4.4 Performance Evaluation........................................................................................21

5. Conclusion and Future Scope….......................................................................................22

5.1 Conclusion…........................................................................................................22

5.2 FutureScope..........................................................................................................22

References............................................................................................................................ iv

Acknowledgement…..................................................................................................................v
Abstract

One of the major challenges in agriculture is ensuring optimal crop yield while minimizing
environmental impact. Farmers are not educated about the welfare of the agriculture industry
and what kind of benefits they can avail from the government-provided venture for them and
need to balance their production needs with the need for sustainable practices that give them
optimal profits. To address this challenge, we are proposing a mobile application system that
can provide farmers with customized recommendations for crop selection, pest and disease
management, profit prediction and awareness about the various schemes beneficial for them
through various technologies. By considering climate conditions, , and other factors, this system
can help farmers maximize their yields while minimizing negative environmental impacts. The
proposed system is designed to assist small-scale farmers in making informed decisions about
crop selection, disease prevention, and crop management. Through an agriculture based chatbot
farmers are made aware about the particular scheme that is best suited for them to avail the
benefits of . In addition to crop recommendations, the system also features disease prediction
and cure suggestions to help farmers detect and respond to diseases in a timely manner. The
fertilizer recommendation feature ensures that crops receive the necessary nutrients for optimal
growth, while the revenue prediction feature provides critical information for planning and
decision-making. Overall, the proposed system offers a unique and comprehensive set of
features that leverage the power of technology to improve the livelihoods of small-scale farmers
and contribute to the sustainable development of agriculture.

i
List of Figures

Fig 3.1 Proposed Architecture 11

Fig 3.2 Chat-Bot Architecture 11

Fig 3.3 Chat with document architecture 12

Fig 3.4 Prediction of crop name and cost 13

Fig 3.5 Use-case diagram 15

Fig 4.1 Sign in 18

Fig 4.2 Sign up 18

Fig 4.3 Language selection 18

Fig 4.4 Get started CTA button 18

Fig 4.5 My farm 19

Fig 4.6 Waste 2 wealth 19

Fig 4.7 SchemeSpec-AI 19

Fig 4.8 Ai chat 19

ii
List of Tables

Table 2.1 Literature Summary 8

Table 3.1 Hardware Details 17

Table 3.2 Software details 17

Table 4.1 Dataset 17

Table 4.2 Evaluation matrix scores of model 22

iii
Chapter 1
Introduction
1.1 Fundamentals

Providing farmers with a comprehensive platform for predicting crop diseases, forecasting crop
profits, recommending suitable crops based on environmental conditions, and suggesting
relevant agricultural schemes with the assistance of a chatbot is a significant step towards
empowering the agricultural community.
Fundamentals used for the applications are:

1. Data Integration and Reliability: A reliable app for farmers must integrate with trusted
data sources, including real-time weather data providers, comprehensive crop databases,
and government agricultural scheme information. The accuracy and timeliness of this
data are crucial for delivering reliable predictions and recommendations.
2. User-Centric Design: User-friendliness is paramount, given that many farmers may have
varying levels of technological proficiency. The app's interface should be intuitive and
accessible, catering to a diverse user base.
3. Data Processing and Analysis: The core of the app involves data processing and
analysis. It should employ machine learning and statistical models to clean, structure,
and extract meaningful insights from the collected data. These insights drive the app's
predictive capabilities.
4. Predictive Models: The app should feature several predictive models, including crop
disease prediction, crop profit forecasting, and crop recommendations. These models
must take into account factors like humidity, pH levels, rainfall, and temperature to
provide relevant and timely information to farmers.
5. Chatbot Integration: A crucial component is the chatbot, which assists users with their
inquiries and helps them navigate the app. The chatbot should be trained to understand
natural language and deliver relevant information, recommendations, and support for
crop-related queries, disease concerns, and scheme applications. Providing support for
local languages and dialects using Natural Language Programming (NLP)is essential to

1
accommodate users who may not be proficient in the app's primary language. This
promotes inclusivity and broadens the user base.
6. Real-Time Updates: To empower farmers with the latest information, the app should
provide real-time weather and market data updates. This ensures that users can make
informed decisions based on the most current conditions.

1.2 Objectives

The objective of this work is as follows:

1. Predict crop disease, crop profit forecasting, and crop recommendations by taking into
account factors like humidity, pH levels, rainfall, and temperature to provide relevant
and timely information to farmers.
2. To effectively inform and empower farmers about the government schemes that are best
suited to their individual needs and circumstances in the regional language
3. Provide farmers with timely alerts regarding fertilization, weather, and irrigation.
4. To provide a 24/7 accessible platform for farmers, offering them a dedicated resource to
promptly address any and all agricultural queries and concerns.

1.3 Scope

The scope of this project is to provide a comprehensive platform that can assist farmers in
making informed decisions about their crops. The platform will offer crop recommendations,
disease predictions, fertilizer recommendations, revenue predictions, and precaution, and cure
suggestions based on the details of the farmer's land. The platform will make use of advanced
techniques such as digital image processing and deep learning to analyze images of crops and to
identify diseases, determine soil and make personalized crop recommendations. The system
will also take images of the crops through a drone for quick detection and show the infected
areas if detected. The platform will be developed as a web application that can be accessed from
any device with an internet connection, such as a smartphone, tablet, or computer. The user
interface will be designed to be user-friendly and easy to navigate, allowing farmers to quickly
access the information they need. The primary users of the platform will be farmers who are
looking to maximize their crop yields while minimizing the risk of disease and other
crop-related problems. The platform will also be useful for agricultural researchers and
professionals who are looking to gather data on crops and their diseases. The scope of the
2
project also includes the development of a large dataset of images of healthy and infected
plants, along with soil images, to train the deep learning model. The dataset will be collected
from various sources, including agricultural research institutions and local farms. Overall, the
scope of this project is to provide a comprehensive and accessible platform that can help
farmers make informed decisions about their crops, improve their crop yields, and minimize the
risk of disease and other crop-related problems.

1.4 Organization of the Report

The organization of the report is written in not more than 10 lines. The report is organized as
follows: The introduction is given in Chapter 1.It describes the fundamental terms used in this
project. It motivates to study and understand the different techniques used in this work. This
chapter also presents the outline of the objective of the report. The Chapter 2 describes the
review of the relevant various techniques in the literature systems. It describes the pros and cons
of each technique. The Chapter 3 presents the Theory and proposed work. It describes the major
approaches used in this work. The societal and technical applications are mentioned in Chapter
4. The summary of the report is presented in Chapter 5.

3
Chapter 2
Literature
2.1 Introduction Survey

The agricultural sector stands on the cusp of a transformative era, where technology, data-driven
insights, and intelligent applications are set to redefine the way farmers approach crop
management and decision-making. At the forefront of this agricultural revolution stands Farmic,
an innovative app that offers farmers a comprehensive platform. Farmic's multifaceted capabilities
include predicting crop diseases, estimating crop profits, offering crop recommendations tailored
to environmental variables, and recommending customized agricultural schemes, all powered by
an intelligent chatbot. The development and potential of Farmic align closely with an extensive
body of literature that underscores the critical role of technology, data-driven solutions, and
personalized assistance in contemporary agriculture.In this landscape, Farmic's holistic approach
to agriculture gains validation from an extensive body of literature that underscores the
transformative potential of technology, data-driven insights, and personalized assistance in modern
farming practices. The synergy between Farmic's objectives and the research findings positions the
app as a catalyst for positive change in the agricultural sector.

2.2 Literature review

A literature review is an objective, critical summary of published research literature relevant to a


topic under consideration for research. The summary is presented here. 2.1.1. Literature review of
research papers published in the year 2020

The paper A Machine Learning Approach for Crop Yield Prediction in Precision Agriculture by
Naimul Mefraz Khan and Hossain Mohammad Shahadat [1] proposes a machine-learning approach
for crop yield prediction in precision agriculture. The authors use data from multiple sources,
including satellite images, weather data, and soil properties, to develop a model for predicting crop
yield. They use a variety of machine learning algorithms, such as support vector machines and
random forests, to analyze the data and predict crop yield. The authors compare the performance of
different machine learning algorithms and demonstrate that their approach outperforms traditional
statistical methods. Similarly, the paper A Comprehensive Review of Machine Learning Techniques
4
for Crop Yield Prediction in Precision Agriculture by Rajitha Battula et al. [2] provides a
comprehensive review of machine learning techniques for crop yield prediction in precision
agriculture. The authors examine different machine learning algorithms, such as artificial neural
networks, support vector machines, and decision trees, and evaluate their effectiveness in predicting
crop yield. They also explore different types of data sources used for crop yield prediction, such as
soil properties, weather data, and remote sensing data, and discuss the importance of feature selection
and data preprocessing. The authors conclude by identifying research gaps and suggesting future
research directions. 2.1.2. Literature review of research papers published in the year 2019

The paper Agricultural Crop Recommendation System Based on Data Mining Techniques: A Review
by Rajeshwar Dass, Rakesh Kumar, and Kamal Kumar Sharma [1] provides an overview of
agricultural crop recommendation systems based on data mining techniques. The authors explore
different data mining algorithms used for crop recommendation, such as decision trees, association
rule mining, and k-nearest neighbors, and assess their effectiveness in crop recommendation. The
authors also discuss different factors that affect crop recommendation, such as soil characteristics,
weather, and pest and disease management, and examine their relevance in developing accurate and
reliable crop recommendation systems. The second paper A Review of Crop Yield Prediction and
Recommendation Models for Precision Agriculture by Dong Wang et al. [2] in 2019 is a review of
crop yield prediction and recommendation models for precision agriculture, building on their earlier
review paper in 2017. The authors cover different machine learning algorithms used for crop yield
prediction and recommendation, such as artificial neural networks, support vector machines, and
decision trees, and assess their relative strengths and weaknesses. The authors also examine different
factors that influence crop yield, such as soil properties, weather conditions, and crop management
practices, and discuss their relevance in crop yield prediction and recommendation. The paper
concludes by identifying research gaps and suggesting future research directions. 2.1.3. Literature
review of research papers published in the year 2018

The paper A Framework for Providing Agricultural Metadata to Smallholder Farmers Using Machine
Learning by Thomas M. Njeru et al. [1] proposes a framework for providing agricultural metadata to
smallholder farmers using machine learning. The authors use data from multiple sources, such as
weather data and soil properties, to develop a model for predicting crop growth and yield. They also
developed a mobile application that enables farmers to collect and upload data about their crops and
soil, which is then used to improve the accuracy of the model. The authors demonstrate that their

5
approach can provide useful information to smallholder farmers and improve their productivity.
Similarly, the paper A Mobile Application for Soil Data Collection and Analysis in Precision
Agriculture by Yucheng Zhang et al. [2] describes a mobile application for soil data collection and
analysis in precision agriculture. The authors developed a mobile application that allows farmers to
collect soil data, such as pH and nutrient content, using their smartphones or tablets. The data is then
analyzed using machine learning algorithms to provide recommendations for fertilizer application
and other management practices. The authors demonstrate that their approach can improve the
accuracy and efficiency of soil data collection and analysis, and provide useful information to
farmers for decision making. In summary, the papers published in 2018 highlight the potential of
machine learning and mobile applications for providing agricultural metadata to farmers.

2.2.1 Limitation of Existing System

Based on the literature review, it can be seen that there have been several research works that have
focused on providing crop recommendations, disease prediction, and soil analysis to farmers.
However, most of these systems have certain limitations or research gaps that need to be addressed.
One of the major limitations of existing systems is that they do not take into account the specific
needs and constraints of individual farmers. For instance, some farmers may have limited access to
resources like water, fertilizer, and machinery, which can significantly impact their crop yields.
Therefore, it is essential to develop personalized systems that consider the unique characteristics and
requirements of each farmer. Another limitation of existing systems is their reliance on manual data
collection and analysis, which can be time-consuming and error-prone. Therefore, there is a need to
develop automated systems that can collect and analyze data in real time, allowing farmers to make
informed decisions quickly. Furthermore, most of the existing systems do not consider the economic
viability of crop recommendations. While some crops may be suitable for a particular soil type or
climate, they may not be economically viable for farmers in terms of the expected yield and market
demand. Therefore, it is essential to integrate revenue prediction models into these systems to
provide farmers with accurate information about the potential profitability of different crops. In
summary, while existing systems have made significant strides in providing farmers with relevant
information about crop recommendations, soil analysis, and disease prediction, there is still a need to
address the limitations and research gaps mentioned above to develop more effective and
personalized systems.

6
2.3 Literature Summary

It focused on how images from given dataset (trained dataset) in the field and past data set used
predict the pattern of plant diseases using CNN model. This brings some of the following insights
about plant leaf disease prediction. As maximum types of plant leaves will be covered under this
system, farmer may get to know about the leaf which may never have been cultivated and lists out
all possible plant leaves, it helps the farmer in decision making of which crop to cultivate. Also,
this system takes into consideration the past production of data which will help the farmer get
insight into the demand and the cost of various plants in the market. Artificial Intelligence
continuously helps humans to solve diverse problems in various aspects of life. Machine Learning
models provide an ideal way to analyze large data sets and help in introspecting the relations
between various factors and their influence on each other. Hence it can be used for forecasting and
predictions based on conditions. In this paper, authors had reviewed the literature based on Soil
fertility prediction and Crop recommendation. The study discussed the objective of the research,
different set of parameters, ML or DL algorithm used in this context and the appropriate algorithm
or the techniques outperformed. Deep Neural Network, Extreme Learning Machine (ELM) are
outperformed in the context of fertility prediction and also in suitability of the crop. Ensemble
methods may perform better than simpler approaches.

Sr.no Paper Advantages and Disadvantages

1. Advantages: Learning to detect infected areas is made easy.Quality


Khan, N.M. and improves over time.
Disadvantages: problem in identifying diseases having similar
Shahadat, H.M., texture.
2021

2. Advantages: Shows different approaches of machine learning to


Battula, R., Arora, identify the disease.
R., Khanna, A., Disadvantages: Not very efficient in terms of performance.
Sharma, A. and Sin-
gal, K., 2021

7
3. Advantages: Learning to detect disease in plant and fertility of soil
Dass, R., Kumar, R.,
using image processing.
and Sharma, K.K., Disadvantages:
2018.

4. Wang, D., Chen, Advantages: It solves the problem of finding different soil
Y., Wang, X., composition
Zhang, Y., Guo,
Y., and Chen, X., Disadvantage: It does not consider the soil classification features
2021 which would give better results and solve the problem.

5. Advantage: It solves the problem of conversation with users in


Zhen, X., Wang, Z.,
regional terminologies
Islam, A., Chan, I., Disadvantages: Uncertainty, limited scope of information and lack
Li, 2014 of data set

6. Advantage: Early Disease Detection: Digital image processing


Barbedo, J. G. A
techniques can detect plant diseases at an early stage, often
(2013)
before visible symptoms are apparent to the human eye.
Disadvantage: Implementing digital image processing
techniques for plant disease detection and classification can be
complex and resource-intensive

Table 2.1 Summary of literature survey

8
Chapter 3

Farmers Assistant
3.1 Overview

The project, "Farmer's Assistant," integrates multiple components to provide comprehensive


support to farmers. It includes a closed-domain multilingual language model with an extensive
agricultural knowledge base. The system encompasses a "Chat with Schemes" feature that
assists farmers in selecting the most suitable agricultural schemes based on their needs, location,
crop type, and farm size, presenting detailed scheme information. Furthermore, a sophisticated
agricultural chatbot simplifies interaction with farmers through text, voice, and image inputs,
leveraging speech recognition and advanced NLP for accurate query interpretation. The chatbot
offers features such as pest and disease identification, yield improvement advice, and financial
planning support. The project also implements a "Crop Prediction with Production Cost"
system, utilizing real-time environmental data, including humidity, temperature, pH, and
rainfall, to recommend suitable crops and estimate production costs, aiding farmers in making
informed cultivation decisions.

3.1.1 Proposed System Architecture

Fig 3.1 Proposed Architecture

An application which includes features such closed domain multilingual language model having
knowledge base about agriculture, Chat with schemes documents, Crop prediction and
prediction of production cost.

9
A. Agriculture Chatbot

Fig 3.2 Chatbot Architecture

It is a sophisticated agricultural chatbot system that streamlines the interaction between farmers
and expert agricultural knowledge. Farmers can easily communicate with the chatbot through
text, voice, or images, ensuring accessibility for a diverse user base. The system employs speech
recognition for voice inputs and advanced natural language processing (NLP) to understand and
interpret user queries accurately. Additionally, it can process images, such as those of crops and
pests, to better comprehend and address agricultural issues.

It retrieves relevant information and recommendations from its extensive database and generates
personalized, actionable responses using the powerful Llama 2 language model. Users can
benefit from a wide range of features, including pest and disease identification, yield
improvement guidance, access to agricultural news, and support for financial planning. The
chatbot not only empowers farmers with expert advice but also engages in dynamic
conversations, offering iterative support and refining recommendations as needed.

User interactions are analyzed to continually enhance the chatbot's performance and ensure it
remains a valuable tool for farmers.

10
B. Chat with Document

Fig 3.3 Chat with Document Architecture

A chat with a document system for farmers that is designed to suggest the best suitable scheme
according to their needs. The system works in the following steps:

1. The farmer initiates a chat with the system and provides information about their needs,
such as their location, crop type, and farm size.
2. The system uses topic extraction to identify the relevant schemes from its database of
documents.

3. The system then presents the farmer with a list of the most relevant schemes, along with a
brief description of each scheme.
4. The farmer can then select a scheme to learn more about.
5. The system provides the farmer with detailed information about the selected scheme,
including its benefits, eligibility criteria, and application process.

11
C. Prediction Models

Fig 3.4 Prediction of crop name and cost Architecture

The architecture is designed to predict crop names and estimate crop production costs using data
from APIs. The architecture begins with an API that collects environmental data, including
Humidity, Temperature, pH, and Rainfall. This environmental data is processed to recommend a
suitable crop. This could be based on the specific requirements of different crops for these
environmental factors. The recommended crop information is then passed to the user. This could
be used to inform decisions about what crops to plant in a given area or season. It also predicts
the production cost for the recommended crop. This could take into account factors like the cost
of seeds, fertilizers, labor, and other resources needed for cultivation. It aims to use real-time
environmental data to make informed decisions about crop cultivation, potentially optimizing
yield and cost-effectiveness.

12
3.2 Implementation details

The implementation details is given in this sections

A. Llama 2

Llama 2 is a collection of pretrained and fine-tuned generative text models ranging in scale
from 7 billion to 70 billion parameters.Meta developed and publicly released the Llama 2
family of large language models (LLMs), a collection of pretrained and fine-tuned
generative text models ranging in scale from 7 billion to 70 billion parameters. Our
fine-tuned LLMs, called Llama-2-Chat, are optimized for dialogue use cases. Llama-2-Chat
models outperform open-source chat models on most benchmarks we tested, and in our
human evaluations for helpfulness and safety, are on par with some popular closed-source
models like ChatGPT and PaLM.

B. Llama 2 Finetuning

Quantization is a technique used to compress large language models (LLMs) by reducing


the number of bits used to represent the model's parameters. Fine-tuning a quantized LLM
can be done using various methods, including QLoRA, DFQF, and QA-LoRA. Here are the
steps to fine-tune a quantized LLM using QLoRA:
1. Download the quantized LLM and the dataset you want to fine-tune it on.
2. Preprocess the dataset using the provided preprocessing script.
3. Compile the quantized LLM.
4. Launch the training job using the provided QLoRA script that is already optimized
with the best configuration and hyperparameters for LLMs.
5. Monitor the training progress using TensorBoard.
QLoRA is an efficient fine-tuning approach that reduces memory usage enough to fine-
tune a 65B parameter model on a single 48GB GPU while preserving full 16-bit fine-tuning
task performance introduces a number of innovations to save memory without sacrificing
performance, including 4-bit NormalFloat (NF4), double quantization, and paged
optimizers
DFQF is another fine-tuning approach that minimizes the quantization error of the network
weights to reduce the accuracy drop in lower than 6-bit quantization
QA-LoRA is a new approach that proposes quantization-aware LoRA (QA-LoRA)

13
fine-tuning to reduce the memory cost and speed-up fine-tuning QA-LoRA fine-tuning
involves permuting the model's parameters, quantizing them, and fine-tuning the model
using LoRA
In summary, fine-tuning a quantized LLM can be done using various methods, including
QLoRA, DFQF, and QA-LoRA. These methods involve preprocessing the dataset,
compiling the quantized LLM, launching the training job, and monitoring the training
progress.

C. Random Forest Regressor

A Random Forest Regressor is a tool that helps predict numbers. It's like having a group of
experts (decision trees) who each give their opinion, and then we take an average of their
opinions to make a more accurate prediction. This method is used in various applications to
make better guesses about numerical values, like predicting sales, temperatures, or any
other numeric outcome.

D. Chat with Documents using Llama Index

Chatting with documents using the Llama Index involves building powerful applications
based on large language models. These applications include document Q&A,
data-augmented chatbox, and knowledge agents. Llama Index provides a simple and
flexible data framework for connecting custom data sources to large language models. To
implement chat with your document system using Llama Index, you can use just four lines
of code. Fine-tuning Llama 2 can also enhance its proficiency in specific tasks such as
Python coding. Fine-tuning involves customizing the large language model to better suit a
specific use case. It can be done using a custom dataset and techniques such as supervised
fine-tuning and quantized low-rank adaptation. The resulting model can perform
significantly better for the specific use case.

14
3.2.2 Use Case Diagram

Fig 3.5 Usecase Diagram

The farmers will be authenticated and logged-in in our app, then farmers can use our AgriGPT
model for chatting with our intelligent conversational agriculture model, which lets user chat about
general knowledge related to agriculture and farming and detects whether a leaf of a crop is
healthy or diseased, if diseased, then mentions the disease name. The SchemeGPT model lets
farmers upload a PDF related to a particular farmer scheme, and lets farmers converse based on the
PDF uploaded related to that respected scheme. The Crop and Price Predictor model predicts
which crop will be best suitable as per the farmer's current location and climatic conditions. After
predicting the suitable crop, it also predicts the profit which farmers can get after growing the crop.
Farmers will get alerts for when to apply fertilizers on crops which requires attention.

15
3.2.3 Hardware and specification:

The experimental configuration is implemented on a computer system with distinct hardware and
software specifications, which are detailed in Table 3.2 and Table 3.3, respectively. Specific
hardware prerequisites are essential for both training the model and performing inference. We have
provided the hardware specifications specifically for conducting 16-bit inference with the model.

Processor 4 GHz Intel

HDD 280 GB

GPU 16GB Tesla T4/ 24 GB

RAM 16 GB

Table 3.1 Hardware details

Operating System Windows 11

Programming Language Python 3.9

Database Firebase

Tech stack React Native, Flask

Table 3.2 Software details

16
Chapter 4

Result and Discussion


4.1 Standard Datasets Used

Dataset Descriptions Labels Size

Crop Created by augmenting datasets of N, P, K, temperature, 65 KB


Recommendation rainfall, climate, and fertilizer data humidity, pH, rainfall
Dataset- available for India for predicting
Kaggle suitable crops.

Fertilizer Information to For predicting fertilizers Temperature, Humidity, Moisture, 1 KB


Prediction - Soil Type, Crop Type, Nitrogen,
Kaggle Potassium, Phosphorous, Fertilizer
Name

KCC To solve general queries of farmers User, Assistant 17 KB

PlantifyDr Image dataset which consists of plants Apple, Bell pepper, Cherry, Citrus, 3 GB
Dataset categorized into healthy and infected Corn, Grape, Peach, Potato,
with each plant having 4-5 diseases Strawberry, Tomato
categorized
Table 4.1 Dataset

In table 4.1, it consists of all the data related to agriculture used for training of models.

17
4.2 Output Screenshots

Fig 4.1 Sign in Fig 4.2 Sign Up

Fig 4.3 Language Selection Fig4.4Getstarted CTA button

18
Fig 4.5 Myfarm Fig 4.6 Waste 2 Wealth

Fig 4.7 SchemeSpec-AI Fig 4.8 AI Chat

19
4.3 Evaluation Metrics

4.3.1 Confusion Matrix:

A confusion matrix is a table used to evaluate the performance of a classification model. It


compares the actual outcomes (true labels) of a classification problem to the predicted outcomes
made by the model. It is particularly useful for assessing the model's ability to distinguish
between different classes or categories. In a binary classification problem, the confusion matrix
typically consists of four values:
True Positives (TP): The number of correctly predicted positive instances.
True Negatives (TN): The number of correctly predicted negative instances.
False Positives (FP): The number of negative instances incorrectly predicted as positive (Type I
error).
False Negatives (FN): The number of positive instances incorrectly predicted as negative (Type
II error).

4.3.2 Mean Squared Error (MSE):

MSE is a common metric used to evaluate the performance of regression models. It measures
the average of the squared differences between the predicted values and the actual values in a
dataset. It is a measure of the model's ability to estimate numerical outcomes. The formula for
MSE is as follows:
MSE = (1/n) * Σ(yi - ŷi)^2, where "n" is the number of data points, "yi" is the actual value, and
"ŷi" is the predicted value for data point "i."

4.3.3 Accuracy:

Accuracy is a metric commonly used in classification tasks to assess the proportion of correct
predictions made by a model. It calculates the ratio of correct predictions (true positives and
true negatives) to the total number of predictions made. It is expressed as a percentage and is
defined as follows:
Accuracy = (TP + TN) / (TP + TN + FP + FN).

20
4.3.4 BLEU Score:

BLEU (Bilingual Evaluation Understudy) is a metric used to evaluate the quality of


machine-generated text, particularly in machine translation and text generation tasks. It
measures how well the generated text matches reference translations or human-written text.
BLEU score is based on the comparison of n-grams (sequences of words) between the generated
text and reference translations. It is often used to assess the fluency and correctness of
translations. Higher BLEU scores indicate better quality.
BLEU score involves precision and brevity penalties, and the formula may vary slightly
depending on the specific implementation. The basic idea is to calculate the precision of
n-grams in the generated text compared to those in the reference texts.
These metrics are valuable tools for evaluating the performance of machine learning models in
different types of tasks, whether it's classification, regression, or natural language processing.
They provide insights into how well a model is performing and where it may need
improvements.

4.4 Performance Evaluation

The table provides a concise summary of the performance evaluation results for various
components within the project, "Farmer's Assistant." It showcases the effectiveness of each
model or system in different agricultural tasks, with corresponding metrics and scores, allowing
for a quick and clear assessment of their performance and capabilities.

Task Model Metric Score

Image Classification Vit Model Accuracy 98%

Production Cost Random Forest MSE 94%


Prediction Classifier

Crop name Random Forest MSE 95%


recommendation Classifier

Chat with Schemes Llama 2 Bleu Score 97%


Doc

Farmic Chatbot Llama 2 Bleu Score 95%


Tabel 4.2 Evaluation metric scores of models

21
Chapter 5

Conclusion and Future Scope

5.1 Conclusion:

Farmic emerges as a beacon of hope in the ever-evolving landscape of agriculture, where


challenges are met with innovative solutions. In this era of digital transformation, the
agricultural sector can harness the power of data and technology to enhance crop management
and decision-making. The holistic approach offered by Farmic, encompassing predictive
features for crop diseases, profit estimation, environmental-based crop recommendations, and
personalized agricultural scheme suggestions via an intelligent chatbot, promises to
revolutionize farming practices.

The very essence of Farmic lies in its alignment with existing research and literature that
underscores the transformative potential of technology, data-driven insights, and personalized
assistance in modern agriculture. The synergy between Farmic's objectives and the extensive
research discussed earlier positions the app as a catalyst for positive change in the agricultural
sector. It empowers farmers with the means to predict and mitigate crop diseases, make
informed decisions about crop selection based on environmental factors, estimate profits
accurately, and seamlessly access government schemes tailored to their unique needs.

In a world where the resilience and sustainability of agriculture are paramount, Farmic stands as
a testament to the innovative spirit of the industry. With this app, farmers are equipped with the
tools they need to make data-driven decisions, maximize yields, and secure their livelihoods. As
agriculture continues to evolve, Farmic promises to remain a steadfast partner in this journey,
supporting the sustainable growth of the agricultural sector.

5.2 Future Scope

As the agricultural landscape undergoes continuous transformation, Farmic, with its data-driven
precision, is positioned at the forefront of innovation. However, its journey is far from over. The
future scope for Farmic is promising, offering opportunities for growth and adaptation in
response to emerging agricultural trends and technologies. The app has the potential to evolve
in several key areas:

22
1. Advanced Machine Learning and AI: Future iterations of Farmic can harness advanced
machine learning algorithms and artificial intelligence to enhance predictive capabilities. By
analyzing more complex datasets, the app can offer even more accurate predictions of crop
diseases and profits.

2. Sustainable Agriculture: With an increasing focus on sustainability, Farmic can integrate


features that promote sustainable farming practices. This might include recommending
environmentally friendly crop choices and conservation techniques.

3. IoT Integration: The Internet of Things (IoT) can play a significant role in the future of
Farmic. By connecting with IoT devices, the app can collect real-time data from sensors placed
in fields, allowing for more precise environmental data and disease monitoring.

4. Global Expansion: Farmic can expand its scope to cater to farmers worldwide. The app can
adapt to different agricultural practices, crops, and regions, making it a valuable tool for a
diverse range of farmers.

5. Market Analysis: Predicting crop profits can be further improved with market analysis
features. By monitoring market trends and demand, Farmic can help farmers make decisions
that maximize their profits.

6. Enhanced Chatbot Interaction: The chatbot can become more sophisticated, offering a wider
range of services. It can provide real-time advice on pest management, offer weather updates,
and assist in understanding and applying for government schemes.

7. Data Security and Privacy: As the app collects sensitive data, ensuring the security and
privacy of farmer information will be paramount. Future Farmic versions can focus on
implementing robust security measures and compliance with data protection regulations.

Farmic's future is bright, and its evolution promises to be a dynamic one, shaped by the
ever-changing agricultural landscape and technological advancements. As it continues to adapt
and innovate, Farmic is well-positioned to play a pivotal role in the sustainable and data-driven
future of agriculture.

23
References

[1] Khan, N.M. and Shahadat, H.M., 2021. A machine learning approach for crop yield prediction
in precision agriculture. Computers and Electronics in Agriculture, 185, p.106027.

[2] Battula, R., Arora, R., Khanna, A., Sharma, A. and Sin- gal, K., 2021. A comprehensive review
of machine learning techniques for crop yield prediction in precision agriculture. Computers and
Electronics in Agriculture, 185, p.106019.

[3] Dass, R., Kumar, R., and Sharma, K.K., 2018. Agricultural crop recommendation system based
on data mining techniques: A review. Computers and Electronics in Agriculture, 149, pp.153-161.

[4] Wang, D., Chen, Y., Wang, X., Zhang, Y., Guo, Y., and Chen, X., 2021. A review of crop
yield prediction and recommendation models for precision agriculture. Computers and Electronics
in Agriculture, 185, p.106025.

[5] Njeru, T.M., Ireri, A.M., and Ngigi, M.K., 2019. A framework for providing agricultural
metadata to smallholder farmers using machine learning. Computers and Electronics in
Agriculture, 165, p.104942.

[6] Zhang, Y., Li, B., Liu, L., and Li, Z., 2019. A mobile application for soil data collection and
analysis in precision agriculture. Computers and Electronics in Agriculture, 156, pp. 426-434.

[7] Barbedo, J. G. A. Digital image processing techniques for detecting, quantifying and
classifying plant diseases. SpringerPlus, 2013,8(4),2(660),1-12.

[8] Caglayan, A., Guclu, O., Can, A. B. A plant recognition approach using shape and color
features in leaf images. In International Conference on Image Analysis and Processing. Springer,
Berlin, Heidelberg. 2013,8(4),161-170.

[9] Zhen, X., Wang, Z., Islam, A., Chan, I., Li, S. Di- rect estimation of cardiac bi-ventricular
volumes with regression forests. In Accepted by Medical Image Computing and
Computer-Assisted Intervention–MICCAI 2014. 2014.

24
Acknowledgement

We would like to express our special thanks to Dr. Niteshkumar Agarwal, our major project
guide who guided us through the project and who helped us in applying the knowledge that we
have acquired during the semester and learning new concepts.

We would like to express our special thanks to Dr. Sharvari Govilkar the H.O.D of our
Computer Engineering department who gave us the opportunity to do this major project because
of which we learned new concepts and their application. We are also thankful to our major
project coordinator along with other faculties for their encouragement and support.

Finally, we would like to express our special thanks of gratitude to Principal Dr. Sandeep Joshi
who gave us the opportunity and facilities to conduct this major project.

Vrushali Chaudhari.
Bhavesh Chaudhari.
Yusuf
Ansari. Yash
Kamble.

25

You might also like