0% found this document useful (0 votes)
19 views60 pages

BE Final Report

The project report focuses on optimizing crop selection and profitability using machine learning-based recommendations. It details the development of a web-based service that integrates environmental factors and market trends to suggest suitable crops for farmers, enhancing agricultural efficiency. Future enhancements may include additional economic data and real-time market analysis to refine recommendations further.

Uploaded by

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

BE Final Report

The project report focuses on optimizing crop selection and profitability using machine learning-based recommendations. It details the development of a web-based service that integrates environmental factors and market trends to suggest suitable crops for farmers, enhancing agricultural efficiency. Future enhancements may include additional economic data and real-time market analysis to refine recommendations further.

Uploaded by

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

A PROJECT REPORT ON

Optimizing Crop Selection And Profitability Through


Machine Learning-Based Recommendations

SUBMITTED TO THE SAVITRIBAI PHULE UNIVERSITY, PUNE


IN THE PARTIAL FULFILLMENT OF THE REQUIREMENTS
FOR THE AWARD OF THE DEGREE
OF

BACHELOR OF ENGINEERING (Computer Engineering)

SUBMITTED BY

RAHUL KEWALRAMANI B1900504336


SAURABH RAJPOOT B1900504478

DEPARTMENT OF COMPUTER ENGINEERING


SCTR’s Pune Institute of Computer Technology
Dhankawadi, Pune - 411043

SAVITRIBAI PHULE PUNE UNIVERSITY


2024-2025
CERTIFICATE

This is to certify that the project report entitled

Optimizing Crop Selection And Profitability Through


Machine Learning-Based Recommendations

Submitted by

RAHUL KEWALRAMANI B1900504336


SAURABH RAJPOOT B1900504478

is a bonafide student of this institute and the work has been carried out by him/her under
the supervision of Prof. Hema Kumbhar and it is approved for the partial fulfillment
of the requirement of Savitribai Phule Pune University, for the award of the degree of
Bachelor of Engineering (Computer Engineering).

Prof. Hema Kumbhar Dr. G. V. Kale


Internal Guide Head
Dept. of Computer Engg. Dept. of Computer Engg.

Dr. S. T. Gandhe
Principal
Pune Institute of Computer Technology

Place: Pune
Date:
ACKNOWLEDGEMENT

It gives us great pleasure in presenting the project report on ‘Optimizing Crop Selec-
tion And Profitability Through Machine Learning-Based Recommendations’.

We would like to take this opportunity to thank Prof. Hema Kumbhar giving us all
the help and guidance we needed. We are really grateful to them for their kind support.
Their valuable suggestions were very helpful.

We are also grateful to Dr G. V. Kale, Head of Computer Engineering Department,


PICT for her indispensable support and suggestions throughout the project.

RAHUL KEWALRAMANI
SAURABH RAJPOOT
(B.E. Computer Engg.)
ABSTRACT

In modern agriculture, the use of data-driven techniques has become essential for opti-
mizing crop selection to maximize yield and profitability. This project presents the devel-
opment of a web-based crop recommendation service that integrates environmental factors
such as soil composition, temperature, humidity, and rainfall to suggest the most suitable
crops for a given region. Unlike traditional crop recommendation systems, this solution
also considers the profitability of crops by providing alternative suggestions that align with
current market trends. Using machine learning algorithms and real-time environmental
data, the system enhances decision-making for farmers, helping them to optimize both
crop productivity and financial outcomes. The platform is designed to be user-friendly,
offering accessible and actionable insights that aim to boost agricultural efficiency and
sustainability. Future enhancements may include incorporating additional economic data,
real-time market analysis, and expanded datasets to further refine crop recommendations.
Contents

List of Figures 8

List of Tables 9

List of Abbreviations 10

1 Introduction 1
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Problem Definition and Objectives . . . . . . . . . . . . . . . . . . . . . 3
1.4 Project Scope & Limitations . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Methodology of Problem solving . . . . . . . . . . . . . . . . . . . . . . . 4

2 Literature Survey 5

3 Software Requirements Specification 9


3.1 Assumptions and Dependencies . . . . . . . . . . . . . . . . . . . . . . . 10
3.1.1 Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.1.2 Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2 Functional Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.1 User Registration and Profile Creation . . . . . . . . . . . . . . . 11
3.2.2 Crop Recommendation Interface . . . . . . . . . . . . . . . . . . . 11
3.2.3 Automated Notifications . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.4 Environmental Data Analysis and Clustering . . . . . . . . . . . . 11
3.2.5 Profitability Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.6 Market Trend Analysis . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.7 Analytical Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3 External Interface Requirements . . . . . . . . . . . . . . . . . . . . . . . 12
3.3.1 Web Based Interface . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3.2 Mobile Application . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3.3 API Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.4 Non-functional Requirements . . . . . . . . . . . . . . . . . . . . . . . . 12
3.4.1 Performance Requirements . . . . . . . . . . . . . . . . . . . . . . 12
3.4.2 Safety and Security Requirements . . . . . . . . . . . . . . . . . . 13
3.5 System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.5.1 Database Requirements . . . . . . . . . . . . . . . . . . . . . . . . 13
3.5.2 Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . 13
3.5.3 Libraries and Tools: . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.5.4 Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . 14
3.6 Analysis Models: SDLC Model . . . . . . . . . . . . . . . . . . . . . . . 14
3.6.1 Agile Model for SDLC . . . . . . . . . . . . . . . . . . . . . . . . 14

4 System Design 16
4.1 System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 Data Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3 Entity Relationship Diagram . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.4 Use Case Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.5 Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5 Project Plan 21
5.1 Project Estimate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.1.1 Reconciled Estimates . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.1.2 Project Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.2 Risk Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.2.1 Risk Identification . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.2.2 Risk Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.2.3 Overview of Risk Mitigation, Monitoring, and Management . . . . 25
5.3 Project Schedule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.3.1 Project Task Set . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.3.2 Timeline Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.4 Team Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.4.1 Team structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.4.2 Management reporting and communication . . . . . . . . . . . . . 29

6 Project Implementation 31
6.1 Overview of Project Modules . . . . . . . . . . . . . . . . . . . . . . . . . 32
6.2 Tools and Technologies Used . . . . . . . . . . . . . . . . . . . . . . . . . 32
6.3 Algorithm Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
6.3.1 Random Forest Regressor . . . . . . . . . . . . . . . . . . . . . . 33
6.3.2 Support Vector Machine (SVM) . . . . . . . . . . . . . . . . . . . 33
6.3.3 K-Nearest Neighbors (KNN) . . . . . . . . . . . . . . . . . . . . . 33

7 Software Testing 34
7.1 Software Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.1.1 Unit Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.1.2 Integration Testing . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.1.3 System Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.1.4 Functional Testing . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.1.5 Acceptance Testing (User Acceptance Testing - UAT) . . . . . . . 35
7.2 Test cases & Test Results . . . . . . . . . . . . . . . . . . . . . . . . . . 36

8 Results 37
8.1 Project Outcomes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
8.2 Screen Shots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
9 Conclusions 41
9.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
9.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
9.3 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

10 Appendix 44
10.1 Appendix A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
10.2 Appendix B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.2.1 Survey Paper Details . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.2.2 Event Participation Details . . . . . . . . . . . . . . . . . . . . . 47
10.3 Appendix C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
10.3.1 Plagiarism Report . . . . . . . . . . . . . . . . . . . . . . . . . . 47

11 References 48
List of Figures

3.1 Agile Model for SDLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4.1 System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17


