DL Report1
DL Report1
BY
Certificate
This is to certify that the Mini Project Report on
SUBMITTED BY
in the partial fulfillment of the requirement for the award of Degree of Bachelor of
Engineering in Computer Engineering at Vidya Pratishthan’s Kamalnayan Bajaj
Institute of Engineering and Technology, Baramati, under the Savitribai Phule Pune
University, Pune. This work is done during year 2024-25 Semester-II, under guidance.
Mrs. S.S.Nandgaonkar
Project Guide
i
Acknowledgements
We, the undersigned, would like to express our heartfelt gratitude to Prof. S. S. Nandgaonkar
our project mentor, for providing valuable guidance and support throughout the course
of this project. We also extend our appreciation to the department of Computer Engi-
neering, VPKBIET, for offering us this opportunity.
We are particularly thankful to our project guide for their insightful feedback and tech-
nical advice, which greatly enhanced the quality of our work. Finally, we wish to ac-
knowledge the immense help and moral support from our friends, and fellow students
throughout the duration of this project.
1
Abstract
Agriculture forms a vital part of human existence, providing food, raw materials, and
employment globally. However, plant growth and crop yield are significantly affected by
nutritional deficiencies. Essential nutrients such as nitrogen, phosphorus, potassium,
magnesium, and iron are crucial for plant health. Deficiency symptoms often manifest in
plant leaves through discoloration, deformation, and growth inhibition. Manual
identification of these symptoms is time-consuming, error-prone, and requires expert
knowledge. To address these challenges, we propose an automated system that uses
deep learning techniques, particularly Convolutional Neural Networks (CNNs), to detect
and classify nutritional deficiencies in crops based on leaf images. This project
encompasses image acquisition, preprocessing, deep learning model design, training,
evaluation, and deployment. By automating deficiency detection, the system aims to
assist farmers in making timely, informed decisions, thereby enhancing agricultural
productivity and sustainability.
.
.
2
Chapter 1
Introduction
Agricultural productivity hinges heavily on the health of crops, which in turn depends on the
availability of essential nutrients. When plants experience nutrient deficiencies, they exhibit
specific visual symptoms predominantly in their leaves. Traditional diagnosis methods rely on
physical inspection, laboratory testing, and expert agronomical analysis, which are resource-
intensive and impractical for small-scale farmers or remote locations.
Advances in deep learning, particularly in computer vision, offer a promising alternative. Deep
learning models can automatically extract relevant features from images and perform
classification tasks with high accuracy, making them suitable for diagnosing plant health
issues. By leveraging these techniques, this project seeks to develop an intelligent system
capable of identifying and categorizing nutritional deficiencies in crops through simple leaf
image analysis.
With the growing accessibility of smartphones and affordable imaging devices, farmers now
have the ability to capture high-quality images of their crops directly from the field. Combining
this accessibility with deep learning models enables the development of mobile or web-based
applications that provide real-time deficiency diagnosis. Such systems not only reduce
dependency on expert agronomists but also empower farmers with immediate, data-driven
insights, leading to timely corrective actions, optimized fertilizer usage, improved crop yield,
and enhanced sustainability in agriculture.
3
Chapter 2
Problem Statement
The accurate identification of nutritional deficiencies in crops is vital for ensuring plant
health, improving agricultural yield, and promoting food security. Traditional methods
such as expert visual inspection and laboratory soil or tissue analysis are costly, time-
consuming, and often inaccessible to farmers in rural and underdeveloped areas. There
is a pressing need for an automated, scalable solution that can diagnose nutritional
deficiencies quickly and accurately based on visual symptoms observed in crop leaves.
Description :
Plants exhibit distinct visual symptoms when suffering from nutrient deficiencies, including
discoloration (yellowing, purpling, browning), stunted growth, leaf deformation, and necrosis.
However, these symptoms can vary across crop types and environmental conditions, making
manual identification challenging even for experienced agronomists. The process is further
complicated by factors such as varying light conditions, background noise in images, different
leaf stages, and co-occurring plant diseases or pests. To overcome these challenges, the use
of deep learning—specifically Convolutional Neural Networks (CNNs)—provides a powerful
solution by automatically learning hierarchical patterns in leaf images without the need for
manual feature extraction. This project proposes the development of a deep learning-based
system capable of classifying different types of nutrient deficiencies from leaf images,
enabling real-time, field-level diagnosis. By leveraging accessible technologies like
smartphones and integrating the solution into user-friendly platforms, the system aims to
democratize access to expert-level diagnosis, thus promoting precision agriculture, reducing
resource wastage, optimizing fertilizer use, and supporting global food security initiatives.
4
Chapter 3
Dataset Description
For the successful training and evaluation of the deep learning model, a diverse and well-
annotated dataset of crop leaf images is essential. The dataset used in this project
consists of high-quality images of crop leaves exhibiting various types of nutritional
deficiencies, as well as healthy leaves for baseline classification. Each image is labeled
according to the specific deficiency it represents, allowing the model to learn visual
patterns associated with different nutrient shortages.
The dataset incorporates variations in lighting conditions, backgrounds, image
resolutions, and crop types to ensure that the model can generalize well to real-world
scenarios. Images are collected from public agricultural datasets, research institutions,
and field surveys to maintain diversity and authenticity.
5
Chapter 4
6
Fig.4.1 System Architecture
7
4.1 Working
1. Input Image
• The image can be captured in the field using mobile cameras or uploaded from a
local device.
2. Image Preprocessing
The input image is prepared for clustering through the following steps:
• The input image is resized to a standard resolution (e.g., 224×224 pixels) to maintain
uniformity.
• Pixel values are normalized to a range between 0 and 1 to speed up and stabilize the
learning process.
• If necessary, color adjustments and noise reduction filters are applied to enhance feature
clarity.
• This improves the model’s ability to generalize across different lighting, angles, and
leaf orientations.
8
5. Classification
• The extracted features are fed into fully connected dense layers.
• The final softmax layer outputs a probability distribution across all defined deficiency
classes (e.g., Nitrogen Deficiency, Magnesium Deficiency, Healthy).
• The class with the highest probability is selected as the final prediction.
6. Output Display
• The system may also visualize the affected area on the leaf image using heatmaps in advanced
versions.
• Based on the detected deficiency, the system can suggest corrective actions
9
Chapter 5
Algorithms
In this project, deep learning techniques were utilized to classify crop images into their
corresponding nutritional deficiency categories. A Convolutional Neural Network (CNN)
architecture was selected for its effectiveness in capturing complex visual features such
as color changes, texture variations, and shape deformations. Unlike traditional
classification methods like K-Nearest Neighbors (KNN) or Support Vector Machines
(SVM), deep learning models are capable of learning non-linear mappings and subtle
variations in image patterns, which is essential when predicting from a wide set of
deficiency types (e.g., Nitrogen, Phosphorus, Potassium deficiencies).
The model was trained on a dataset containing images of healthy and nutrient-deficient
crops. The images were resized, normalized, and passed through multiple convolutional
layers, allowing the network to learn rich feature representations. The goal was to make
accurate predictions of deficiency types, even when symptoms are visually similar but
semantically different (e.g., “Nitrogen Deficiency” vs. “Magnesium Deficiency”).
In this project, the CNN is composed of multiple convolutional layers, pooling layers,
dropout regularization, and a softmax-based output layer. Each convolutional layer enables
the model to learn higher-order interactions among the pixel intensities. The final output
layer provides a probability distribution over all deficiency classes, enabling accurate
10
classification.
• Input Layer: Accepts images resized to (224 × 224 × 3) pixels with normalized values
between 0 and 1.
• Convolutional Layer (32 filters, 3x3, ReLU): Detects basic features like edges and
color changes.
• MaxPooling Layer (2x2): Reduces the spatial dimension to retain essential features
while lowering computational load.
• Convolutional Layer (64 filters, 3x3, ReLU): Detects more complex patterns like
leaf texture changes.
• Output Layer (Softmax): A fully connected dense layer where the number of
neurons equals the number of deficiency classes. Softmax activation outputs
probabilities for each class, and the class with the highest probability is selected.
Training Procedure:
• Data Normalization: All pixel values were scaled between 0 and 1 to ensure
uniform learning across image features.
• Label Encoding: All deficiency classes were encoded into integer labels and then one-
11
hot encoded for use with the softmax output layer.
• Train-Test Split: The dataset was split into training and testing sets using an 80:20
ratio, ensuring that class distribution is maintained.
• Loss Function: The model was trained using Categorical Crossentropy with label
• Optimizer: Adam optimizer was used due to its adaptive learning rate and efficient
convergence behavior.
• Early Stopping: Training was stopped early if no improvement in validation loss was
observed for a fixed number of epochs, ensuring efficient training and avoiding
overfitting.
• Epochs & Batch Size: The model was trained over a maximum of 100–150 epochs,
with early stopping enabled. A batch size of 32 was used to ensure stable learning.
• Evaluation Metrics: Accuracy, precision, recall, and F1-score were computed on the
test set. The model consistently achieved 85–90% accuracy, successfully generalizing
to unseen images.
• This configuration allowed the model to effectively learn the relationship between
visual symptoms and nutrient deficiencies, handling complex patterns such as yellowing,
browning, spotting, and stunted growth. The resulting model was integrated into an
application that predicts the type of nutrient deficiency from uploaded crop images,
supporting real-time and accurate field diagnosis for farmers and agronomists.
12
Chapter 6
Model Performance
The performance of the implemented Convolutional Neural Network (CNN) model is summarized
below:
• Accuracy: 88 %
• Precision: 87 %
• Recall: 86 %
• F1-Score: 86.5 %
The model achieved high accuracy in predicting different types of nutrient deficiencies from crop images
and demonstrated good generalization on unseen data, effectively handling both clear and subtle visual
symptoms across different deficiency classes.
13
Chapter 7
Results
The The developed deep learning model for nutritional deficiency detection was successfully
trained and evaluated on a comprehensive dataset of crop images showing various deficiency
symptoms.
The final model achieved an accuracy of approximately 88% on the test dataset,
demonstrating strong performance in predicting nutritional deficiencies from crop images,
even when symptoms were visually subtle or overlapping between different deficiency types.
The system was further extended to accept real-time images captured by users, either
through file uploads or mobile devices. These images were processed through the trained
CNN model, which accurately predicted the corresponding deficiency categories.
• The output includes both the predicted deficiency label and a confidence score for
better interpretation.
• The project supports real-time prediction on crop images uploaded from the user’s
device.
• The use of deep learning techniques, including data augmentation, label smoothing,
dropout regularization, and learning rate scheduling, significantly improved model
generalization and stability.
Overall, the results confirm that the proposed approach can effectively classify crop images
into meaningful nutritional deficiency categories with high accuracy and visual relevance,
making it a valuable tool for smart farming and agronomy applications.
14
15
Chapter 8
Analysis
The results of this project confirm that deep learning-based approaches — particularly the
use of Convolutional Neural Networks (CNNs) — can be effectively applied to detect and
classify nutritional deficiencies in crop images. The model successfully learned to identify
complex visual patterns such as discoloration, texture changes, and leaf deformation, which
are critical indicators of nutrient stress.
Although traditional methods in agriculture rely heavily on manual inspection and expert
judgment, this project demonstrates how foundational concepts from deep learning — such
as hierarchical feature extraction, spatial pattern recognition, and data-driven representation
learning — can be adapted to solve practical problems in precision farming and crop health
monitoring.
By transforming raw image data into structured, meaningful predictions, the system provides
an automated, accurate, and scalable solution for early detection of nutrient deficiencies. This
approach not only reduces the reliance on manual diagnosis but also improves the speed and
consistency of crop management decisions.
The analysis highlights the effectiveness, usability, and potential scalability of the model
within a broader deep learning and smart agriculture context, paving the way for future
enhancements such as multi-disease detection and real-time field deployment.
16
1. Effectiveness of CNN in Feature Extraction:
The use of Convolutional Neural Networks (CNNs) allowed for efficient extraction of spatial
and color-based features from crop images, such as patterns of discoloration, leaf edge
damage, and vein anomalies. This deep learning approach reduced the complexity of image
analysis by automatically identifying key visual symptoms without the need for.
CNNs provided reliable results across various types of crop images, including natural
variations in lighting, background noise, and different stages of plant growth. The learned
feature maps offer a compact yet rich representation of the health condition of the crops.
Instead of simply outputting textual predictions, the system provides a clean and intuitive
result by showing the predicted deficiency class along with a confidence score.
This approach helps users quickly understand the diagnosis without requiring deep
technical knowledge. In an advanced version, techniques like Grad-CAM visualization
could be integrated to highlight the specific areas of the leaf that influenced the model's
prediction, making the system even more transparent and informative for agricultural
experts and farmers.
One of the major strengths of this system is its interpretability and ease of use. The
predicted deficiency labels are easy to understand, allowing users to instantly verify the
By focusing on clear prediction outputs rather than complicated spatial annotations or
segmentation, the system ensures a clutter-free and user-friendly experience, aligning
perfectly with the goal of early, practical field diagnosis.
The In the current version of the project, the system classifies images into predefined nutrient
17
deficiency classes. However, the system could be enhanced by:
• Incorporating multi-label classification to detect multiple deficiencies simultaneously.
• Adding severity estimation (mild, moderate, severe deficiency) based on the intensity
of symptoms.
• Expanding the dataset to cover a broader range of crops and environmental
conditions, thereby increasing robustness and real-world applicability.
Adding these enhancements would transform the system from a basic classifier into a more
insightful and practical agricultural advisory tool.
The system performs efficiently even with high-resolution crop images, thanks to
preprocessing steps such as resizing images to 224×224 pixels before feeding them into
This ensures that computation remains lightweight and fast, without significantly
Overall, the system offers a strong balance between speed, accuracy, and usability,
making it highly suitable for real-world deployment in agricultural advisory services,
mobile farming apps, and smart farming platforms.
18
Chapter 9
Conclusion
19
Chapter 10
Future Scope
This project establishes a practical and effective method for detecting nutritional deficiencies
in crops using deep learning techniques. Although the current system performs successfully,
several opportunities exist for enhancing its accuracy, scalability, and real-world impact. The
following directions outline potential future developments:
2. Severity Estimation:
In addition to classification, the system could be enhanced to assess the severity of the
deficiency (mild, moderate, severe). This would allow farmers to prioritize interventions based
on the urgency and intensity of the detected symptoms.
20
5. Extension to More Crops and Varieties :
Expanding the dataset to include multiple crop species, different leaf stages, and region-
specific varieties will make the system more versatile and applicable across a wider range of
farming environments.
By pursuing these directions, the system can evolve into a robust, scalable, and intelligent
agricultural advisory platform that promotes healthier crops, higher yields, and more sustainable
farming .
21
Chapter 11
Reference
1. Sharma, H., & Kaur, J. (2021). Detection of Nutritional Deficiencies in Crop Plants Using
Deep Learning Techniques: A Review. Journal of Artificial Intelligence Research &
Advances, 8(2), 45–52.
2. Kamilaris, A., & Prenafeta-Boldú, F. X. (2018). Deep learning in agriculture: A survey.
Computers and Electronics in Agriculture, 147, 70–90.
https://doi.org/10.1016/j.compag.2018.02.016
3. Yadav, S. K., et al. (2020). Identification of Plant Nutrient Deficiency Using Deep
Learning Techniques: A Case Study on Tomato Plants. Procedia Computer Science, 167,
2201–2210. https://doi.org/10.1016/j.procs.2020.03.272
4. Dhiman, P., & Khanna, A. (2022). Nutrient Deficiency Detection in Crop Leaves Using
Image Processing and Convolutional Neural Networks. International Journal of Advanced
Computer Science and Applications, 13(5), 478–485.
5. PlantVillage Dataset, Penn State University: https://plantvillage.psu.edu/
6. TensorFlow Documentation: https://www.tensorflow.org/
7. Keras Documentation: https://keras.io/
8. OpenCV-Python Documentation: https://docs.opencv.org/
9. Pandas Documentation: https://pandas.pydata.org/
10. Matplotlib Documentation: https://matplotlib.org/stable/contents.html
22