0% found this document useful (0 votes)
62 views6 pages

Application of Colorimetry To Determine Soil Fertility Through Naive Bayes Classification Algorithm

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 6

IEEE - 43488

Application of Colorimetry to determine Soil Fertility through


Naive Bayes Classification Algorithm
Surili Agarwal, Neha Bhangale, Kameya Dhanure, Shreeya Gavhane, V.A.Chakkarwar,
Dr. M.B.Nagori
Dept. of Computer Science and Engineering
Government College of Engineering, Aurangabad
Maharashtra, India
[email protected], [email protected], [email protected],
[email protected], [email protected], [email protected]
Nitrogen (N), Phosphorous (P), Potassium (K) are some of the
Abstract— Fertility of the soil is considered most important
major macronutrients. Micronutrients on the other hand are
criterion in any agriculture practice. Nutrients present in the soil
define its fertility. Mineral nutrients such as Nitrogen (N), required in relatively small amounts. Calcium, magnesium,
Potassium (K), Phosphorous (P) are vital for plant growth and zinc, copper, iron, boron etc. are examples of micronutrients.
food production. Lack of adequate knowledge amongst the The quantity of macronutrients defines the soil fertility.
farmers about the various parameters in farming like the soil Different crops require different quantity of macronutrients
fertility, amount of fertilizer to be used, leads to degradation of [3]. Depending upon the deficiency of a particular nutrient for
the overall soil quality. In this paper, we have represented a a particular crop in a given region the amount of fertilizer is
system to test the soil fertility by using the principal of determined. Thus the quantity of fertilizer to be used depends
colorimetry. Colorimetry is a technique in which we measure the upon the soil fertility [3], crop to be grown and type of soil. In
amount of light absorbed by the color developed in the sample.
most conventional practices the farmer estimate the amount of
An aqueous solution of the soil sample is prepared using
extracting agents and is subjected to the photodiodes of the color fertilizer to be used without actually testing the soil. Research
sensor. The solution develops a color due to reaction of nutrients shows that any field should be retested before cultivation, at
in the soil with chemicals. The output by the color sensor is least every four years to prevent the nutrient deficiencies and
calibrated with standard values present in the database. To verify maintain the nutrient balance.
the results obtained by the color sensor we use the Naive Bayes The routine soil testing program in laboratories take a
classification algorithm. This algorithm classifies the intensity considerable amount of time to generate the results [4]. During
values of the soil solutions into three class labels namely low, the period from testing to getting results, the overall soil
medium, high. After applying the Naive Bayes classifier, we can fertility changes as it is often subjected to changing weather
predict the accuracy of the intended system. The intended system
conditions. Time becomes a crucial factor in case for
is thus beneficial to reduce the time required for testing the soil
fertility and determining the accuracy of our results. determination of soil nutrients.
This system works on the principle of colorimetry. An
Keywords— Colorimetry, Naïve Bayes, Nutrients, Soil fertility aqueous solution of the soil sample with certain chemicals is
prepared and is subjected to the color sensor. A color is
I. INTRODUCTION developed due to reaction of nutrients in the soil with
chemicals. These chemicals are called extracting agents. The

C ONTRIBUTION of agriculture sector in Indian economy


output by the color sensor is compared with the standard
results stored in a database. After comparison the deficiency
is displayed. To verify the correctness of the system, the Naïve
is quite prominent and is much greater than world’s average.
Nearly 18.1% of the Indian annual gross domestic product is Bayes classification algorithm is used. The key feature of our
contributed by Agriculture[1]. However Farming in India is system is to reduce the time required for testing the soil
still done by adopting traditional practices which generally fertility and determining the accuracy of our results.
makes use of approximations. The growth and productivity of
crops has been stagnant in recent years due to degradation in II. RELATED WORK
quality of the environmental consequences in the form of In a study on Electrochemical Sensors to determine Soil
depleting water table and emission of greenhouse gases. With fertility [5], we found that the Electrochemical Sensors consist
the emergence of technology, there has been a significant of Ion Selective Electrode (ISE) and Ion Selective Field
increase in monitoring various agricultural parameters like soil Transistor(ISFET). These electrodes are used to measure the
moisture, humidity, temperature etc. [2], in order to improve concentration of ion in the solution. Electrochemical sensors
the farm field. The fertility of soil is a crucial factor in can be integrated onto one chip as a sensor array to provide a
increasing the crop production. Soil fertility simply means the feasible approach of multi-targets simultaneous detection. The
amount of nutrients content existing in the soil. There are 16 main challenge faced here is reliability of sensor array, that is,
elements in the soil that are considered essential for any plant to avoid or diminish the interferences from other ions while
growth. These nutrients can be categorized into two classes using a sensor array for simultaneous detection.
namely macronutrients and micronutrients. Macronutrients are Another technique to determine soil fertility using optical
are generally required in large quantity in the soil. method is the spectroscopy [6]. Laser Induced Florescence