4.2 Data Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3 ER Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.4 Use Case Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.5 Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.1 Summarized Timeline Chart . . . . . . . . . . . . . . . . . . . . . . . . . 29

8.1 Result 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
8.2 Result 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
8.3 Result 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
8.4 Result 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

10.1 Conference Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46


10.2 Conference Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.3 Rahul’s Inc Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
10.4 Saurabh’s Inc Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
10.5 Plagiarism Report Result . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
List of Tables

2.1 Literature Survey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

7.1 Test Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36


List of Abbreviations
API Application Programming Interface
BERT Bidirectional Encoder Representations from Transformers
CSV Comma-Separated Values
DBSCAN Density-Based Spatial Clustering of Applications with Noise
FAQ Frequently Asked Questions
GCP Google Cloud Platform
GPU Graphics Processing Unit
HDBSCAN Hierarchical Density-Based Spatial Clustering of Applications with Noise
HTML HyperText Markup Language
JWT JSON Web Token
ML Machine Learning
NER Named Entity Recognition
NLP Natural Language Processing
RBF Radial Basis Function
RoBERTa Robustly Optimized BERT Approach
SDLC Software Development Life Cycle
SVM Support Vector Machine
TF-IDF Term Frequency–Inverse Document Frequency
UAT User Acceptance Testing
UI User Interface
UMAP Uniform Manifold Approximation and Projection
UX User Experience
CHAPTER 1
INTRODUCTION
Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

1.1 Overview
In the modern agricultural landscape, optimizing crop selection to maximize yield and
profitability is a growing challenge for farmers. With the increasing availability of envi-
ronmental data, there is significant potential to enhance decision-making through data-
driven approaches. Our project aims to address this challenge by developing a web-based
crop recommendation system that integrates critical environmental factors such as soil
composition, temperature, humidity, and rainfall to suggest the most suitable crops for a
given region. The system leverages machine learning algorithms to analyze real-time data
and provide tailored recommendations that consider both crop productivity and market
trends. Unlike traditional systems, this approach also factors in the economic aspects
of farming, offering alternative crop options that align with current market demands.
The goal is to help farmers make informed decisions that boost agricultural efficiency,
profitability, and sustainability. In the future, we plan to incorporate additional eco-
nomic data, real-time market analysis, and expanded datasets to refine and personalize
crop recommendations even further, ultimately creating a more dynamic and responsive
agricultural ecosystem.

1.2 Motivation
In modern agriculture, farmers face the challenge of selecting the most suitable crops for
varying environmental conditions while also considering profitability. Traditional crop
recommendation systems often focus solely on environmental factors like soil type and
weather, without incorporating economic variables such as market demand and crop
prices. This limitation can lead to suboptimal decisions, affecting both crop yield and
financial outcomes. Farmers need a more efficient and data-driven approach to navigate
these complexities and maximize their agricultural potential. To address this challenge,
we aim to develop a web-based crop recommendation system that not only analyzes en-
vironmental factors but also incorporates market trends and profitability data. By com-
bining real-time data analysis with machine learning, this system will help farmers make
informed decisions that optimize both productivity and financial returns. This solution
will ultimately empower farmers to adapt to changing conditions, improve sustainability,
and enhance overall agricultural efficiency.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 2


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

1.3 Problem Definition and Objectives


In modern agriculture, farmers often face the challenge of selecting the right crops to
grow based on a combination of environmental factors and market trends. Traditional
crop recommendation systems typically focus on factors such as soil composition, weather
conditions, and irrigation, but they often fail to incorporate the economic aspects, such
as market demand and profitability. This gap results in suboptimal crop decisions, which
can impact both agricultural productivity and financial returns. Additionally, existing
systems do not offer personalized or dynamic recommendations, leaving farmers to nav-
igate an overwhelming amount of data without clear guidance. Currently, farmers rely
on manual decision-making or generalized recommendations that fail to account for real-
time conditions or market fluctuations. This approach can lead to inefficiencies in crop
selection, as farmers may choose crops that are not well-suited to current environmental
conditions or market demand, resulting in reduced yields or financial losses. The primary
objective of this project is to address these challenges by developing a web-based crop
recommendation system that integrates environmental data (such as soil composition,
temperature, humidity, and rainfall) with market data to provide personalized, data-
driven recommendations. The system will use machine learning algorithms to analyze
real-time data and offer recommendations that optimize both crop yield and profitabil-
ity. By doing so, the system aims to empower farmers to make informed decisions that
improve agricultural efficiency, increase financial returns, and promote sustainability in
farming practices.

1.4 Project Scope & Limitations


The proposed project aims to enhance the decision-making process for farmers by provid-
ing a web-based crop recommendation system that analyzes environmental and market
data. The system leverages machine learning algorithms to suggest the most suitable
crops for a given region based on factors such as soil composition, temperature, humid-
ity, and rainfall. Additionally, the system incorporates profitability analysis to suggest
alternative crops aligned with current market trends, helping farmers make financially
viable decisions. Key features of the system include accurate crop recommendations
powered by machine learning, real-time data integration, and a user-friendly dashboard
that allows farmers to view and manage recommendations efficiently. The scope of the
project focuses on providing data-driven recommendations for a broad range of crops and
environmental conditions, specifically targeting farmers looking to optimize yield and
profitability. However, the project does face limitations in terms of data availability and
variability. The accuracy of the recommendations depends heavily on the quality and
comprehensiveness of the environmental and market data used. The system may also be
less adaptable to highly specialized agricultural contexts or unique regional conditions
that require more tailored solutions. Furthermore, the project is designed for general use
and may require additional customization to meet the needs of specific crops or farming
practices, potentially limiting its applicability in niche farming scenarios.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 3


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

1.5 Methodology of Problem solving


The proposed system is a web-based crop recommendation platform designed to assist
farmers in making data-driven decisions regarding crop selection. The system leverages
machine learning algorithms to analyze various environmental and market data to rec-
ommend the most suitable crops based on factors like soil composition, temperature,
humidity, and rainfall. It also incorporates profitability analysis, taking current market
trends into account to suggest financially viable crops. The solution aims to optimize
both crop yield and farmer profitability while enhancing decision-making efficiency.
The system will be accessible through a user-friendly web interface, allowing farmers
to input relevant data about their farm’s location, soil characteristics, and environmental
conditions. Once registered, the platform will analyze the input data using machine
learning algorithms, such as Random Forest and Support Vector Machines (SVM), to
generate crop recommendations that are tailored to the specific conditions of the farm.
Additionally, the system will incorporate real-time market data to recommend crops that
are currently profitable, offering farmers alternative suggestions that align with market
demand.
The recommendation engine will continuously refine its predictions by learning
from historical data and user feedback, improving its accuracy over time. To facilitate
ease of use, the system will feature an intuitive dashboard where farmers can view recom-
mendations, track market trends, and monitor environmental factors. Furthermore, the
platform will provide notifications and alerts to keep farmers informed about potential
issues such as changing weather patterns or market fluctuations. This will enable farmers
to make proactive decisions and optimize their agricultural practices, ultimately leading
to increased crop yield and financial success.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 4


CHAPTER 2
LITERATURE SURVEY
Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
Effective crop recommendation systems play a crucial role in assisting farmers with in-
formed decision-making, ultimately optimizing crop yield and sustainability. With the
growing complexity of environmental data, such as soil composition, temperature, hu-
midity, and rainfall, it becomes challenging to manually assess the most suitable crops
for different regions. Machine learning (ML) and data-driven techniques have revolution-
ized this process by automating the analysis of large datasets, offering personalized crop
suggestions based on a variety of factors. ML algorithms, such as Random Forest, Sup-
port Vector Machines (SVM), and Gradient Boosting, are employed to predict the best
crop options, while considering both environmental factors and market dynamics. These
advancements in ML and natural language processing (NLP) have led to more accurate,
real-time crop recommendations, helping farmers improve productivity, reduce risks, and
adapt to changing environmental conditions. The following literature survey reviews var-
ious approaches and methodologies used in crop recommendation systems, highlighting
the use of machine learning algorithms in enhancing agricultural decision-making.

