Final Project Template-20-24 Batch-1
Final Project Template-20-24 Batch-1
BACHELOR OF TECHNOLOGY
IN
INFORMATION TECHNOLOGY
Submitted by
2023-24
ANIL NEERUKONDA INSTITUTE OF TECHNOLOGY AND
SCIENCES (AUTONOMOUS)
(Permanent Affiliation by Andhra University & Approved by AICTE
Accredited by NBA (ECE, EEE, CSE, IT, Mech. Civil & Chemical) & NAAC)
Sangivalasa, Bheemili Mandal, Visakhapatnam dist.(A.P)
CERTIFICATE
This is to certify that the project report entitled “CROP DISEASE PREDICTION”
submitted by R.Renusree (320126511046) , P.Lokeshwar (320126511042), Vivek
Vardhan(320126511019),RaghunathaReddy(321126511L04),in partial fulfillment of
the requirements for the award of the degree of Bachelor of Technology in Information
Technology of Anil Neerukonda Institute of technology and sciences, Visakhapatnam is
a record of bonafide work carried out under my guidance and supervision.
We would like to express our deep gratitude to our project guide Mr.B.Madhusudhana
Rao Assistant Professor, Department of Information Technology, ANITS, for his guidance
with unsurpassed knowledge and immense encouragement. We are grateful to Prof.
M.Rekha Sundari, Head of the Department, Information Technology, for providing us
with the required facilities for the completion of the project work.
We are very much thankful to the Principal and Management, ANITS,
Sangivalasa, for their encouragement and cooperation to carry out this work.
We express our thanks to all teaching faculty of the Department of IT, whose
suggestions during reviews helped us in accomplishment of our project. We would like
to thank all non-teaching staff of the Department of IT, ANITS, for providing great
assistance in the accomplishment of our project.
We would like to thank our parents, friends, and classmates for their
encouragement throughout our project period. At last but not the least, we thank everyone
for supporting us directly or indirectly in completing this project successfully.
PROJECT STUDENTS
R.Renusree(320126511046)
P.Lokeshwar(320126511042)
Vivek Vardhan(320126511019)
Raghunatha Reddy(321126511L04)
DECLARATION
We hereby declare that the project work entitled “ CROP DISEASE PREDICTION
” submitted to the Anil Neerukonda Institute of Technology and Sciences
is a record of an original work done byR.Renusree(320126511046),P.Lokeshwar
(320126511042), Vivek Vardhan(320126511019), Raghunatha Reddy(321126511L04),
under the esteemed guidance of Mr.B.Madhusudhana Rao Assistant Professor of
Information Technology, Anil Neerukonda Institute of Technology and Sciences, and this
project work is submitted in the partial fulfillment of the requirements for the award of
degree Bachelor of Technology in Information Technology. This entire project is done
with the best of our knowledge and has not been submitted for the award of any other
degree in any other universities.
R.Renusree(320126511046)
P.Lokeshwar(320126511042)
Vivek Vardhan(320126511019)
Raghunatha Reddy(321126511L04)
INDEX
Abstract i
List of Figures ii
List of Tables iii
List of Abbreviations iv
1. INTRODUCTION 13
1.1 Overview of Crop Diseases 14
1.2 Importance of Early Detection 15
1.3 Challenges in Current Prediction Methods 16
1.4vObjectives of Crop Disease Prediction 17
2. LITERATURE SURVEY 19
3. SYSTEM ANALYSIS 23
3.1 Existing System 24
3.2 Proposed System 26
3.3 Feasibility Study 26
3.3.1 Economical Feasibility 27
3.3.2 Technical Feasibility 27
3.3.3 Operational Feasibility 28
3.3.4 Social Feasibility 28
3.4 Requirement Specification 29
3.4.1 Hardware Requirements 30
3.4.2 Software Requirements 31
3.5 Language specifications 32
4.SYSTEM DESIGN 33
4.1 System Architecture 33
4.2 Use Case Diagram 34
4.3 Activity Diagram 35
4.4 Sequence Diagram 36
4.5 Class Diagram 37
4.6 ER Diagram 38
4.7 Data Flow Diagram 39
5.MODULE DESCRIPTION 40
5.1 Modules 40
5.2 Model Improvisation 41
5.3 Creating User Interface 42
6.CODING 43
6.1 firstpage.py 44
6.2 dataset_capture.py 46
7.TESTING 48
7.1 Types of Testing 48
7.1.1 Unit Testing 49
7.1.2 Integration Testing 49
7.1.3 Functional Testing 49
7.1.4 Black Box Testing 50
7.1.5 White Box Testing 50
8.RESULTS 51
9.CONCLUSION 52
9.1 Conclusion
9.2 Future Enhancements
10.REFERENCES 53
11.PAPER PUBLICATIONS WITH PLAGIARISM REPORT 53
LIST OF FIGURES
5 4.2.5 ER Diagram 35
1. Rautaray, S. S., Pandey, M., Gourisaria, M. K., Sharma, R., & Das, S. (2020). Paddy crop
disease prediction—a transfer learning technique. International Journal of Recent Technology and
Engineering, 8(6), 1490-1495.
2. Khamparia, A., Saini, G., Gupta, D., Khanna, A., Tiwari, S., & de Albuquerque, V. H. C.
(2020). Seasonal crops disease prediction and classification using deep convolutional encoder
network. Circuits, Systems, and Signal Processing, 39, 818-836.
3. Udutalapally, V., Mohanty, S. P., Pallagani, V., & Khandelwal, V. (2020). sCrop: A novel
device for sustainable automatic disease prediction, crop selection, and irrigation in Internet-of-
Agro-Things for smart agriculture. IEEE Sensors Journal, 21(16), 17525-17538.
4. Kundu, N., Rani, G., Dhaka, V. S., Gupta, K., Nayaka, S. C., Vocaturo, E., & Zumpano, E.
(2022). Disease detection, severity prediction, and crop loss estimation in MaizeCrop using deep
learning. Artificial Intelligence in Agriculture, 6, 276-291.
5. Fenu, G., & Malloci, F. M. (2021). Forecasting plant and crop disease: an explorative study on
current algorithms. Big Data and Cognitive Computing, 5(1), 2.
6. Sharma, R., Das, S., Gourisaria, M. K., Rautaray, S. S., & Pandey, M. (2020). A model for
prediction of paddy crop disease using CNN. In Progress in Computing, Analytics and
Networking: Proceedings of ICCAN 2019 (pp. 533-543). Singapore: Springer Singapore.
7. Domingues, T., Brandão, T., & Ferreira, J. C. (2022). Machine learning for detection and
prediction of crop diseases and pests: A comprehensive survey. Agriculture, 12(9), 1350.
8. Ouhami, M., Hafiane, A., Es-Saady, Y., El Hajji, M., & Canals, R. (2021). Computer vision,
IoT and data fusion for crop disease detection using machine learning: A survey and ongoing
research. Remote Sensing, 13(13), 2486.
9. Kundu, N., Rani, G., Dhaka, V. S., Gupta, K., Nayak, S. C., Verma, S., ... & Woźniak, M.
(2021). IoT and interpretable machine learning based framework for disease prediction in pearl
millet. Sensors, 21(16), 5386.
10. Liu, Z., Bashir, R. N., Iqbal, S., Shahid, M. M. A., Tausif, M., & Umer, Q. (2022). Internet of
Things (IoT) and machine learning model of plant disease prediction–blister blight for tea plant.
Ieee Access, 10, 44934-44944.
Performance
Author Name Objective Methodology Metrics Demerits
Introduce sCrop
[3] Udutalapally, device for
Limited
V., Mohanty, S. P., sustainable
Efficiency, crop compatibility with
Pallagani, V., & automatic disease sCrop device
selection accuracy diverse agricultural
Khandelwal, V. prediction, crop
environments
(2020) selection, and
irrigation
Investigate current
[5] Fenu, G., &
algorithms for Advanced Accuracy, early Vulnerability to
Malloci, F. M.
forecasting plant algorithms detection capability adversarial attacks
(2021)
and crop disease
Conduct
comprehensive
[7] Domingues, T., Lack of
survey on machine
Brandão, T., & Machine learning Detection and standardized
learning for
Ferreira, J. C. techniques prediction accuracy datasets for
detection and
(2022) benchmarking
prediction of crop
diseases and pests
The existing system for crop disease prediction involves the use of various methods and
technologies to identify and forecast potential threats to crop health. These methods typically
include manual observation by farmers, consultation with agricultural experts, and the use of
traditional knowledge and experience. In recent years, there has been a shift towards
incorporating more advanced technologies such as remote sensing, satellite imagery, and machine
learning algorithms to improve the accuracy and efficiency of disease prediction. Remote sensing
tools can detect subtle changes in crop health and provide early warnings of potential disease
outbreaks, while machine learning models can analyze vast amounts of data to identify patterns
and predict the likelihood of disease occurrence. Despite these advancements, the existing system
still faces challenges such as limited access to technology in remote areas, the need for continuous
monitoring and updating of data, and the integration of different data sources for more
comprehensive predictions. Efforts are being made to address these challenges and improve the
existing system by expanding access to technology, enhancing data collection and analysis
capabilities, and promoting collaboration between stakeholders in the agricultural sector. By
leveraging the potential of advanced technologies and methods, the existing system for crop
disease prediction is continually evolving to better protect and support global food security.The
existing system for crop disease prediction has several disadvantages that hinder its effectiveness
and reliability. One major drawback is the limitation in the accuracy of disease identification and
prediction, which often leads to misdiagnosis and ineffective management strategies. This can
result in significant crop losses and financial burdens on farmers. Additionally, the current system
relies heavily on manual data collection and analysis, making it time-consuming and labor-
intensive. This often leads to delays in detecting and responding to disease outbreaks, further
exacerbating the agricultural losses. Furthermore, the existing system may not take into account
all relevant factors that contribute to disease development, such as weather patterns, soil
conditions, and pest infestations. As a result, the predictions made by the system may not be
comprehensive or reliable enough to guide farmers in making informed decisions. Lastly, the lack
of integration with modern technologies such as machine learning and data analytics limits the
system's potential for real-time monitoring and early warning systems. Overall, the existing
system for crop disease prediction faces various challenges that hinder its ability to accurately
predict and prevent diseases, highlighting the need for more advanced and integrated solutions in
agricultural management.
The proposed system for crop disease prediction aims to utilize machine learning algorithms and
agricultural data to accurately predict and diagnose diseases affecting crops. By incorporating
historical data on various crop diseases, weather patterns, soil conditions, and agricultural
practices, the system will be able to identify patterns and trends that contribute to the onset of
diseases. Farmers and agronomists can input data such as crop type, location, and symptoms
observed, allowing the system to analyze the information and provide real-time recommendations
for disease prevention and management. Through the use of image recognition technology, the
system can also analyze images of diseased crops to identify the specific disease and suggest
appropriate treatment measures. Additionally, the system will have a user-friendly interface
accessible through mobile devices, making it convenient for farmers to input data and receive
timely insights on crop health. By accurately predicting crop diseases early on, farmers can take
proactive measures to mitigate the spread of diseases, minimize crop damage, and ultimately
improve overall crop yields. Overall, the proposed system for crop disease prediction represents a
valuable tool for farmers to enhance their decision-making processes and optimize crop health
and productivity.The proposed system for crop disease prediction offers various advantages that
can significantly improve agricultural practices. Firstly, the system utilizes advanced machine
learning algorithms and artificial intelligence technology to accurately predict and identify
potential diseases affecting crops at an early stage. This early detection capability helps farmers to
take timely preventive measures and minimize the spread of diseases, resulting in higher crop
yields and improved agricultural productivity. Additionally, the system provides personalized
recommendations for disease management based on specific crop types, regions, and
environmental conditions, allowing farmers to implement targeted and effective treatment
strategies. Furthermore, the system can be integrated with smart farming technologies and sensors
to monitor crop health in real-time, enabling continuous surveillance and proactive disease
control. By leveraging big data analytics and cloud computing, the system can also analyze vast
amounts of agricultural data to identify patterns and trends that can further enhance disease
prediction accuracy. Overall, the proposed system enhances decision-making processes for
farmers, reduces reliance on chemical interventions, promotes sustainable farming practices, and
ultimately contributes to a more efficient and resilient agricultural industry.
A feasibility study for crop disease prediction involves assessing the practicality and potential
success of implementing a system that can accurately predict and manage diseases affecting
crops. The study would focus on evaluating the technical aspects, such as the availability of data
sources, the feasibility of utilizing machine learning algorithms for prediction, and the accuracy
of the models developed. It would also consider the economic aspects, assessing the cost of
implementing and maintaining the system, as well as the potential benefits in terms of increased
crop yields and reduced losses due to diseases. The study would also explore the operational
aspects, including the skills and expertise required to develop and manage the prediction system,
as well as the feasibility of integrating it into existing agricultural practices. Additionally, the
study would analyze the environmental impact of implementing such a system, considering
factors such as potential reductions in pesticide usage and environmental benefits from more
targeted disease management. Overall, the feasibility study for crop disease prediction would aim
to determine whether the benefits of implementing such a system outweigh the costs and
challenges involved, providing valuable insights for decision-makers in the agriculture sector.
Economic feasibility refers to the analysis of whether a particular project or initiative makes
financial sense and is justifiable in terms of the benefits it can bring compared to the costs
involved. In the context of crop disease prediction, economic feasibility plays a crucial role in
determining the potential value and impact of implementing predictive models or technologies to
mitigate the risks associated with crop diseases.
Crop diseases pose a significant threat to agricultural productivity and can lead to substantial
economic losses for farmers and food supply chains. By implementing effective disease
prediction systems, farmers can proactively manage and mitigate the risks of crop diseases,
leading to improved yields, reduced losses, and overall increased profitability.
Investing in crop disease prediction technologies can be economically feasible when considering
the long-term benefits they bring. By accurately predicting the onset and spread of diseases,
farmers can make informed decisions on timely interventions such as applying targeted
treatments, adjusting planting schedules, or implementing crop rotations. This proactive approach
can help prevent yield losses, optimize resource use, and ultimately improve the financial
viability of farming operations.
Furthermore, the economic feasibility of crop disease prediction can be enhanced through the use
of cost-effective technologies such as satellite imagery, remote sensing, machine learning
algorithms, and data analytics. These tools can provide real-time monitoring and analysis of crop
health indicators, enabling early detection of diseases and precise interventions, thus maximizing
the economic returns for farmers.
Ultimately, the economic feasibility of implementing crop disease prediction systems depends on
various factors such as the costs of technology adoption, the accuracy of predictive models, the
scalability of solutions, and the potential returns on investment. By conducting thorough cost-
benefit analyses and considering both short-term and long-term impacts, stakeholders can assess
the economic viability of integrating disease prediction technologies into their agricultural
practices for sustainable and profitable crop production.
Technical feasibility is an important aspect to consider when developing a crop disease prediction
system. In the context of agriculture, the predictive model needs to be technically feasible to
enable accurate and timely identification of potential diseases affecting crops. Here are some key
points to consider when evaluating the technical feasibility of a crop disease prediction system:
1. Data Availability: One of the fundamental requirements for developing a crop disease
prediction model is the availability of relevant data. This includes historical data on crop diseases,
weather patterns, soil conditions, and other relevant variables that can influence the occurrence of
diseases. Ensuring a consistent and reliable source of data is essential for the accuracy of the
predictive model.
2. Data Quality: In addition to data availability, the quality of the data plays a crucial role in the
technical feasibility of the predictive model. The data used for training the model should be
accurate, up-to-date, and representative of the real-world conditions. Data preprocessing
techniques such as cleaning, filtering, and normalization may be required to ensure the data is
suitable for training the model.
3. Model Selection: Choosing the right machine learning algorithm or model architecture is a key
consideration for the technical feasibility of crop disease prediction. The selected model should be
able to effectively learn from the input data and make accurate predictions based on the available
information. Factors such as performance metrics, computational requirements, and scalability
should be taken into account when selecting the model.
4. Implementation and Integration: Once a suitable predictive model has been developed, it needs
to be implemented and integrated into existing agricultural systems. This involves deploying the
model on appropriate hardware and software platforms, as well as ensuring seamless
communication with other agricultural technologies or data sources. Compatibility with existing
infrastructure and ease of integration are important factors for technical feasibility.
5. Scalability and Performance: A technically feasible crop disease prediction system should be
able to scale up to handle large volumes of data and make predictions in real-time. The model
should also exhibit high performance in terms of accuracy, speed, and resource utilization.
Regular monitoring and evaluation of the system’s performance are essential to ensure its
technical feasibility over time.
To ensure operational feasibility in crop disease prediction, several key factors need to be taken
into consideration. Firstly, the system should be user-friendly and easily accessible to farmers
who may not have advanced technical expertise. This can involve developing a simple and
intuitive interface for inputting data, accessing predictions, and receiving alerts about potential
diseases affecting their crops.
Another important aspect of operational feasibility is the integration of the prediction system with
existing agricultural practices and workflows. This can involve seamless data sharing capabilities
with farm management software, weather monitoring systems, and other relevant tools used by
farmers. Compatibility with different types of devices, such as smartphones, tablets, and
computers, is also vital to ensure widespread adoption and usability.
Moreover, the scalability of the crop disease prediction system is crucial for its long-term success.
The system should be able to accommodate a growing number of users, handle large volumes of
data, and provide accurate predictions for various crops and regions. Regular updates and
maintenance are necessary to keep the system relevant and effective in predicting emerging crop
diseases.
Overall, operational feasibility plays a significant role in the successful implementation of a crop
disease prediction system. By addressing user needs, integrating with existing workflows,
ensuring scalability, and providing ongoing support and maintenance, organizations can enhance
the usability and effectiveness of the system for farmers and other stakeholders in the agricultural
sector.
3.3.4 SOCIAL FEASIBILITY
Social feasibility is a critical component of any project or initiative, including crop disease
prediction. It refers to the extent to which a proposed solution or technology is acceptable and
beneficial to the society in which it will be implemented. In the context of crop disease prediction,
social feasibility entails considering the impact that the implementation of such a system will
have on farmers, agricultural communities, and broader society.
There are several key aspects to consider when assessing the social feasibility of crop disease
prediction technology. Firstly, it is important to evaluate how the technology will benefit farmers
and improve agricultural practices. By accurately predicting crop diseases, farmers can take
proactive measures to protect their crops, reduce losses, and improve yields. This can have a
significant positive impact on food security, livelihoods, and economic development in rural
communities.
Additionally, social feasibility entails analyzing the accessibility and affordability of the
technology. It is essential that crop disease prediction tools are user-friendly, easy to access, and
affordable for farmers, especially small-scale farmers in low-income areas. Moreover,
considerations must be made to ensure that the technology does not exacerbate existing social
inequalities or marginalize certain groups within the farming community.
Another crucial aspect of social feasibility is community acceptance and participation. Engaging
with local farmers, agricultural organizations, and other stakeholders is essential to ensure that the
technology meets their needs and is culturally appropriate. Building trust, fostering collaboration,
and incorporating local knowledge and practices are key to the successful implementation of crop
disease prediction systems.
In conclusion, ensuring the social feasibility of crop disease prediction technology is vital for its
successful implementation and impact. By considering the needs, preferences, and capabilities of
farmers and communities, we can develop solutions that are truly beneficial, sustainable, and
inclusive. Through effective stakeholder engagement, accessibility, affordability, and community
involvement, we can harness the potential of technology to improve agricultural productivity,
resilience, and food security for all.
System architecture refers to the high-level structure of a complex system and how its
components interact with each other. It involves designing the overall layout, behavior, and
functionality of the system to meet specific requirements. A well-designed system architecture
ensures that all components work together seamlessly, are scalable, and maintainable. It provides
a blueprint for developers to follow during the implementation phase. Key considerations in
system architecture include performance, security, reliability, and scalability. It is crucial for
ensuring the success of a system as it influences its efficiency, flexibility, and ability to adapt to
changing requirements and environments.
Fig 4.1 SYSTEM ARCHITECTURE
4.2 USE CASE DIAGRAM
A Use Case Diagram for crop disease prediction would showcase the different interactions
between users and the system. Actors such as farmers, agricultural experts, and system
administrators would be involved. The main use cases would include "Input Symptoms" where
users provide information on crop symptoms, "Run Prediction Algorithm" for the system to
analyze the data, and "Display Results" to show the predicted disease. Additional use cases may
involve "Alert Notifications" for notifying users of potential diseases and "View Reports" for
accessing detailed analysis. Overall, the Use Case Diagram would visually represent how
different users interact with the system for effective crop disease prediction.
Fig 4.2 USE CASE DIAGRAM
An activity diagram for crop disease prediction would visually represent the flow of activities and
decision points involved in the prediction process. It would typically start with the initiation of the
prediction task, followed by steps such as data collection, preprocessing, feature extraction, model
training, evaluation, and result prediction. Decision points may include criteria for selecting the
appropriate machine learning algorithm, adjusting model parameters, and determining the accuracy
threshold for predicting crop diseases. The diagram would provide a clear and structured
overview of the entire prediction process, helping stakeholders understand the sequence of
activities and interactions involved in predicting crop diseases accurately.
A sequence diagram is a visual representation that illustrates the interactions between different
components or actors in a system to accomplish a specific task or scenario. In the context of crop
disease prediction, a sequence diagram would show the sequence of events and communication
flow between different elements such as the data sources (e.g., sensors, weather forecasts), the
prediction model, and the end user (e.g., farmer). This diagram would help visualize how data is
collected, processed, and utilized in the prediction process, highlighting the steps involved in
detecting and predicting crop diseases. It provides a clear overview of the system's behavior and
interactions during the prediction process, aiding in understanding and refining the overall
operation.
4.6 ER DIAGRAM
An Entity-Relationship (ER) diagram for crop disease prediction can illustrate the key entities
involved in the system, their attributes, and the relationships between them. Entities in this
context may include crops, diseases, symptoms, treatments, and regions. Attributes for crops
could include name, type, and growth stage, while disease attributes might include name,
symptoms, and severity. Relationships can show how crops are affected by diseases, which
symptoms are associated with each disease, and which treatments are recommended for specific
diseases. By visually representing these elements and their connections, an ER diagram helps in
designing a comprehensive crop disease prediction system for effective monitoring and
management.
A Data Flow Diagram (DFD) is a visual representation of how data flows within a system. It
illustrates the processes that transform data, the data stores where information is held, and the
entities that interact with the system. DFDs use symbols to represent these components and show
the flow of data between them. They help in understanding the logical structure of a system,
identifying data inputs and outputs, and clarifying the relationship between different elements.
DFDs are a useful tool for analyzing and optimizing processes, as well as for communicating
system requirements to stakeholders in a clear and concise manner.
5.1 MODULES
2. The use of deep learning models, like convolutional neural networks, can also be effective in
crop disease prediction by analyzing images of plants to detect early signs of diseases. These
models can learn to recognize disease symptoms and provide real-time monitoring and alerts to
farmers, enabling them to take preventive measures in a timely manner.
3. Transfer learning, where pre-trained models are fine-tuned on specific crop disease datasets,
can expedite the training process and improve prediction accuracy. By leveraging the knowledge
learned from one crop to another, transfer learning can effectively address data scarcity issues and
enhance the performance of predictive models for various crops.
Database
In the context of crop disease prediction, model selection and evaluation are crucial steps in
developing a reliable and accurate predictive system. Firstly, in model selection, it is important to
consider the complexity and interpretability of the models to ensure they are suitable for the
domain. Various machine learning algorithms such as decision trees, random forests, and support
vector machines can be considered and compared based on their performance metrics. Secondly,
evaluation of the selected model involves assessing its performance using appropriate metrics
such as accuracy, precision, recall, and F1-score. Cross-validation techniques can be employed to
validate the model's generalizability and robustness to unseen data. Ultimately, the chosen model
should demonstrate high predictive performance and be interpretable for stakeholders to make
informed decisions regarding crop disease management.
Security
1. Machine learning algorithms, such as decision trees and random forests, can be trained using
historical data on crop disease outbreaks and environmental conditions to predict future
occurrences. By analyzing patterns in the data, these algorithms can identify potential risk factors
and forecast disease outbreaks with a certain level of accuracy.
2. The use of deep learning models, like convolutional neural networks, can also be effective in
crop disease prediction by analyzing images of plants to detect early signs of diseases. These
models can learn to recognize disease symptoms and provide real-time monitoring and alerts to
farmers, enabling them to take preventive measures in a timely manner.
3. Transfer learning, where pre-trained models are fine-tuned on specific crop disease datasets,
can expedite the training process and improve prediction accuracy. By leveraging the knowledge
learned from one crop to another, transfer learning can effectively address data scarcity issues and
enhance the performance of predictive models for various crops.
CHAPTER 6
CODING
1. import streamlit as
st from PIL import
Image import torch
import torchvision.transforms.functional as
TF import cnn_model
import numpy as np
import pandas as pd
def predict_plant_disease(image):
# Function for plant disease prediction image
= image.resize((224, 224)) input_data =
TF.to_tensor(image) input_data =
input_data.view((-1, 3, 224, 224))
with torch.no_grad():
output = model(input_data)
output = output.detach().numpy()
index = np.argmax(output)
return index
if "Healthy" in predicted_disease:
st.success(f"The plant is healthy.")
else:
# Fetch additional information from the CSV based on the predicted disease
disease_info_row = disease_info[disease_info['disease_name'] ==
predicted_disease].iloc[0]
st.success(f"The plant is predicted to have: {predicted_disease}")
2 . import pandas as pd
import torch.nn as nn
class CNN(nn.Module):
def _init_(self, K):
super(CNN, self)._init_()
self.conv_layers = nn.Sequential(
# conv1
nn.Conv2d(in_channels=3, out_channels=32,
kernel_size=3, padding=1),
nn.ReLU(),
nn.BatchNorm2d(32),
nn.Conv2d(in_channels=32, out_channels=32,
kernel_size=3, padding=1),
nn.ReLU(),
nn.BatchNorm2d(32),
nn.MaxPool2d(2),
# conv2
nn.Conv2d(in_channels=32, out_channels=64,
kernel_size=3, padding=1),
nn.ReLU(),
nn.BatchNorm2d(64),
nn.Conv2d(in_channels=64, out_channels=64,
kernel_size=3, padding=1),
nn.ReLU(),
nn.BatchNorm2d(64),
nn.MaxPool2d(2),
# conv3
nn.Conv2d(in_channels=64, out_channels=128,
kernel_size=3, padding=1),
nn.ReLU(),
nn.BatchNorm2d(128),
nn.Conv2d(in_channels=128, out_channels=128,
kernel_size=3, padding=1),
nn.ReLU(),
nn.BatchNorm2d(128),
nn.MaxPool2d(2),
# conv4
nn.Conv2d(in_channels=128, out_channels=256,
kernel_size=3, padding=1),
nn.ReLU(),
nn.BatchNorm2d(256),
nn.Conv2d(in_channels=256, out_channels=256,
kernel_size=3, padding=1),
nn.ReLU(),
nn.BatchNorm2d(256),
nn.MaxPool2d(2),
)
self.dense_layers = nn.Sequential(
nn.Dropout(0.4),
nn.Linear(50176, 1024),
nn.ReLU(),
nn.Dropout(0.4),
nn.Linear(1024, K),
)
# Flatten
out = out.view(-1, 50176)
# Fully connected
out = self.dense_layers(out)
return out
Discovering and fixing such problems is what testing is all about. The purpose of testing is to find
and correct any problems with the final product. It's a method for evaluating the quality of the
operation of anything from a whole product to a single component. The goal of stress testing
software is to verify that it retains its original functionality under extreme circumstances. There
are several different tests from which to pick. Many tests are available since there is such a vast
range of assessment options.
Who Performs the Testing: All individuals who play an integral role in the software development
process are responsible for performing the testing. Testing the software is the responsibility of a
wide variety of specialists, including the End Users, Project Manager, Software Tester, and
Software Developer.
When it is recommended that testing begin: Testing the software is the initial step in the process.
begins with the phase of requirement collecting, also known as the Planning phase, and ends with
the stage known as the Deployment phase. In the waterfall model, the phase of testing is where
testing is explicitly arranged and carried out. Testing in the incremental model is carried out at the
conclusion of each increment or iteration, and the entire application is examined in the final test.
When it is appropriate to halt testing: Testing the programme is an ongoing activity that will
never end. Without first putting the software through its paces, it is impossible for anyone to
guarantee that it is completely devoid of errors. Because the domain to which the input belongs is
so expensive, we are unable to check every single input.
7.1 TYPES OF TESTING
Testcase1: Testing the function that processes input data for disease prediction. This test case
should verify if the function correctly handles different types of input data, such as sensor
readings or image data.
Testcase2: Testing the function that calculates the probability of a crop being infected with a
disease. This testcase should check if the function accurately produces the expected probability
output based on different input scenarios.
Testcase3: Testing the function that generates a prediction result based on the calculated
probabilities. This testcase should validate if the function correctly classifies the crop as either
healthy or diseased based on the predicted probabilities.
Testcase1: Integration of data collection module with prediction algorithm - Verify that the data
collected from various sources is accurately processed by the prediction algorithm to provide
correct disease predictions.
Testcase2: Integration of prediction algorithm with user interface - Test that the disease
predictions generated by the algorithm are displayed correctly on the user interface with proper
formatting and relevant information.
Testcase3: Integration of notification system with prediction results - Confirm that the system
successfully sends timely notifications to farmers based on the disease predictions, ensuring they
receive alerts when necessary for crop disease prevention.
Overall, integration testing plays a crucial role in ensuring the seamless operation of the crop
disease prediction system by checking the communication and functionality between its
components.
7.1.3 FUNCTIONAL TESTING
Functional testing for crop disease prediction involves verifying that the system accurately
predicts crop diseases based on given input data. Testers examine the system's functions to ensure
that it performs as expected and meets the specified requirements.
Testcase1: Inputting specific crop data known to be associated with a particular disease and
checking if the system accurately identifies and predicts that disease.
Testcase2: Providing incomplete or invalid data to assess how the system handles errors and
ensures proper error handling.
Testcase3: Testing the system's ability to handle a large dataset of different crops and diseases to
validate its scalability and performance under varied conditions.
Functional testing plays a crucial role in validating the effectiveness and accuracy of crop disease
prediction systems, ensuring that farmers receive reliable insights to protect their crops.
Testcase1: Input a set of weather data for a specific location and crop type, and verify that the
system accurately predicts the likelihood of disease outbreak.
Testcase2: Input historical data of crop diseases for a particular region and verify that the system
correctly identifies patterns and trends to predict future disease occurrences.
Testcase3: Provide varying levels of soil moisture content as input data and test if the system can
accurately predict the risk of fungal diseases based on these variations.
7.1.5 WHITE BOX TESTING
White box testing for crop disease prediction involves testing the internal logic of the system to
ensure it functions as expected. This includes examining the code, data flows, and algorithms
used in the prediction model. It is important to test all possible pathways and conditions to
guarantee accurate and reliable results.
Testcase1: Verify that the input data is correctly parsed and stored in the database. This can be
done by inputting a set of sample data and checking that it is saved accurately.
Testcase2: Test the prediction algorithm by providing different combinations of input variables
and verifying that the predicted disease matches the expected result. This helps ensure the
accuracy of the prediction model.
Testcase3: Assess the system's ability to handle edge cases, such as extreme weather conditions
or unusual patterns in the data. By testing these scenarios, you can check if the system responds
appropriately and provides accurate predictions even in unpredictable situations.
CHAPTER 8
RESULTS
CHAPTER 9
CONCLUSION
9.1 CONCLUSION
In conclusion, the use of machine learning algorithms for crop disease prediction presents
immense potential for revolutionizing agricultural practices and ensuring food security
worldwide. By utilizing various data sources such as weather patterns, soil conditions, and plant
characteristics, these algorithms can accurately identify and predict potential disease outbreaks in
crops. Early detection of diseases allows farmers to take timely preventive measures, thereby
minimizing crop loss and increasing yields. Furthermore, the implementation of crop disease
prediction models can aid in reducing the reliance on chemical pesticides, promoting sustainable
farming practices that are environmentally friendly. However, for these models to be effective,
continuous validation and improvement are necessary to enhance their accuracy and reliability.
Additionally, efforts should be made to make these technologies more accessible and user-
friendly to farmers, especially in developing regions. Overall, integrating machine learning-based
crop disease prediction systems into agricultural processes has the potential to significantly
improve crop management practices, enhance productivity, and contribute to global food security
in a more sustainable manner.
Rautaray, S. S., Pandey, M., Gourisaria, M. K., Sharma, R., & Das, S. (2020). Paddy crop disease
prediction—a transfer learning technique. International Journal of Recent Technology and
Engineering, 8(6), 1490-1495.
Khamparia, A., Saini, G., Gupta, D., Khanna, A., Tiwari, S., & de Albuquerque, V. H. C. (2020).
Seasonal crops disease prediction and classification using deep convolutional encoder network.
Circuits, Systems, and Signal Processing, 39, 818-836.
Udutalapally, V., Mohanty, S. P., Pallagani, V., & Khandelwal, V. (2020). sCrop: A novel device
for sustainable automatic disease prediction, crop selection, and irrigation in Internet-of-Agro-
Things for smart agriculture. IEEE Sensors Journal, 21(16), 17525-17538. Kundu, N., Rani, G.,
Dhaka, V. S., Gupta, K., Nayaka, S. C., Vocaturo, E., & Zumpano, E. (2022).
Disease detection, severity prediction, and crop loss estimation in MaizeCrop using deep learning.
Artificial Intelligence in Agriculture, 6, 276-291.
Fenu, G., & Malloci, F. M. (2021). Forecasting plant and crop disease: an explorative study on
current algorithms. Big Data and Cognitive Computing, 5(1), 2.
Sharma, R., Das, S., Gourisaria, M. K., Rautaray, S. S., & Pandey, M. (2020). A model for
prediction of paddy crop disease using CNN. In Progress in Computing, Analytics and
Networking: Proceedings of ICCAN 2019 (pp. 533-543). Singapore: Springer Singapore.
Domingues, T., Brandão, T., & Ferreira, J. C. (2022). Machine learning for detection and
prediction of crop diseases and pests: A comprehensive survey. Agriculture, 12(9), 1350.
Ouhami, M., Hafiane, A., Es-Saady, Y., El Hajji, M., & Canals, R. (2021). Computer vision, IoT
and data fusion for crop disease detection using machine learning: A survey and ongoing
research. Remote Sensing, 13(13), 2486.
Kundu, N., Rani, G., Dhaka, V. S., Gupta, K., Nayak, S. C., Verma, S., ... & Woźniak, M. (2021).
IoT and interpretable machine learning based framework for disease prediction in pearl millet.
Sensors, 21(16), 5386.
Liu, Z., Bashir, R. N., Iqbal, S., Shahid, M. M. A., Tausif, M., & Umer, Q. (2022). Internet of
Things (IoT) and machine learning model of plant disease prediction–blister blight for tea plant.
Ieee Access, 10, 44934-44944.
CHAPTER 11
PAPER PUBLICATION
IJNRD2404117.pdf
PLAGIARISM REPORT
DB_report_Crop disease predictionpaper-1.pdf