9th ICCCNT 2018


July 10-12, 2018, IISC, Bengaluru
Bengaluru,
Authorized licensed use limited to: Middlesex University. Downloaded India 01,2020 at 13:10:12 UTC from IEEE Xplore. Restrictions apply.
on September
IEEE - 43488

Spectroscopy (LIFS) in which the solution absorbs radiations A. Color sensor


usually from the UV range. This method is reliable but
complex. Also the number of samples that can be tested by the
system are limited. The system is very specific as the range of
wavelength is only in the UV band. Another spectroscopy
method is Near Infrared Spectroscopy (NIR), which is based
on absorption of the electromagnetic radiations. The limitation
of this method is that it can only detect wavelengths in the
range 780-2500nm. NIR is costly, time consuming and
complex.
There is another existing technique to measure soil nutrients
using fiber optic sensor [3] which works on colorimetric
principle. In this technique, the sensor is built using Fig. 2 TCS 3200 color sensor
multimode, plastic optical fibers. The sensor consists of seven
fibers arranged in circular configuration with one fiber at the Color sensor TCS3200 is a hardware device which senses
center. The central fiber acts as receiving fiber and color light using an 8*8 array of silicon photodiodes [6] with
surrounding six fibers acts as transmitting fibers. With the red, green and blue filters. These values from the array are
help of multimode optical fibers light is incident on the then transformed to the square frequency which is directly
aqueous solution of given soil sample. The reflected light is proportional to the intensity of light. The Arduino micro
captured by the receiving fiber of the sensor and converted to controller can read the output of the sensor and generate
electrical signal. Then the electrical output is calibrated in results for the color in the form of intensity values.
terms of the status of nutrients present in the soil. The
B. Arduino Uno R3
techniques that are using fiber optic sensors are reliable but
costly and time-consuming.
As compared to these methods, the intended system
methodology is relatively less costly, less complex and the
time required to produce results is also less.

III. BLOCK DIAGRAM


Fig.1 depicts the block diagram of the intended system. The
soil nutrient detection system consists of Arduino micro
controller, color sensor, regulated power supply, a computer
system and soil sample.
As shown in Fig. 1, The Arduino UNO board is connected Fig. 3 Arduino Uno R3 board
to the computer system via cable provided with Arduino Uno Arduino UNO R3 is an open source [7] platform that
board. The results can be directly viewed on the computer designs micro controller based projects that can sense and
screen through the Arduino software installed on computer. control objects in physical world. Arduino consists of both a
The color sensor is connected to the Arduino board using physical circuit board and a software or IDE. This IDE can be
jumper wires. utilized for writing as well as uploading the code to the
physical circuit board.

Fig. 3 Circuit connections


Fig. 1 Block Diagram

9th ICCCNT 2018


July 10-12, 2018, IISC, Bengaluru
Bengaluru,
Authorized licensed use limited to: Middlesex University. Downloaded India 01,2020 at 13:10:12 UTC from IEEE Xplore. Restrictions apply.
on September
IEEE - 43488

IV. PROPOSED SYSTEM METHODOLOGY