In the development of crop recommendation systems, one study by Shivbhakta


et al. (2024) proposes a crop prediction system that utilizes weather and soil data for
decision-making. Various machine learning algorithms, including Gradient Boosting, were
employed, with Gradient Boosting achieving the highest accuracy in crop prediction. The
research emphasizes the importance of environmental factors, such as temperature, hu-
midity, and rainfall, in determining suitable crops. This approach highlights how com-
bining both weather and soil data can significantly improve crop selection, leading to
enhanced productivity and optimized agricultural outputs for farmers [1].

Another study by Bandara et al. (2020) explores a crop recommendation system


using real-time environmental data collected through sensors, with Na¨ıve Bayes and
SVM algorithms applied for prediction. This system achieved over 92data integration
offers advantages for systems aiming to dynamically adjust recommendations based on
up-to-date environmental factors. The research demonstrates how sensor-based crop rec-
ommendations can aid farmers in making informed decisions and provide sustainable,
high-yielding solutions tailored to their specific environmental conditions [2].

In an attempt to assist Indian farmers, Patel et al. (2024) investigate the use of
machine learning for selecting crops based on climatic, soil, and geographical factors.
Decision Trees and Na¨ıve Bayes were among the most successful algorithms, achieving
over 99reduce crop failure risks. The findings underline the significance of localized data
in crop selection, ensuring that farmers make optimal decisions based on environmental
compatibility, thus improving productivity and minimizing losses due to adverse condi-
tions [3].

A different study by Suguna et al. (2024) investigates the use of MultiLayer Percep-
tron (MLP) and Linear Regression (LR) for recommending crops based on soil, climatic,
and geographical data. It incorporates seasonal data segmentation for time-specific rec-
ommendations, achieving an accuracy of 81the seasonal nature of agriculture to optimize
yield potential. By incorporating the timing of planting into the recommendation system,
farmers can receive better-targeted advice that aligns with the optimal growing periods
for specific crops, improving productivity and aligning with seasonal variations [4].

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 6


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
Focusing on Random Forest, a study by Kale and Mohapatra (2024) explores its use
in crop recommendation systems and finds it achieves an accuracy rate of 99.22weather
patterns, to suggest the best crops. Random Forest’s ability to handle large datasets and
make accurate predictions makes it an ideal choice for crop recommendation systems.
This study provides valuable insight into using Random Forest as a robust algorithm
that can guide decision-making in agricultural practices, ensuring better crop selection
based on environmental compatibility [5].

A further study by Pande et al. (2021) investigates the optimization of crop recom-
mendation systems by combining Support Vector Machine (SVM) with Particle Swarm
Optimization (PSO). This hybrid approach achieved 98.64machine learning performance.
By fine-tuning the SVM model using PSO, the system provided more accurate crop rec-
ommendations, making it highly effective for dynamic agricultural environments. The
research highlights the potential of combining machine learning models with optimiza-
tion algorithms to further improve the reliability and precision of crop recommendation
systems in diverse farming conditions [6].

The AgriRec system, proposed by Patel and Patel (2023), presents a multi-criteria
approach by recommending both crops and fertilizers based on soil properties, water
levels, and market value. The research highlights the integration of economic factors
alongside environmental conditions, ensuring that crop recommendations also consider
financial viability. This approach offers farmers not only the most suitable crops but also
the best fertilizers to improve yield. By incorporating market data, the system provides a
holistic recommendation process that aligns with both environmental sustainability and
economic profitability, making it highly relevant for maximizing farm productivity and
profitability [7].

In another study, Shireesha et al. (2024) developed a web-based application for crop
recommendation using machine learning algorithms such as Random Forest and XGBoost,
complemented by deep learning models like ResNet-9 for disease detection. The platform
not only recommends crops but also suggests fertilizers and detects diseases from plant
images, creating a comprehensive decision-support tool. This integrated approach en-
sures that farmers receive accurate recommendations, not just for crop selection, but for
overall crop management, including disease prevention and nutrient optimization, which
could improve both yield and sustainability [8].

A review by Dahiphale et al. (2023) examines various crop recommendation sys-


tems and the use of different machine learning algorithms, including Random Forest,
which achieved an accuracy of 99.5techniques used to optimize crop selection and em-
phasizes how data-driven recommendations improve agricultural productivity. By focus-
ing on localized data such as weather patterns, soil composition, and seasonal trends,
the study highlights the role of machine learning in providing accurate, scalable, and
real-time decision support for farmers to optimize crop selection and maximize yield [9].

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 7


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

Table 2.1: Literature Survey

Title Work Done


Implemented machine learning models such
as Linear Regression and Random Forest to
Yield Prediction predict crop yield based on features includ-
ing soil type, rainfall, temperature, humidity,
and previous yield data.
Developed a recommendation system that in-
tegrates soil data (NPK levels), weather pa-
rameters, and market trends. Utilized clas-
Crop Recommendation
sification algorithms like Decision Trees, K-
Nearest Neighbors, and SVM to suggest op-
timal crops for given conditions.
Integrated OpenWeatherMap API to fetch
real-time and forecasted weather data, in-
Weather Forecast
cluding temperature, humidity, rainfall, and
wind speed.
Designed a weather reporting module that
offers real-time climate updates with graph-
Weather Report
ical visualizations (charts for temperature,
rainfall trends, and humidity levels).
Created secure user authentication system
using Flask and Sql. Enabled login and
signup functionalities with email/password.
Registration and Login
Applied encryption for password protection
and ensured session management for person-
alized user dashboards.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 8


CHAPTER 3
SOFTWARE REQUIREMENTS
SPECIFICATION
Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

3.1 Assumptions and Dependencies


3.1.1 Assumptions
• Farmers using the platform will provide accurate and up-to-date information about
their farm’s environmental conditions, such as soil type, temperature, humidity,
and rainfall.

• Users will engage with the platform ethically, providing relevant and truthful input
to ensure accurate crop recommendations.

• Farmers will regularly check the platform for crop suggestions, market trends, and
updates related to weather conditions or other relevant alerts.

• The system will assume that users have basic knowledge of agriculture and tech-
nology to navigate the web-based interface effectively.

• The machine learning algorithms will function optimally, providing crop recommen-
dations based on the available environmental and market data.

• Market data, such as crop prices and demand trends, will be updated regularly to
ensure the accuracy of profitability predictions.

• The accuracy of crop recommendations will depend on the quality and completeness
of the input data provided by farmers, including soil and weather conditions

3.1.2 Dependencies
• Farmers must have access to a device (smartphone, tablet, or computer) with an
internet connection to interact with the platform and input necessary data.

• The platform’s performance will rely on a stable and high-speed internet connection
to process real-time data and provide accurate recommendations.

• The successful operation of the machine learning models depends on the availability
of large, high-quality datasets for training and validation.

• Integration of third-party APIs for weather forecasting, market price tracking, and
other external data sources will be necessary to provide real-time and accurate
information.

• The system’s performance will depend on adequate server resources to process large
amounts of environmental and market data, as well as to generate recommendations
efficiently.

