Application of Colorimetry To Determine Soil Fertility Through Naive Bayes Classification Algorithm
Application of Colorimetry To Determine Soil Fertility Through Naive Bayes Classification Algorithm
Application of Colorimetry To Determine Soil Fertility Through Naive Bayes Classification Algorithm
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
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