Fig. 4 represents the steps carried out to determine the soil
fertility. The steps can be broken into four major components
namely soil sampling, soil pretreatment, actual measurement
of NPK using color sensors and verification using Naïve
Bayes classification algorithm.
A. Soil Sampling
Selection of soil samples is most crucial step for the
detection of N P K as well as for fertilizer predictions [8].
Hence selection should be done by considering the analytical
cost, equipments available, time required and also field
fertilization history. Soil sampling is done in process format
.At first stage field area is chosen from where the soil is to be
tested and samples are to be collected. The area from where
the soil samples are to be collected should possess same
fertility and crop history. Also the characteristics such as
color, texture, slope of the soil should be similar. At the
second stage the tool required for sampling comes into picture
i.e. a stainless steel probe is most significant tool being used.
Vehicle mounted hydraulic probe is also a better choice under
adverse conditions. Different tools which include spade,
shovel, sample bags, plastic (non-vulnerable) bucket and
markers for identifying samples on sample bags are used. By
using tools, sampling depth is estimated at third stage. The soil
from (surface to six inches) is selected for testing which has
the most fertilizer applications.
Before digging up the soil the organic matter (weeds, stones,
hay etc.) on the surface of the soil is removed successfully. To
detect nitrogen in the soil, a deeper range i.e. from (6 inch to
24 inch) of soil in V format is collected. To result out the
proper analysis, the soil samples are collected in “Zigzag” [9]
manner so that there would be collection of samples of soil
from different sections of field. The amount of sample to be
collected comprises of fourth and most profound stage. Fig. 4 Working Flow Diagram
Approximately (15-20) samples are collected from minimum
possible depth of 24 inches. The core of soil is divided into B. Soil Pretreatment
two portions, first portion (0 inch -6 inch) and second portion
This step includes preparation of the colored aqueous
(6 inch - 24 inch). The samples of first portion is collected in
solution. We are using a Soil Testing kit to check the fertility
bucket and mixed well and hence the surface samples are
of a particular soil sample. After collecting soil sample, add
assembled in the plastic bags .Similarly the second portion i.e
approximately 1gm of the sample to test tube A with the help
the subsurface samples (6 inch - 24 inch) are gathered is
of funnel. The second step is to add 6 ml of water in the test
similar way. If the field land is variable then additional
tube A. Put the cap on the tube and shake it for a minute. We
samples to a (depth > 24 inch to 48 inch) is endorsed .Before
have to keep the test tube A still for 5 minutes so that soil will
pouring the samples in plastic bags it is well dried by placing
settle down and we get a clear solution on top of the test tube.
the whole sample on paper and letting it dry on room
The next step is to take 2 ml of clear solution from test tube A
temperature.
to another test tube (test tube B) using a dropper. Make sure
Hence now the soil samples are organized for further
that there will not be any soil traces in the test tube B. Now
procedure.
add one nitrogen capsule from the soil testing kit. The nitrogen
capsule usually contains KCl as an extracting agent. Put the
cap on the tube B and shake it gently. We have to keep the test
tube B still for 5 minutes to allow the solution to develop a
color. The color sensor now senses the color intensity existing
in the solution of test tube B and gives results in the form of
three values which correspond to red, green and blue. These
values are then analyzed, displayed and categorized into three
class labels namely low, medium and high. We are using the
same procedure to test phosphorous and potassium in a soil
sample.

9th ICCCNT 2018


July 10-12, 2018, IISC, Bengaluru
Bengaluru,
Authorized licensed use limited to: Middlesex University. Downloaded India 01,2020 at 13:10:12 UTC from IEEE Xplore. Restrictions apply.
on September
IEEE - 43488

Measurement of NPK Using Color Sensor data we specify the list of samples that were tested using color
For each sample to be tested, the solution is prepared by the sensor that is intensity values of the samples for a particular
manual process as stated above. TCS3200 programmable nutrient and the corresponding status (low/ medium/ high) of
color light to frequency convertor that combines configurable the nutrient content in soil. Thus here Low, Medium, High are
Silicon photodiodes and current to frequency convertor on a class labels and intensity belongs to feature vector. The ideal
single monolithic CMOS integrated circuit. The color Sensor color intensity values for Low, Medium, High for a particular
TCS3200 can detect and measure all colors of the visible nutrient are used and the classifier is trained based on some
spectrum. The output generated by the color sensor is in the part of data. The Naïve Bayes classifier will determine how
form of a square wave. The frequency of this square wave is many samples were correctly classified i.e how many samples
directly proportional to intensity of the light. The color sensor actually belong to correct class and how many samples were
consists of two main components the TCS3200 RGB sensor wrongly classified. It will also display the percentage of
chip and 4 white LED’s. The light emitting from the LED’s is correctly classified instances which states the accuracy of the
incident on the aqueous solution of the soil sample. The soil system.
sample reflects the light of certain wavelength which is
detected by the array of photo detectors in the color sensor. V.EXPERIMENTAL RESULTS
The sensor output is calibrated with standard values present in TABLE I. Threshold color intensity values. [3]
the database. The deficiency of the major nutrient can be
easily measured because of the color sensor output displayed Component Low Medium High
on the screen as low/ medium/ high.
Nitrogen x < 15 15 < x ≤ 20 20 < x ≤ 25
Phosphorous 16 < x ≤ 20 20 < x ≤ 35 35 < x ≤ 50
C.Verification by Naïve Bayes Classification Algorithm
Potassium 20 < x ≤ 25 25 < x ≤ 40 50 < x ≤ 60
Naïve Bayes is a classification algorithm that employs the
Bayesian algorithm to perform classification [10]. It presumes
that the occurrence of a certain attribute is independent of the TABLE II. Training Data
occurrence of other attributes. That is why this algorithm is
called as “Naïve”. It is a widely used approach for Sample N P K Status
classification because it gives reasonable performance. It No. (Color (Color (Color (N, P, K)
allots the class labels to the problem instance employing the Intensity) Intensity) Intensity)
concept of conditional probability. 1 12 30 59 (low,
medium,
P(C). P(F|C) high)
P(C|F) = ------------------- 2 10 17 22 (low, low,
P(D) low)
3 18 18 55 (medium,
This formula computes the probability of occurrence of event low, high)
C such that event F has already occurred [11]. It is also called 4 22 33 23 (high,
as Bayes theorem. In a classification problem, there are classes medium, low)
and features. C1, C2, ……Ck being the classes, Naive Bayes
5 19 31 57 (medium,
classification algorithm intends to compute the conditional
medium,
probability that an item with feature vector y1, y2,…..yn
high)
belongs to class Ci.
6 25 40 35 (high, high,
medium)
P (y1, y2……yn | Ci) . P (Ci)
7 19 46 37 (medium,
P (Ci|y1, y2……yn) = -----------------------------------
high,
P (y1, y2,……yn)
medium)
This formula computes the probability of the item with feature 8 24 48 58 (high, high,
vector <y1, y2……yn> belonging to class Ci. This probability high)
is calculated for all the classes ranging from 1 to k. The class 9 18 18 38 (medium,
for which the value of probability is highest is the one to low, medium)
which the item with the given features belongs. Thus, it 10 10 39 23 (low, high,
computes the probabilities that the item with given features low)
belongs to particular class. Based on the computed probability
values, it allots the class label to the problem instance.
We have measured the status (low/ medium/ high) of
nutrients in the soil using color sensor. Now we have to verify
whether the results are accurate or not. So we use Naïve Bayes
classifier for this purpose. The output data of the color sensor
will act as the test data for Naïve Bayes algorithm. In the test