• Farmers using the platform must have access to basic technical training or support
to ensure proper use of the system and its features.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 10


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

3.2 Functional Requirements


The following are the functional requirements of the crop recommendation system:

3.2.1 User Registration and Profile Creation


A secure registration process should be implemented, allowing farmers to create their
profiles on the platform. Users must provide essential information, such as farm location,
soil type, and crop preferences, which will be verified by the system to ensure accuracy
and relevance.

3.2.2 Crop Recommendation Interface


The platform should feature a user-friendly interface displaying recommended crops based
on environmental factors, soil data, and market trends. The interface should allow farmers
to view details about each recommended crop, including profitability estimates, growth
requirements, and potential market demand.

3.2.3 Automated Notifications


The system should provide timely notifications related to weather changes, new crop rec-
ommendations, and market updates. These notifications will help farmers stay informed
and make real-time adjustments to their crop planning based on current environmental
and economic conditions.

3.2.4 Environmental Data Analysis and Clustering


The platform should use machine learning algorithms to analyze and cluster environ-
mental data, such as temperature, rainfall, and soil composition, to recommend suitable
crops. This functionality will enable farmers to receive crop suggestions tailored to their
specific farm conditions.

3.2.5 Profitability Analysis


To assist farmers in maximizing financial outcomes, the system should analyze current
market trends and project profitability for each recommended crop. This analysis should
consider factors like local demand, crop prices, and production costs, providing farmers
with insights into the most profitable options.

3.2.6 Market Trend Analysis


The platform should incorporate market trend analysis to identify crops with high po-
tential demand based on local and regional market data. This feature will help farmers
choose crops that align with current market needs, enhancing the likelihood of successful
sales and profitability.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 11


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
3.2.7 Analytical Dashboard
A comprehensive dashboard should be available for farmers to track key metrics such as
crop profitability, weather forecasts, soil conditions, and market trends. This dashboard
should offer visual insights to help farmers make data-driven decisions, optimizing their
crop selection and overall agricultural productivity.

3.3 External Interface Requirements


The proposed crop recommendation system’s interfaces are categorized into three main
sections: web-based interface, mobile application, and API services.

3.3.1 Web Based Interface


The web-based dashboard will serve as the primary interface for farmers and administra-
tors to interact with the platform. This interface will be accessible through any major web
browser, such as Google Chrome, Firefox, or Safari.Users will be able to register, update
their farm profiles, view recommended crops, and access environmental and profitability
insights. The dashboard will be developed using modern JavaScript frameworks like Re-
act or Angular, ensuring a responsive, user-friendly experience that adapts to different
screen sizes.

3.3.2 Mobile Application


To provide farmers with a more convenient way to access the platform, a mobile appli-
cation will be developed for Android and iOS devices. This app will offer core function-
alities, such as viewing crop recommendations, receiving weather and market alerts, and
accessing profitability analysis. The app will be designed for offline capabilities to sup-
port farmers in areas with limited internet connectivity, allowing for data synchronization
when a connection is available.

3.3.3 API Services


The system will provide RESTful API services for seamless integration with third-party
agricultural and market data sources. These APIs will allow developers and agricultural
organizations to programmatically access core features, such as environmental data pro-
cessing, crop recommendation, and profitability analysis. Detailed API documentation
will be available to facilitate integration and support custom applications or services that
require real-time crop and market information.

3.4 Non-functional Requirements


3.4.1 Performance Requirements
1. 1. User Satisfaction: The system should deliver a reliable and user-friendly expe-
rience for farmers and administrators, meeting their expectations for ease of use,
accessibility, and efficiency.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 12


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
2. 2. Average Response Time: The system should process user requests and deliver
crop recommendations within an average response time of under 5 seconds, allowing
users to quickly access critical information.

3. 3. Reliability: The platform must maintain consistent reliability by providing ac-


curate crop recommendations and environmental data, minimizing downtime and
ensuring uninterrupted service.

4. 4. System Availability: The platform should be available to users at least 99system


when they need it most.

3.4.2 Safety and Security Requirements


1. 1. User Account Security: User accounts and associated data must be securely
stored using encryption and strict access protocols to prevent unauthorized access
and protect sensitive information.

2. 2. Password Integrity: The system will enforce strong password policies, with
an option for two-factor authentication to enhance account security and prevent
unauthorized access.

3. 3. Data Protection: The platform will comply with data protection regulations
such as GDPR, ensuring user data is securely handled and that users are informed
about data usage and privacy policies.

4. 4. API Security: The system’s APIs must implement secure authentication (e.g.,
OAuth 2.0) to prevent unauthorized access, ensuring that only authenticated users
and approved applications can access data and system functionalities.

3.5 System Requirements


3.5.1 Database Requirements
• MySQL

3.5.2 Software Requirements


• Backend APIs: Nodejs, Expressjs , Flask

• Frontend: ReactJS, Bootstrap

• Containerization: Docker

• Deployment : Microsoft Azure

• Operating System : Windows/Linux

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 13


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
3.5.3 Libraries and Tools:
• Scikit-learn: For implementing machine learning algorithms for crop recommen-
dations (e.g., Decision Tree, Random Forest) and clustering techniques.

• TensorFlow / PyTorch: For training and deploying advanced machine learning


models when needed.

• Pandas and NumPy: For data preprocessing and efficient handling of environ-
mental data and user inputs.

• Flask: To manage backend services and integrate ML models for the crop recom-
mendation process.

• MySQL Database: For structured data storage related to user interactions, crop
suggestions, and environmental factors.

3.5.4 Hardware Requirements


• Processor: intel i5 or higher

• Memory: Minimum 8GB ; 16GB recommended

• Storage: SSD with at least 256 GB for model storage and data processing

• GPU: Dedicated GPU for faster training of deep learning models

3.6 Analysis Models: SDLC Model


The Agile methodology will be the foundation for our project development approach,
emphasizing flexibility, adaptability, and user-centric progress. Agile’s iterative nature
allows for continuous enhancement and adaptation throughout the project’s life cycle,
making it ideal for developing dynamic solutions like the social media interaction en-
hancement system.

3.6.1 Agile Model for SDLC

In this project, we adopted the Agile methodology and implemented its principles
to build the system step-by-step. The development process was organized into iterative
cycles known as sprints, with each sprint addressing a specific feature set. This allowed us
to promptly act on feedback and continuously refine the system. Each sprint encompassed
the following stages:

1. Plan: In this initial phase, we collected detailed requirements related to comment


clustering, query matching, and sentiment analysis integration. The emphasis was
on understanding user expectations and prioritizing features that provided maxi-
mum value to content creators.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 14


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

Figure 3.1: Agile Model for SDLC

2. Design: During this stage, we developed architectural diagrams, UI prototypes,


and data flow representations for clustering techniques, query matching operations,
and sentiment classification. We also planned the integration of third-party APIs
and outlined the system’s backend structure.

3. Develop: This phase involved writing the code and implementing the core modules,
such as intelligent comment clustering, query handling, and sentiment analysis. We
made use of modern tools and best practices to ensure the system was both scalable
and efficient.

4. Test: In this phase, we rigorously tested the modules using a mix of manual and
automated approaches. The objective was to verify the accuracy of clustering,
evaluate the responsiveness of query matching, and ensure the sentiment analysis
correctly interpreted user comments.

5. Release: Once all components passed the testing phase, we deployed them to a
staging environment for final evaluations. This step also included setting up server
configurations, managing the database, and confirming seamless integration with
social media platforms.

