Using Transfer Learning For Nutrient
Using Transfer Learning For Nutrient
Abstract—Plants need nutrients to develop normally. The the key objective of this work is to automate the identification
essential nutrients like carbon, oxygen, and hydrogen are of nutrient deficiencies in plants using Convolutional Neural
obtained from sunlight, air, and water to prepare food and plant Networks (CNN).
growth. For healthy growth, plants also need macronutrients
such as Potassium, Calcium, Nitrogen, Sulphur, Magnesium, and Artificial Intelligence has numerous applications in
Phosphorus in relatively great quantities. When a plant doesn’t multiple industries, healthcare, environment, finance,
find necessary nutrients for its growth inadequate amount, education, agriculture, etc. to solve complex problems and
deficiency of plant nutrients occur. Plants exhibit various make our daily life more secure and fast.
symptoms to indicate the deficiency. Automatic identification and
differentiation of these deficiencies are very important in the G. Madhulatha et al. [2] proposed an automatic plant
greenhouse environment. Deep Neural Networks are extremely disease detection on the plant leaves to decrease crop loss and
efficient in image categorization problems. In this work, we used increase productivity. Plant diseases are predicted and
the part of the pre-trained deep learning model i.e. Transfer classified with 96.50% accuracy based on visual symptoms
Learning model to detect the nutrient stress in the plant. We using deep CNN. The authors used a dataset from the “Plant-
compared three different architectures including Inception-V3, Village” dataset for plant leaf diseases. The model was pre-
ResNet50, and VGG16 with two classifiers: RF and SVM to trained using AlexNet. Muhammad Hammad Saleem et al. [3]
improve, classification accuracy. A total of 880 images of developed three Deep Learning meta-architectures namely;
Calcium and Magnesium deficiencies in the Tomato plant from Faster Region-based Convolutional Neural Network (RCNN),
the greenhouse were collected to form a dataset. For training, Single Shot MultiBoX Detector (SSD), and Region-based
704(80%) images are used and for testing, 176(20%) images are Fully Convolutional Networks (RFCN) to recognize plant
used to examine the model performance. Experimental results disease and healthy leaves. All three models include a feature
demonstrated that the largest accuracy of 99.14% has resulted extractor and a base network. This research used Gradient
for the VGG16 model with SVM classifier and 98.71% for Descent with its Momentum version, Adaptive Moment
Inception-V3 with Random Forest Classifier. For a batch size of Estimation (Adam), and Root Mean Square Propagation
8 and epochs equal to 10, the Inception -V3 architecture attained (RMSProp) optimization algorithms to increase the
the highest validation accuracy of 99.99% and the least
performance of the Deep Learning meta-architectures. The
validation loss of 0.0000384 on an average.
authors examined that all the Deep Learning meta-architectures
Keywords—Nutrient deficiency; plant nutrients; deep neural needed 126 epochs (200,000 iterations) for training
networks; transfer learning; random forest (RF); support vector convergence. When the SSD model was trained using Adam
machine (SVM) optimizer, the maximum means Average Precision (mAP) of
73.07% was obtained. Guan Wang et al. [4] suggested a deep
I. INTRODUCTION learning model for control plant disease application. The
A proper combination of nutrients is required for plants to authors used the apple leaf black rot images produced by the
live, develop and reproduce. So, plant analysis is a necessary fungus Botryospaeria obtuse from the PlantVillage dataset for
tool that assists farmers by providing significant information disease severity classification. The highest overall accuracy of
about the nutritional description of the growing plant to obtain 90.4% was obtained for the VGG16 model. Sharada P.
a better yield. Generally, plant analysis indicates the analysis of Mohanty et al. [5] established a smartphone-assisted
magnesium (Mg), sulphur (S), phosphorous (P), calcium (Ca), application to detect the disease using a deep convolutional
nitrogen (N), potassium (K), etc. Normally, plants show signs neural network. In this research, GoogLeNet architecture
of being unhealthy when they suffer from undernutrition. For performs better and provides 99.35% accuracy as compared to
example, yellow around the edges of its leaves are a sign of AlexNet architecture. The presently available deep learning
magnesium deficiency. Yellow spots between the leaf veins methods to identify the plant disease were reviewed by M.
and Blossom End Root denote the absence of calcium. Brown Nagaraju and Priyanka Chawla [6].
edges along the plant leaves indicate a deficiency of potassium. Many previous works have considered Image Recognition
Yellow or pale green leaves imply the need for nitrogen [1]. and Machine Learning models to classify the images into
These nutrient deficiency symptoms will help growers to healthy and unhealthy images. However, most of these
identify the nutrient status of plants for a better crop yield. algorithms require image segmentation and feature extraction.
Manually diagnosing these deficiencies is a difficult task. So, But, from the many extracted features, it is difficult to judge
784 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 10, 2021
the important and dominant features for plant disease detection. pixels is the size of all the resized images. These sample
Moreover, under difficult background circumstances, many images are input to the convolutional neural network for
techniques fail to successfully segment the leaf and will lead to training the model. The trained model is applied for the class
unreliable deficiency recognition. So, image segmentation and prediction of unseen images. These phases are explained in
feature extraction are still challenging tasks. Therefore, detail in the following sections. Machine learning algorithms
automatic plant disease detection and nutrient deficiency including SVM, Decision-Tree and, RF are excellent in
recognition are still challenging tasks. Recently, Convolutional resolving classification problems [10]. However, they go
Neural Network (CNN) is becoming the preferred scheme to wrong in extracting the proper features from the image.
overcome few challenges. Alternatively, Convolutional Neural Networks receives the raw
pixel of the images directly as inputs instead of extracting
The main objective of this research is to diagnose nutrient certain features manually [12-14]. CNN learns how to take out
deficiency in plants and take several measures like adjusting these features from the actual image.
the pH value of water to achieve a quality yield, providing the
right amount of fertilizer, etc. using deep learning models. For B. Convolutional Neural Networks
nutrient deficiency classification, we employed the Transfer CNN's are a class of Deep Neural Networks that can
Learning method, where pre-trained models are used as the identify and categorize specific features in images and are
entry point to develop the neural network models. In this generally used for examining visual images. Significantly,
research, we have used these models to predict Calcium (Ca) CNN can yield good results than the traditional feature
and Magnesium (Mg) deficiency in tomato crops grown under extraction algorithms in plant disease diagnosis [15-18]. In
a greenhouse environment. CNN, the filters are learnable. A classic CNN consists of two
The key advantage of transfer learning is that instead of components: The Convolution Block and the Fully Connected
beginning the learning process from the scratch, the model block, which are detailed as follows.
commences from the characteristics that have been educated
when resolving other problems which are analogous to the one TABLE I. CALCIUM AND MAGNESIUM NUTRIENT DEFICIENCY
SYMPTOMS IN TOMATO
being resolved. We have used three pre-trained models-
InceptionV3, VGG16, and ResNet50 as a base model and Deficiency Symptoms
Nutrients Description
SVM or Random Forest classifier on top of it to attain better on Leaf/ Fruit
results.
Young leaves curl inwards and
The rest of this paper is structured in the following fashion. cause dry decaying areas at
Calcium (Ca)
Section II introduces the images collected to form the dataset Blossom End of the fruit (BER)
of Ca and Mg deficiencies followed by related concepts. This in Tomatoes.
section also presents Inception V3, ResNet50, and VGG16
architectures, and the proposed model to identify and classify Interveinal chlorosis (Veins of
the deficiencies. Section III dedicated to the evaluation, and the Leaf remains green whereas the
comparative analysis of results obtained in this experiment. In Magnesium areas between the leaves go
Section IV, the paper is summarized and future work is (Mg) yellow). Elder leaves drip their
mentioned. color excluding in the veins. It
does not affect the fruit.
II. MATERIALS AND METHODS
C. Convolutional Neural Networks
A. Data Acquisition
CNN's are a class of Deep Neural Networks that can
Tomato plants were grown in a greenhouse of a size 10x4 identify and categorize specific features in images and are
sq.ft. to study and gather the dataset for lack of nutrients in generally used for examining visual images. Significantly,
tomato leaves and fruits. The calcium and magnesium CNN can yield good results than the traditional feature
deficiencies were induced for the plants in different stages and extraction algorithms in plant disease diagnosis [9, 11]. In
their images were captured from the camera for training and CNN, the filters are learnable. A classic CNN consists of two
testing the performance of the model. The dataset was components: The Convolution Block and the Fully Connected
developed with two classes for classification and prediction: block, which are detailed as follows.
Calcium and Magnesium. Altogether, there are 880 images in
the dataset. Out of 880 images, 704 (80%) images are for 1) Convolution block: The convolution block contains the
training the model, and 176 (20%) images are for testing the Convolution Layer and the Pooling Layer. In this block, the
model. There are 374 calcium deficiency and 330 magnesium task of feature extraction is accomplished. The convolutional
deficiency images in the training dataset. Further, out of 176 layer produces the feature maps or activation maps by
testing images, 94 images are of calcium, and the remaining 82
applying filters to input images using the ReLU activation
images are of magnesium deficiency images. To enhance the
dataset, the data augmentation methods including image function. The ReLU function returns x for all the values of x >
resizing, flipping, random rotation, shearing, etc., are applied. 0, and returns 0 for all values of x ≤ 0 and is given in
The details of calcium and magnesium nutrient deficiency equation 1.
symptoms in tomatoes are presented in Table I. 256 x 256 F(x) = max(0,x) (1)
785 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 10, 2021
786 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 10, 2021
TABLE II. ACCURACY AND LOSS OF DIFFERENT TRANSFER LEARNING MODELS AFTER 5 AND 10 EPOCHS
Transfer Learning
Training Accuracy (%) Validation Accuracy (%) Training Loss Validation Loss
Model
5 Epochs 10 Epochs 5 Epochs 10 Epochs 5 Epochs 10 Epochs 5 Epochs 10 Epochs
Inception V3 99.23 100 98 99.99 0.1364 0.000264 0.3685 0.0000384
ResNet-50 89.40 82.28 87.00 82.10 0.2632 0.5541 0.2568 0.4783
VGG16 100 100 98.86 98.86 0.000001 0 0.3572 0.2220
787 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 10, 2021
788 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 10, 2021
789 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 10, 2021
Algorithm in Smart Farming”, Discrete Dynamics in Nature and [16] G.L. Grinblat, L.C. Uzal, M.G. Larese and P. M. Granitto “Deep
Society, vol.2020, no.7, pp.1-11, 2020. DOI: 10.1155/2020/2479172. learning for plant identification using vein morphological patterns”,
[13] Lili Ayu Wulandhari, Alexander Agung Santoso Gunawan, Aie Qurania, Computers and Electronics in Agriculture, vol.127, pp. 418-424, 2016.
Prihastuti Harsani, Triastinurmiatingsih, Ferdy Tarawan, and Riska [17] K. P. Ferentinos, “Deep learning models for plant disease detection and
Fauzia Hermawan, “Plant Nutrient Deficiency Detection Using Deep diagnosis”, Computers and Electronics in Agriculture, vol. 145, pp.311-
Convolutional Neural Network”, ICIC International Conference, ICIC 318, 2018.
Express Letters, pp. 971-977, vol. 13, no. 10, 2019. [18] D. Story, M. Kacira, C. Kubota, A. Akoglu and L. An, Lettuce calcium
[14] G.Chu, “How to use transfer learning and fine-tuning in keras and deficiency detection with machine vision computed plant features in
tensorflow to build an image recognition system and classify (almost) controlled environments, Computers and Electronics in Agriculture, vol.
any object”, Deep Learning Sandbox, 2017. 74, no.2, pp. 238-243, 2010.
[15] A. M. G. J. Hanson, A. Joy, and J. Francis, “Plant leaf disease detection
using deep learning and convolutional neural network”, International
Journal of Engineering Science, vol. 7, no.3, pp.5324-5328, 2017.
790 | P a g e
www.ijacsa.thesai.org