9th ICCCNT 2018


July 10-12, 2018, IISC, Bengaluru
Bengaluru,
Authorized licensed use limited to: Middlesex University. Downloaded India 01,2020 at 13:10:12 UTC from IEEE Xplore. Restrictions apply.
on September
IEEE - 43488

TABLE III. Test data. For our model, we have got the accuracy of 0.80 which means
Sam N P K Ideal Status Classifie our model is 80% accurate.
ple (Color (Color (Color (N, P, K) d results
No. Intensi Intensi Intensi VI. CONCLUSION
ty) ty) ty) The proposed system detects the soil fertility by using the
1 22 23 59 (high, (low, principle of colorimetry and classification algorithm. The
medium, medium, system will help farmers determine the Soil fertility with
high) high) accuracy and reduces the time involved in the conventional
2 12 17 53 (low, low, (low, soil testing Methodology. When compared with other soil
high) high, testing methods using colorimetry like fiber optics sensor and
high) spectroscopy, the proposed system is more reliable and
3 10 29 52 (low, (low, affordable. As we are using Naive Bayes Classification
medium, medium, algorithm, the accuracy of the system in determining the
high) low) status of major nutrient contents in the soil is verified. The
4 17 17 54 (medium, (medium, system was tested using soil samples with confining soil
low, high) low, types typically black soils with clayey texture and dark brown
high) soil with blocky structure, clayey texture. The texture, color,
5 22 37 22 (high, high, (high, structure of the soil samples were restricted to few category.
low) high, Also the dataset used for the analysis of the proposed
low) methodology was limited to the spatial soil characteristics of
6 19 43 33 (medium, (medium, the region .For large soil datasets comprising of entire
high, low, country, efficient methods could be created that utilize Data
medium) medium) Mining/Big Data techniques to enhance the exactness of
7 16 17 22 (medium, (medium, classification. Also the system does not provide exact
low, low) low, low) quantification of N, P, K contents in the soil.
8 9 17 25 (low, low, (low,
low) low, low) VII. FUTURE SCOPE
9 31 46 53 (medium, (medium, Our analyzed and implemented system is liable to detect
high, high) high, the NPK, the most important macronutrients in the soil. But it
high) can be further evolved into better version by adding the
10 19 32 25 (medium, (medium, fertilizer prediction required for the particular soil type in a
medium, medium, specific region. Quantification of exact values of NPK along
low) low) with fertilizer recommendation can be the better future
implementation of the proposed system.
The threshold color intensity values for N, P, K contents in the
soil are depicted in TABLE I. It provides the range of color ACKNOWLEDGMENT
intensity values that is low, medium, high for N, P, K. Authors are grateful to the project research guide Prof.
The dataset is split into training data and test data. The V.A.Chakkarwar for inspiring us on the context and
subset of training data and test data are depicted in TABLE II motivating us to implement our research in a proper and
and TABLE III respectively. Using Naïve Bayes classifier, we courteous way. We would also like to thank Meghana.B.
assess how accurate the system is in classifying the nutrient Nagori for helping us to realize the realistic approach with
status. A dataset of 100 tuples is divided in the ratio 3:2 as respect to our research work and paved in organizing the
training and test data respectively. Out of the 40 instances of structure of the research paper. We would also like to thank
test data, 32 instances were correctly classified. That is if the our Head of Department Prof. Vivek.P.Kshirsagar for
nutrient status is low then it is classified as low and likewise. conducting timely reviews and surveillance which helped in
From this, the accuracy of the system is determined. Accuracy directing our ways out. Our parents for providing the moral
is simply the ratio of correctly classified instances to the total support and developing patience in our minds. The last but not
number of observations. the least our almighty God for letting us into the world and
True Positive + True Negative providing us an opportunity to work under our magnanimous
Accuracy = ---------------------------------------- research guide.
Positive + Negative
Where, REFERENCES
TP (True Positive) means the positive tuples that are truly
[1] Amrutha A, Lekha R, A Sreedevi, “Automatic Soil Nutrient Detection
labeled by the classifier. and Fertilizer Dispensary System,” International Conference on
TN (True Negative) means the negative tuples that are truly Robotics: Current Trends and Future Challenges (RCTFC), 2016.
labeled by the classifier. [2] Mr. Gaikwad S.V, Prof. Galande S.G, “Measurement of NPK,
P + N refers to the total number of observations.[12] Temperature, Moisture, Humidity using WSN,” International Journal of
Engineering Research and Applications, vol. 5, pp. 84-89, August 2015.
[3] Deepa V. Ramane, Supriya S. Patil, “Detection of NPK nutrients of soil
using Fibre Optic Sensor,” International Journal of Research in Advent