6. Feedback: At the end of every sprint, we collected feedback from stakeholders


such as content creators and technical reviewers. This feedback guided our feature
improvements, bug fixes, and sprint planning for subsequent development cycles.

By following the Agile methodology, the project was able to evolve based on on-
going feedback, resulting in a more user-responsive and need-driven solution for content
creators. The incremental development approach helped us consistently enhance the
system, ultimately delivering a robust tool for improving interactions on social media
platforms.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 15


CHAPTER 4
SYSTEM DESIGN
Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

4.1 System Architecture

Figure 4.1: System Architecture

The System Architecture for the crop recommendation platform consists of several
core components that work together to analyze environmental factors, crop profitability,
and suggest the most suitable crops for a specific region. Below is a detailed description
of each component in the architecture:

• Data Collection Module:


The system begins by gathering environmental and agricultural data from vari-
ous sources, such as real-time sensors, weather APIs, and agricultural databases.
This data includes soil composition, weather parameters (temperature, humidity,
rainfall), and regional crop data. The collected data is temporarily stored before
entering the preprocessing stage to ensure its suitability for model analysis.

• Data Preprocessing Pipeline:


Once the data is collected, it flows through a preprocessing pipeline. This module
cleans and standardizes the data by handling missing values, encoding categorical
variables, and normalizing numerical values. This step is essential to enhance data
quality, making it ready for accurate model predictions and probabilistic analysis.

• Feature Store:
The feature store acts as a structured repository for processed data, storing essential
features such as soil nutrient levels, climatic conditions, and historical crop yields.
This repository supports the machine learning models by supplying a consistent set
of features for training, validation, and real-time predictions.

• Machine Learning Model Building Module:


This module constructs predictive models to recommend the most suitable crops
based on environmental factors and historical data. The models utilize machine
learning algorithms like Random Forest, Decision Tree, and Gradient Boosting to
identify optimal crop options. Each model is trained and validated using the data
stored in the feature store to ensure high accuracy in crop recommendation.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 17


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
• Economic Data Integration Module:
To provide additional value to the recommendation system, this module integrates
real-time economic data such as market prices, demand trends, and profitability
forecasts. By incorporating these economic factors, the system can suggest crops
that are not only suited to environmental conditions but also have high market
potential, thus enhancing profitability for farmers

• Probabilistic Analysis Module:


This module uses probabilistic algorithms to assess the likelihood of crop success
based on various scenarios, such as seasonal changes or shifting market conditions.
This analysis helps provide alternative recommendations under uncertain or varying
conditions, giving users greater flexibility in decision-making.

• User Interface (UI):


The user interface is a web-based dashboard designed for ease of use, allowing farm-
ers and agricultural advisors to access crop recommendations, economic insights,
and data trends through a clear and intuitive layout. Built using React.js, this in-
terface enables users to configure inputs, view recommendations, and adjust system
parameters to suit specific farming needs.

This architecture empowers farmers with actionable insights by integrating real-time


environmental and economic data, streamlining the decision making process, and recom-
mending the most profitable crops suitable for their land and conditions.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 18


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

4.2 Data Flow Diagram

Figure 4.2: Data Flow Diagram

4.3 Entity Relationship Diagram

Figure 4.3: ER Diagram

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 19


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

4.4 Use Case Diagram

Figure 4.4: Use Case Diagram

4.5 Sequence Diagram

Figure 4.5: Sequence Diagram

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 20


CHAPTER 5
PROJECT PLAN
Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

5.1 Project Estimate


5.1.1 Reconciled Estimates
• Research and Development: Estimated a total of 5 months for researching and
developing the core features of the crop recommendation system. This phase in-
cludes gathering and analyzing environmental data, selecting and implementing
machine learning models for crop predictions, and integrating external data sources
like weather APIs and IoT devices. The team will explore various algorithms for
predicting crop suitability and profitability based on diverse environmental factors.

• Testing and Evaluation: Estimated 2.5 months for comprehensive system testing.
This will include unit testing for individual components (such as data processing,
machine learning models, and IoT sensor integration) and integration testing to
ensure that all parts of the system work seamlessly together. The testing phase
will also include performance optimization, security assessments, and user feedback
testing to evaluate the system’s real-world applicability and accuracy.

• Documentation and Review: Estimated 1 month for developing thorough project


documentation. This will include system architecture documentation, user guides
for farmers, technical specifications for developers, and a detailed explanation of
the machine learning models used. Regular feedback sessions will be held with
stakeholders to ensure alignment with project goals, and updates will be made as
necessary based on their input.

5.1.2 Project Resources


1. Backend Developers: Responsible for developing the core processing components
and APIs of the crop recommendation system. This includes handling the data
preprocessing pipeline, implementing machine learning models for crop predictions,
and managing the integration of IoT sensor data and weather APIs. The primary
technologies used will be Python (for machine learning), Flask/Django for the back-
end API, and libraries like Scikit-learn and TensorFlow for building the predictive
models.

2. Data Scientists/ML Engineers: Focused on designing, training, and fine-tuning the


machine learning models that power the crop recommendation system. They will
work on developing predictive models.based on environmental data, such as soil
conditions, climate, and crop performance. Additionally, they will handle data
analysis tasks and model evaluation to ensure accuracy and effectiveness in real-
world agricultural settings.

3. Frontend Developers: Responsible for building the user interface where farmers
can interact with the recommendation system. This will include the design of a
dashboard to view personalized crop recommendations, weather information, and
performance metrics. Modern web technologies like React.js and Bootstrap will be
used to create an intuitive and user-friendly interface.

4. Cloud Infrastructure and Database Management: The system will rely on cloud
services such as AWS or Google Cloud for hosting and scalability. A cloud database

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 22


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
solution (e.g., MySQL or PostgreSQL) will be used to store environmental data,
user profiles, and recommendation outputs. These resources will ensure the system
can handle large datasets and scale according to user demands.

5. Collaboration Tools: The development team will use GitHub for version control,
tracking project progress, managing code contributions, and conducting code re-
views. For team communication and collaboration, Google Meet and Slack will be
used for real-time discussions, project updates, and brainstorming sessions.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 23


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

5.2 Risk Management


Risk management is a critical component of our project to ensure its smooth develop-
ment and deployment. By proactively identifying potential risks and devising mitigation
strategies, we aim to minimize the negative impact on the project’s timeline, functional-
ity, and user satisfaction. This approach will contribute to the project’s overall success
and operational stability.

5.2.1 Risk Identification


During the risk identification process for our crop recommendation system, we have iden-
tified the following risks:
• Technical Risk:
1. Data Integration Challenges: Difficulties in integrating various data sources
such as remote sensing data, IoT devices, and weather APIs, which may lead
to inaccurate or incomplete recommendations.
2. Model Performance Issues: The potential for suboptimal performance in ma-
chine learning models, especially when dealing with diverse environmental data
or when algorithms fail to capture complex interactions between soil condi-
tions, climate, and crop profitability.
3. Real-time Data Processing Delays: Latency in processing realtime data from
IoT sensors or weather stations, which may result in delayed or outdated crop
recommendations.
• Business Risk:
1. Budget Constraints: Limited funding or resources may affect the implementa-
tion of advanced features such as the integration of IoT devices or the use of
high-end machine learning models, potentially slowing down the development
process.
2. Shifting Market Demand: Changes in agricultural trends or market preferences
could lead to a misalignment between the system’s recommendations and the
needs of farmers, resulting in lower adoption or decreased effectiveness.
3. Adoption Challenges: Slow adoption by farmers or reluctance to trust the
technology could hinder the system’s widespread use, affecting the long-term
sustainability of the project.
• Security Risk:
1. Data Privacy Concerns: The risk of unauthorized access to sensitive data,
including user information or environmental data, leading to privacy violations.
2. API Vulnerabilities: Potential security weaknesses in the system’s APIs used
for data collection and communication, making it susceptible to exploitation
or manipulation.
3. Misuse of Recommendations: The risk that incorrect or misleading crop rec-
ommendations, especially those not properly adjusted for specific regional con-
ditions, could negatively impact farmers’ financial outcomes and the credibility
of the system.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 24


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
5.2.2 Risk Analysis
After identifying potential risks, we conducted a thorough risk analysis to assess their
impact and create effective mitigation plans:

• Technical Risk: To minimize risks related to data integration and machine learn-
ing model performance, we will ensure reliable access to external data sources, such
as weather APIs. Regular model evaluations and updates will be implemented
to maintain accuracy and adapt to evolving environmental factors. Additionally,
scalable cloud infrastructure will be used to support real-time data processing and
ensure the system can handle high usage during peak seasons.

• Business Risk: To address potential changes in market demands and user re-
quirements, we will maintain clear communication with stakeholders throughout
the project. The budget will be closely tracked, and project timelines will be ad-
justed to accommodate any unforeseen challenges. Engaging early with farmers
and agricultural experts will ensure the platform meets user needs and increases
adoption.

• Security Risk: Security of user data and recommendations will be prioritized by


implementing encryption techniques and secure data storage practices. Regular se-
curity audits will be conducted to identify vulnerabilities, and strict access controls
will be enforced for both user and environmental data. Moreover, measures will be
taken to ensure the reliability of the recommendation system and prevent misuse
of the platform for fraudulent purposes.

5.2.3 Overview of Risk Mitigation, Monitoring, and Manage-


ment
1. Risk Mitigation:

• Proactive Planning: Developed and implemented contingency plans for each


identified risk, ensuring that all stakeholders were aware of potential issues and
their resolution strategies.
• Resource Allocation: Prioritized key resources (time, personnel, budget)
to address critical risks first, ensuring adequate allocation for unforeseen chal-
lenges.
• Third-party Collaboration: Engaged early with third-party providers (for
APIs or integrations) to ensure timely updates and collaboration, minimizing
integration challenges.

2. Risk Monitoring:

• Continuous Monitoring: Used tools to continuously track the performance


of the algorithms, user feedback, and system health, enabling early identifica-
tion of any issues or performance degradation.
• Real-time Alerts: Set up real-time monitoring and alert systems for per-
formance issues, security threats, or API malfunctions to detect and address
them immediately.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 25


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
• Frequent Audits: Scheduled regular security and performance audits to iden-
tify potential vulnerabilities and improve system performance.

3. Risk Management:

• Dynamic Adaptation: As the project progressed, the risk management plan


was revisited regularly to adapt to new risks, incorporating feedback from the
team and stakeholders.
• Stakeholder Involvement: Ensured regular communication with stakehold-
ers to keep them updated on risk status, mitigation strategies, and any shifts
in project scope or direction.
• Post-Deployment Risk Review: After the initial deployment, continued
to monitor risk factors, especially in terms of market adoption and user satis-
faction, refining the system based on real-world data and feedback.

These strategies helped minimize disruptions, maintained project timelines, and


ensured the overall success of the project while safeguarding user and business interests.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 26


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

5.3 Project Schedule


5.3.1 Project Task Set
• Conduct research and interviews with agricultural experts to understand the key
factors influencing crop selection, such as soil composition, weather patterns, and
market trends.

• Meet with project mentors to discuss the project goals, scope, and expectations for
the crop recommendation system.

• Define the problem statement and gather detailed requirements from relevant re-
search papers, online resources, and expert consultations.

• Brainstorm potential solutions, focusing on integrating environmental data and


machine learning models for accurate crop recommendations.

• Document the problem statement, research findings, and initial system design for
future reference.

• Identify the technology stack and tools required for the implementation, such as
machine learning libraries, weather data APIs, and web development tools.

• Research machine learning algorithms suitable for crop recommendation, including


decision trees, random forests, and hybrid models.

• Assign roles to team members based on their expertise in areas such as data collec-
tion, model development, and user interface design.

• Familiarize the team with the necessary tools and technologies, including Python,
scikit-learn, and web development frameworks.

• Design the basic user interface for the platform, enabling users to input environ-
mental data and receive crop recommendations.

• Finalize the system architecture and design, ensuring smooth integration between
the front-end, back-end, and machine learning components.

• Begin developing the core components of the system, including data collection,
preprocessing pipelines, and integration with external weather data sources.

• Select and test machine learning models for crop recommendation, evaluating their
predictive accuracy using sample datasets. Develop and integrate the chatbot mod-
ule for addressing frequently asked questions and assisting users.

• Perform internal testing to ensure that all modules work together without issues,
focusing on system functionality and usability.

• Deploy the system on a local or cloud-based server for testing and demonstration
purposes.

• Gather feedback from mentors and potential users to assess the platform’s perfor-
mance, accuracy, and ease of use.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 27


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
• Refine the system based on feedback, adjusting models and interfaces to improve
performance.

• Conduct final system testing to ensure all components meet the project’s require-
ments and function as expected.

• Document the entire development process, including the design, codebase, testing
results, and challenges encountered.

• Prepare the final project report, presentation, and code for submission, and present
the system for final evaluation.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 28


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
5.3.2 Timeline Chart
Figure 5.1 is the summarized project timeline chart. It briefly explains the schedule of
our entire project from inception to projected completion.

Figure 5.1: Summarized Timeline Chart

5.4 Team Organization


5.4.1 Team structure
• Rahul Kewalramani: Backend, Database Operations ML Developer.

• Saurabh Rajpoot: Frontend ML developer.

• Prof. Hema Kumbhar: Internal mentor and guide.

5.4.2 Management reporting and communication


• Management: To manage the crop recommendation project efficiently, we adopted
a structured approach using collaborative tools. Google Drive was used to organize
and share documents, research papers, and datasets among team members for easy
access. For code management and version control, we used Git and GitHub, facil-
itating smooth collaboration and tracking development changes. Weekly meetings
were held to review progress, discuss obstacles, and plan upcoming tasks, ensuring
alignment with project goals.

• Reporting: We followed a weekly reporting protocol to update our internal


mentor, Prof. Hema Kumbhar, on project milestones. These reports included
progress on model development, data integration challenges, and proposed solutions.
The mentor’s feedback guided our adjustments and helped maintain focus on project
objectives. We also shared periodic progress updates with the department’s review
panel to meet academic standards.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 29


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
• Communication: For team communication, we primarily relied on Slack and
Google Meet for updates, discussions, and brainstorming sessions. Scheduled weekly
meetings with the mentor ensured consistent feedback and support. This communi-
cation strategy enabled the team to address challenges promptly and stay updated
on project advancements.

This organized approach to management, reporting, and communication ensured trans-


parency, accountability, and efficiency, ultimately contributing to the successful progres-
sion of the project.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 30


CHAPTER 6
PROJECT IMPLEMENTATION
Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

6.1 Overview of Project Modules


• User Authentication Module: Function: Allows users (farmers, researchers)
to securely register and log in to the system.

• Soil and Environmental Data Input Module: Function: Collects user-input


or sensor-based environmental data including:

• Soil composition (NPK values):


Temperature, humidity, rainfall, pH level

• Weather Forecast Report Module: Function: Provides real-time and fore-