9th ICCCNT 2018


July 10-12, 2018, IISC, Bengaluru
Bengaluru,
Authorized licensed use limited to: Middlesex University. Downloaded India 01,2020 at 13:10:12 UTC from IEEE Xplore. Restrictions apply.
on September
IEEE - 43488

Technology Special Issue, National Conference “ACGT 2015”, 13-14


February 2015.
[4] Methods Manual – “Soil Testing in India”, Dept. of Agriculture & Coop,
Ministry of Agriculture, Govt of India, New Delhi, Jan. 2011.
[5] Jianhan Lin, Maohua Wang, Miao Zhang, Yane Zhang, Li Chen,
“Electrochemical sensors for soil nutrient detection: Opportunity and
Challenge,” Key Laboratory of Modern Precision Agriculture System
Integration, Ministry of Education, Beijing, China, 100083
[6] Kunhimohammed C. K, Muhammed Saifudeen K. K, Sahna S, Gokul
M. S, Shaeez Usman Abdulla, “Automatic Color Sorting Machine Using
TCS320 Color Sensor and PIC Microcontroller,” International Journal
of Research and Innovations in Science and Technology, vol. 2, 2015.
[7] Salve Akshay B, Sagar Sonali S, Patne Mahesh L, Jangam Omkar R,
“Soil Nutrient Identification Using Arduino and Electrochemical
Sensor,” International Research Journal of Engineering and
Technology, vol. 05, February 2018.
[8] Dharesh Vadalia, Minal Vaity, Krutika Tawate, Dynaneshwar Kapse,
“ Real Time soil fertility analyzer and crop prediction,” International
Research Journal of Engineering and Technology, vol. 04, 2017.
[9] Carrie A.M. Laboski, John B. Peters, Nutrient application guidelines for
field, vegetable and fruit crops in Wisconsin.
[10] V. Rajeswari , K. Arunesh, “Analyzing Soil Data using Data Mining
Classification Techniques,” Indian Journal of Science and Technology,
vol. 9, May 2016.
[11] Preety, Sunny Dahiya, “Sentiment Analysis Using SVM and Naïve
Bayes Algorithm” International Journal of Computer Science and
Mobile Computing, vol. 4, pp. 212-219, September 2015.
[12] Jiawei Han, Micheline Kamber, Jian Pei, Data Mining Concepts and
Techniques

9th ICCCNT 2018


July 10-12, 2018, IISC, Bengaluru
Bengaluru,
Authorized licensed use limited to: Middlesex University. Downloaded India 01,2020 at 13:10:12 UTC from IEEE Xplore. Restrictions apply.
on September

You might also like