casted weather information.

• Crop Recommendation Module: Function: Recommends optimal crops based


on: 1. Environmental conditions 2. Soil health 3. Historical yield data

• Yield Prediction Module: Function: Predicts expected yield for selected crops
using historical and environmental data.

• Visualization Dashboard Module: Function: Displays outputs, trends, and


data insights in a user-friendly manner.

• Admin Panel (Optional): Function: Allows administrators to manage users,


update datasets, and monitor system logs.

6.2 Tools and Technologies Used


• Languages: Python for backend and model development, JavaScript (React) for
frontend.

• Libraries: Pandas, NumPy, Matplotlib, Scikit-learn.

• Models: Random Forest Regressor,Support Vector Machine, K-Nearest Neighbors


(KNN).

• Frameworks: Flask and Bootstrap .

• Frontend Tools: HTML + CSS + JavaScript.

• Database: SqliteGitHub – Version control and project collaboration. for storing


user data, queries, and interactions.

• Containerization: Docker for modular deployment.

• Deployment: GitHub – Version control and project collaboration.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 32


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

6.3 Algorithm Details


6.3.1 Random Forest Regressor
• Ensemble method using multiple decision trees to predict continuous output.

• Why used? Robust to noise, handles nonlinear relationships well.

• Performance: Achieved 91

• Evaluation Metrics: MAE (Mean Absolute Error), RMSE (Root Mean Squared
Error).

6.3.2 Support Vector Machine (SVM)


• Constructs a hyperplane in high-dimensional space to separate crop classes.

• Why used? Effective for complex and high-dimensional datasets.

• Kernel Used: RBF (Radial Basis Function).

6.3.3 K-Nearest Neighbors (KNN)


• Classifies data points based on the majority class of their nearest neighbors.

• Why used? Works well for small datasets with simple decision boundaries.

• Tuning: K-value selected using cross-validation.

• Metric Used: Accuracy, Precision.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 33


CHAPTER 7
SOFTWARE TESTING
Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

7.1 Software Testing


Software testing is the process of evaluating a system or its components with the intent to
determine whether it meets the specified requirements. The goal is to find any defects or
bugs in the software that could hinder its functionality, performance, or user experience.
In our project, the testing process is critical to ensure that all functionalities, including
user interactions, data inputs, soil analysis, and clustering, perform as expected.
The major types of testing performed in this project include:

7.1.1 Unit Testing


Unit testing involves testing individual units or components of the software in isolation
to ensure they work correctly. Each function or method is tested in its most basic form.
Developers typically conduct unit tests during the development phase, using tools like
JUnit or PyTest.

7.1.2 Integration Testing


Integration testing is performed after individual units are tested. It focuses on evaluating
the interaction and data flow between different modules or components. The purpose is
to detect defects that may arise when the modules work together.

7.1.3 System Testing


System testing is a high-level test conducted on the complete integrated system. It
ensures that the system complies with all the specified requirements. This includes both
functional testing (like checking the video comment system) and non-functional testing
(like security and performance).

7.1.4 Functional Testing


Functional testing verifies that the software behaves according to the defined functional
requirements. It ensures that the system implements the required functionality correctly,
such as input validation, business rules, and output generation.

7.1.5 Acceptance Testing (User Acceptance Testing - UAT)


Acceptance testing is the final level of testing, conducted to ensure that the software meets
the business needs and end-user requirements. It is typically performed by stakeholders
or clients before the software is released.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 35


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

7.2 Test cases & Test Results

Expected Out-
Test Case ID Test Scenario Actual Output
put
User is logged User is logged
User Login with
TC USER 001 in and redirected in and redirected
valid credentials
to the homepage to the homepage
User account User account
is created, and is created, and
User signup with
TC USER 002 user is redi- user is redi-
valid details
rected to the rected to the
homepage homepage
Error mes- Error mes-
User login with sage: “Invalid sage: “Invalid
TC USER 003 invalid creden- username or username or
tials password” is password” is
displayed displayed
All uploaded All uploaded
View a user’s
data are dis- inputs are dis-
TC ADMIN 001 own videos in
played along played along
the dashboard
with user data with user data
The relevant The relevant
Search for a comment(s) are comment(s) are
TC SEARCH 001
query displayed in the displayed in the
search results search results
Message: “No Message: “No
Search with no
TC SEARCH 002 data found” is data found” is
matching results
displayed displayed
Inputs with a Inputs with a
Search with par- matching par- matching par-
TC SEARCH 003
tial query match tial title are tial title are
displayed displayed

Table 7.1: Test Cases

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 36


CHAPTER 8
RESULTS
Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

8.1 Project Outcomes


Our project successfully achieved its goals by leveraging machine learning and real-time
data to assist farmers in making informed, data-driven agricultural decisions. Below are
the key outcomes:

• Accurate Crop Recommendation System: Developed and deployed a ma-


chine learning-based crop recommendation engine.
Achieved 95.2
Tailored suggestions based on soil health, weather, and market trends.

• Yield Prediction Module: Implemented regression models (Random Forest


and XGBoost) to estimate crop yield.
Reached prediction accuracy up to 91.6
Enabled farmers to forecast production and plan accordingly.

• Weather Integration: Integrated weather API to fetch live and forecasted data
(temperature, humidity, rainfall).
Helped users plan irrigation, sowing, and harvesting based on climate trends.

• Profitability Insights: Provided basic market-driven profitability analysis by


factoring in crop prices.
Supported economically optimized crop selection, not just agriculturally viable ones.

• User-friendly Web Application: Designed and built a responsive, intuitive


frontend using HTML, CSS, and Bootstrap.
Enabled secure user login, dashboard access, and real-time interaction.
Displayed predictions and recommendations through clean visual interfaces and
charts.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 38


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

8.2 Screen Shots

Figure 8.1: Result 1

Figure 8.2: Result 2

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 39


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

Figure 8.3: Result 3

Figure 8.4: Result 4

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 40


CHAPTER 9
CONCLUSIONS
Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

9.1 Conclusion
his project demonstrated the significant impact of data-driven technologies, particularly
machine learning, in enhancing modern agricultural practices. The web-based crop rec-
ommendation system that was developed extended beyond the capabilities of traditional
systems by incorporating both environmental parameters—such as soil composition, tem-
perature, humidity, and rainfall—and economic factors, including market demand and
crop profitability.
By suggesting alternative crops based on real-time data and market trends, the
system enabled farmers to make more informed decisions aimed at optimizing both crop
productivity and financial returns. Machine learning models played a pivotal role in this
process, efficiently analyzing large and complex datasets to deliver precise, condition-
specific recommendations.
The system’s adaptability allowed it to evolve and improve over time, dynamically
responding to shifting environmental and market conditions. As a result, it provided
not only accurate insights but also a scalable and sustainable approach to farming. In
the long term, the application of such web-based intelligent systems holds the potential
to promote sustainable agriculture by maximizing resource efficiency, reducing waste,
increasing profitability, and empowering farmers with actionable, data-driven insights.

9.2 Future Work


1. Integration of Diverse Data Sources: Future improvements will focus on
adding remote sensing data, like satellite imagery, to capture soil moisture, crop
health, and land use. Combined with real-time weather updates and IoT devices
(e.g., soil sensors), this integration will enable precise, location-based recommenda-
tions that adjust to changing conditions.

2. Enhancing Predictive Accuracy: To improve recommendation accuracy, fu-


ture versions will explore advanced models, including hybrid approaches combining
decision trees, neural networks, and gradient boosting. Deep learning techniques
will also be tested to better capture complex relationships between environmental
factors and economic outcomes.

3. IoT Integration: Incorporating IoT devices like soil and weather sensors will
allow for real-time data collection on nutrients, pH, and moisture, providing highly
localized and timely recommendations to support informed decision-making.

9.3 Applications
1. Social Media Engagement: The platform assists content creators by stream-
lining responses to frequently asked questions and clustering similar comments,
improving engagement and allowing for more efficient interaction with their audi-
ence.

2. Customer Support Automation: Query matching automate the handling of


repetitive user inquiries, making it ideal for businesses looking to enhance customer
support through quicker and more accurate responses to common questions.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 42


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
3. Multilingual Content Moderation: Future enhancements could allow the sys-
tem to be applied across platforms with multilingual audiences, making it a powerful
tool for moderating and responding to comments in diverse linguistic environments.

4. Content Categorization: The comment clustering feature can be used in e-


commerce and review platforms to categorize customer feedback, allowing compa-
nies to address specific concerns such as product quality, pricing, or delivery issues
more effectively.

5. Precision Agriculture Support: Lays the foundation for integration with IoT
sensors and drones to enable more accurate, real-time farm management.
Can support future expansion into pest prediction, fertilizer suggestion, or disease
detection.

6. Agricultural Extension Services: Useful for government agencies and NGOs


providing advisory services to farmers.
Can be integrated into rural development programs to assist smallholder and marginal
farmers.

7. Educational Research Use: Acts as a case study for the integration of AI/ML
in agriculture.
Useful for academic purposes in agricultural technology, data science, and environ-
mental science fields.

8. Mobile or Web Application Platforms: Can be scaled into a mobile app for
wider adoption by farmers.
Integration with multilingual support can help reach rural and non-English-speaking
users.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 43


CHAPTER 10
APPENDIX
Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

10.1 Appendix A
Technical Feasibility
• The project leverages advanced technologies, including machine learning algorithms
and predictive modeling, ensuring both technical feasibility and scalability for the crop
recommendation platform.
• Utilizing Python-based machine learning libraries and a cloud-hosted environment, the
system can efficiently process and analyze environmental data, providing reliable crop
suggestions. This technical framework supports high availability and scalability, accom-
modating the growing demand for agricultural insights and ensuring smooth, continuous
operation for end-users.
Operational Feasibility
• User testing and feedback from farmers and agricultural advisors indicate that the crop
recommendation platform is operationally feasible.
• The integration of environmental data analysis with machine learning models has
proven effective in suggesting suitable crops, enhancing decision-making processes. The
platform’s ability to provide tailored crop recommendations based on real-time conditions
has been positively received, confirming its operational viability.
Economic Feasibility
• A cost-benefit analysis was conducted to evaluate the economic feasibility of the pro-
posed crop recommendation platform.
• The expenses involved in developing, deploying, and maintaining the platform were
compared with the expected benefits, including increased crop yield, optimized resource
usage, and improved profitability for farmers.
• The analysis showed that the platform is economically sustainable, with the poten-
tial benefits significantly exceeding the costs, making it a practical solution to enhance
agricultural productivity and farmer profitability.

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 45


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations

10.2 Appendix B
10.2.1 Survey Paper Details
Paper Status: Published
Name of Conference: 2025 1st International Conference on AIML-Applications for
Engineering Technology (ICAET).
Page Numbers: 7
DOI:10.1109/ICAET63349.2025.10932168

Figure 10.1: Conference Certificate

Figure 10.2: Conference Certificate

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 46


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
10.2.2 Event Participation Details
Event Name: Impetus & Concepts (INC)

Figure 10.3: Rahul’s Inc Certificate

Figure 10.4: Saurabh’s Inc Certificate

10.3 Appendix C
10.3.1 Plagiarism Report
Overall 16 received.
Applied for the conference; yet to receive acceptance

Figure 10.5: Plagiarism Report Result

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 47


CHAPTER 11
REFERENCES
Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
[1] Shivbhakta, B., Karve, A., Humnabadkar, A., Hon, S. V. Crop Prediction System
from the Weather Data Using Machine Learning.

[2] Bandara, P., Weerasooriya, T., Ruchirawya, T. H., Nanayakkara, W. J. M., Di-
mantha, M. A. C., Pabasara, M. G. P. (2020). Crop Recommendation System.
International Journal of Computer Applications, 175(22)

[3] Patel, M., Rane, A., Patni, V. Crop Recommendation System using Machine Learn-
ing.

[4] Suguna, K., Murali, P., Ayyasamy, P., Obuli, O. (2024). Crop Recommendation
System Using Machine Learning Algorithm. International Research Journal on Ad-
vanced Engineering Hub (IRJAEH), 2(5), 1237–1242.

[5] Kale, V., Mohapatra, B. N. (2024). Crop Recommendation System Using Machine
Learning. ITEGAM-JETIA, 10(48), 63–68.

[6] Pande, S. M., Ramesh, P. K., Anmol, Aishwarya, B. R., Rohilla, K., Shaurya,
K. (2021). Crop Recommender System Using Machine Learning Approach. In Pro-
ceedings of the Fifth International Conference on Computing Methodologies and
Communication (ICCMC 2021). IEEE Xplore. Part Number: CFP21K25-ART.

[7] Pawan, Yadav, D., Sharma, R. K., Kumar, M., Rani, J., Sharma, N. An Effective
Approach for Crop Recommendation Using Features of Specific Locations and Sea-
sons to Maximize Crop Yield Production by Using Machine Learning. International
Journal of Intelligent Systems and Applications in Engineering.

[8] Onoriode, E. M., Nnenna, N. H., Kingsley, C. I. (2024). Optimizing Crop Recom-
mendation Systems Using Machine Learning Algorithms. In Proceedings of the CEE
2024 International Conference.

[9] Patel, K., Patel, H. B. (2023). Multi-criteria Agriculture Recommendation System


Using Machine Learning for Crop and Fertilizers Prediction. Current Agriculture
Research Journal, 11(1), 137–149.

[10] Paithane, P. M. (2023). Random Forest Algorithm Use for Crop Recommendation.
Journal of Engineering and Technology for Industrial Applications, 9(43), 34–41.
https://doi.org/10.5935/jetia.v9i43.906

[11] Shireesha, B., Vinitha, M., Vamsi, K., Ali, S. S., Nunna, U. S. A. (2024). Crop
Care Tech: A Web-Based Application for Crop, Fertilizer Recommendation, and
Disease Detection Using ML and DL. International Research Journal on Advanced
Engineering Hub (IRJAEH), 2(9), 2252–2259.

[12] Dahiphale, D., Shinde, P., Patil, K., Dahiphale, V. (2023). Smart Farming: Crop
Recommendation Using Machine Learning with Challenges and Future Ideas. Jour-
nal of IEEE Transactions on Artificial Intelligence.

[13] Garg, D., Alam, M. (2022). An Effective Crop Recommendation Method Using Ma-
chine Learning Techniques. International Journal of Advanced Technology and En-
gineering Exploration, 10(102). http://dx.doi.org/10.19101/IJATEE.2022.10100456

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 49


Optimizing Crop Selection And Profitability Through Machine
Learning-Based Recommendations
[14] AlZubi, A. A., Galyina, K. (2023). Artificial Intelligence and Internet
of Things for Sustainable Farming and Smart Agriculture. IEEE Access.
https://doi.org/10.1109/ACCESS.2023.3298215

SCTR’s PICT, Department of Computer Engineering 2024-25 Page 50

You might also like