See discussions, stats, and author profiles for this publication at: https://www.researchgate.
net/publication/348350567
Machine Learning Prediction Analysis using IoT for Smart Farming
Article · September 2020
DOI: 10.30534/ijeter/2020/250892020
CITATION READS
1 866
5 authors, including:
Abdul Rehman Jian Liu
Tianjin University Tianjin University
4 PUBLICATIONS 1 CITATION 18 PUBLICATIONS 73 CITATIONS
SEE PROFILE SEE PROFILE
Ahmed Mateen Qasim Yasin
University of Agriculture Faisalabad Tianjin University
42 PUBLICATIONS 79 CITATIONS 7 PUBLICATIONS 5 CITATIONS
SEE PROFILE SEE PROFILE
Some of the authors of this publication are also working on these related projects:
AZ model of software engineering View project
Research Work View project
All content following this page was uploaded by Abdul Rehman on 09 February 2021.
The user has requested enhancement of the downloaded file.
ISSN 2347 – 3983
Volume 8. No. 9, September 2020
International Journal of Emerging Trends in Engineering Research
Available Online at http://www.warse.org/IJETER/static/pdf/file/ijeter250892020.pdf
https://doi.org/10.30534/ijeter/2020/250892020
Machine Learning Prediction Analysis using IoT for
Smart Farming
Abdul Rehman1, Jian Liu2, Li Keqiu3, Ahmed Mateen4* and Muhammad Qasim Yasin5
1,2,3
College of Intelligence and Computing, Tianjin University, Tianjin Key Laboratory of Advance Networking, Tianjin, China.
*4
Department of Computer Science, University of Agriculture Faisalabad, Pakistan, 38000
Email:
[email protected] 5
College of Intelligence and Computing, Tianjin University, Tianjin Key Laboratory of Cognitive Computing and Application,
Tianjin, China
agriculture. This real-time data stream is composed of soil
ABSTRACT temperature, atmospheric temperature, and humidity. The
Commonly, the implementation of agricultural practices practices plan is formulated with the information extracted
(e.g., ploughing, sowing, watering, pests control, and from the following sources e.g.
harvesting.) purely depends on climate change,
recommendations from previously experienced rules, and 1) Real-time data streams from Sensors
Governmental policies. For fulfilling Term smart 2) Information about the sensor locality
farming, i), we employed real-time applications over 3) Information extraction from five years old data
sensors to capture climate changes of soil and 4) Climate forecast by the government
atmosphere. ii) we defined agriculture practice rules by 5) Watering System
applying machine learning techniques over the last five
years data iii) By federations of real-time data from the The Agricultural Big source of heterogenous Data Because the
field sensors and rules, we define the time for Agricultural Data is also being collected from different
implementation of the practice. This federation eliminates sources like public data, private data, industrial data, and
many malfunctions in old ways of smart farming for Governmental data. So, data privacy and security are also
precision agriculture. required for private data and industrial data [4]. For such [3] a
significant and diversified data, we need to develop a large
Keywords: Agriculture, IoT, Sensors, Smart Farming, cloud environment for data management and analytics [5].
Raspberry Pi3. The apache-spark [6] based cloud environment is constructed
for data cleaning, collecting, storing, and data analytic &
1. INTRODUCTION. Machin learning.
Pakistan is an agro-based country, 47 % of the total land area 2. BACKGROUND.
is for agriculture, and 61% of rural community make their
earnings directly or indirectly from agriculture [1]. It is 2.1 Precision farming
playing an essential contribution in the economy. Precision farming is the term that refers to the effective and
With the regular expansion of industrializations and efficient use of limited inputs to get more outputs. It is a new
urbanizations, the agricultural area is continuously reducing. way to employ digital technology to optimize agriculture
It is boosting the demand for food due to the high growth rate. practices. Different trends of technologies are changing the
They are still practicing traditional agriculture with the old parameters and shapes of precision agriculture. The major
traditional methodology of cultivation. Which are needed to trends are IoT, weather forecast, and big data technologies
be replaced with new emerging technologies, e.g., field The Internet of things has a significant impact in all fields; it
sensors implementations [2]. data analytics, experienced bases gives new automation [31]. It leads to new directions for
decision systems. Agri-data of the last fifteen years about pest scientists to implement their research. Specifically, it
attacks, agricultural practices regarding different zones is improves the efficiency of operational work. In agriculture, it
available. Smart farming is the demand of the era to meet the applications of agriculture [7]. For example, it made it
food demand by boosting crop production. The authors [3] possible to attain real-time field data about soils and
implemented big data analytics to formulate agriculture atmospheric temperature. For large form, aerial imagery and
data.The stored agri-data is needed to be cleaned and stored to drones, and satellites are implemented as a tool of precision
be used for valuable decision support systems. In this agriculture. To make the precision agriculture more
manuscript, we import data in heterogeneous from sustainable, reliable, optimization and productive we
heterogeneous systems. For example, the old agri-data is employed machine learning and data analytics to formulate
the quick decision.
available in CSV, TXT, and relational database format.
Secondly, we collect real-time data with IoT sensors from
6482
Abdul Rehman et al., International Journal of Emerging Trends in Engineering Research, 8(9), September 2020, 6482 – 6487
2.2 IoT in Agriculture Information which is collected by farms sensors is used by
The main factors of sustainability and reliability can be artificial neural networks for predication of production rate of
ensured with implementation of the smart farming concepts. crops. Parameters like temperature, soil, rainfall, pressure and
We can optimization agricultural practices by defining rules humidity in this information. These parameters and their
by application of Machine learning and by recording the real effects on crop growth are discussed and the results evaluated
time rainfall, temperature, humidity and pest activity and [21].
prediction. For predicting soil drying, soil conditions, soil In [22] the authors develop a system to detect animal growth
temperature, and soil moisture KNN ANN /MLP and RBF are in the livestock. It remains successful and very effective for
used [8]. The diseases identifications [9,28] is no more reducing cost, efficient source of energy, and robustness. The
unresolved. The agri-fields are monitored by satellites, Mobile Monitoring System based on RFID to hold the cattle
sensors and drones. The data is collected a for crop pest efficiently by extracting dynamic information about their
management and irrigation system. The real time data we locality and behavior by wireless network. Their behavior is
need field sensors for soil temperature, humidity and analyzed. The used IoT sensors
atmospheric temperature and humidity. with embedded system. The measure many parameters for
The remote sensing system is effective for detection of plant further analysis through this IOT-based system in a smart way.
disease and it is very cheap as compare to traditional methods In [23] cattle are monitored in the fields. The system is
of pest scouting. In modern word, area which can be cultivated developed over Zigbee and WSN. They effectively used WSN
is rapidly reducing. Sensor technologists and agriculture for identifying the locality of the cattle.
scientists are working in collaboration to increase productivity A team of researchers [24] develop disease detection system
in agriculture field [10]. Crop yield predication techniques with “infrared thermography”. They efficaciously detect
have an important role in improving crop productivity because disease over foot and mouth of livestock. They used infrared
they help the farmers in timely decisions about production, thermography for screening the disease.
storage and making of crops as well as risk management [11- Scientist [25] recorded the heartbeat of the cattle. For the
13]. The efficient and sustainable production methods can be purpose they used polar sport tester (PST) monitoring
recognized to build the reliable agriculture strategies. technique for cattle. They monitor animal for their
Machine learning is used for crop prediction in many temperature and heartbeat to identify the diseases.
techniques. Intelligent techniques have been suggested by In [26] the authors developed a real time system by using the
various researchers and have given accurate results as well technology of smart mobiles and Bluetooth system with IOT.
[14]. These tests have been done on small number of crops. They recorded the parameters like temperature and heartbeat
Gonzalez-Sanchez et al.’s study [15] included data from a rate continuously.
large number of crops. Accuracy of different learning methods The health monitor devices are not available in Pakistan
was tested in this analysis and some techniques were proposed market veterinary doctors monitor it manually. [27],[29].
to predict crop growth [16]. The Support vector technique is But sensor for soil temperature and humidity at different
more accurate and precise as compared to ARIMA. It is very levels are available which are accessible for implementation
easy to implement as compared to statistical approaches and testing for our framework.
[17],[30].
In [18] the author shows that factors like temperature of 3. PROPOSED SYSTEM
pacific and Indian ocean, monsoon rainfall and pressure of sea
level have direct impact on growth of agriculture products in In this manuscript we proposed novel framework for smart
Pakistan. Moreover, the results prove the production rate and framing with the federation of Machine learning prediction
amount of monsoon rainfall, all over Pakistan remain system and real-time data collections by sensors, Raspberry
constant, except few cases. Machine learning algorithm U pi3 and IOT technology. We take agriculture practices as use
ChooBoost is used to accommodate idea of PA [19]. Lots of case. The data is collected in DHT11. Raspberry pi is stored
digital information obtained from farm sensors needs to be on cluster by employed the Dstream and txt splitting and
manipulated. Knowledge mining uses this supervised learning cleaning techniques. Once the data is stored, with federated
algorithm (UChooBoost) [20]. UChoo classifier ensembled queries it can be accessed for planning and implementation of
over machine learning. PA votes are assigned with specific the specific agriculture practice.
weights and highest weighted votes are combined to check the The temperature and humidity are main features sensor
performance. Which boost up the performance. The extensive DHT11 to ensure sustainability. The data being processed by
experimentation is carried out over extended data expression. Raspberry pi will be updated continuously and passed to
Results of many assumptions can also be tested with its help streamed cluster. By data analytics the facts and figure can be
which will help in improvement of algorithm performance. presented to the user. The recommendation is also made for a
specific condition.
• It is very useful for predicting and forecasting the upcoming
Advantages of proposed system climate risks
• The temperature and humidity of a particular place to a • Accessible from anywhere, efficient, user friendly.
particular depth for the specific crop can be record
automatically with adjustment. 3.1 Framework
• The raspberry pi 3 requires very small processing space.
6483
Abdul Rehman et al., International Journal of Emerging Trends in Engineering Research, 8(9), September 2020, 6482 – 6487
The monitoring node is raspberry pi3 model b monitor each required information is extracted and build rule of farming for
node and collect real-time data in the form streams which are recommendations as shown in figure 1. When real information
converted to Discretized Stream (DStream) which is is matched, and it is uneven it makes the recommendations.
continuous form of Resilient Distributed Datasets (RDDs).
With spark core functionality and SparkSQL we become 3.2 Real-time DATA
enable to answer the federated query which enables the system The data is captured as mentioned in fig 1. For sensors in same
to make some recommendations. way it also can be collected from satellites and other machines
For getting the continuous and sustainable real-time data the etc. In this paper, we present a simple framework for smart
sensor needed to be connected to the raspberry pi3 model b farming to highlight the new research directions. The data
with jumper wires as in figure no 3. collect about the climate change and we made predictions
accordingly with machine learning what it will have effects
over plants.
3.3 Connectivity
As first step we can access raspberry pi interface on laptop
by following steps
• Wireless WIFI connection is published and shared
• Through SSH the GUI of raspberry pi is accessible by
USB /ethernet cable consoles.
• For identify the default IP address advanced IP scanner
can be used.
• For GUI Xming server and for ssh Xshell can be used to
view the SSH and GUI interface.
•
When it became accessible it shows the login, the default login
and password, which are mentioned on it. We can connect to
the terminal by giving the default password as shown in figure
2.
Figure 1: Framework of smart Farming
T1,T2,T3,T4,T5,T6,T7 are the series of times when the data
is broadcasted. And W1, W2, W3 are the dstream windows.
Which can be stored and can queried by SparKSQL. SparkML
is the module of the spark which is used to implement different
classifier of machine learning to extract the continuous and
discreate, diversified agri-data. The data is available in Figure 2: Password Screen
heterogenous formats like text, web data, and CSV etc. the
6484
Abdul Rehman et al., International Journal of Emerging Trends in Engineering Research, 8(9), September 2020, 6482 – 6487
Now the commands ssh with -X on XShell or Xmanger. We connection of Raspberry pi with DHT11 sensor using project
can visualize the GUI interface Connections. The way of board and jumper wires are shown in figure 3.
The data has been taken from the sensors using IoT setup and
shown in table 1 and table2. Here we show the sample
readings for temperature and humidity. We can see that
Temperature and humidity are changes day to day in
surrounding environment. From these three different samples
calculate minimum, maximum and average values of both
temperature and humidity. Here the DStream windows is the
day when the day reading has conflict with the rule for the
case sugarcane, the system generates alerts and made
recommendations with rules and suggestions
From the table 1 and table2, we take readings of temperature
and humidity for three samples.
Table 2: Humidity from IoT Device
Sample Sample Sample Ma Mi
Date GM
1 2 3 x n
29.04.202 32.65
32 34 32 34 33
Figure 3: Outer Interface Connection Setting 0 3
Let take an example of sugarcane which has different growth
stages such as 30.04.202 29.92
Germination of duration: 15 - 45 days, 28 29 33 33 28
0 4
Tillering of duration: 92 days,
vegetative of duration: 93 days
maturing normally duration: 60-75 days.
31.04.202 29.52
The rule for temperature is as followed for different stages. 0
26 30 33 33 26
5
Table 1: Temperature from IoT Devices
Stages Optimal Temperature .
4. CONCLUSION
In the manuscript we elaborate the novel framework of
Sowing 25-30 C recommendations system for smart and precision farming. We
try to ensure its sustainability be federating different
heterogeneous data from diversified resources. We conduct
Germination 28 -30 C analysis and made rules for making recommendations and
suggestions. We also predict the upcoming risks on the basis
Tillering < 30 C of available data. The data includes the various parameters
including weather forecast, soil conditions, atmospheric
Vegetative 28-38C conditions, irrigation plan, cropping pattern information, pest
scouting and control policies by Government, fertilizers doses
and applications for various crops and crop yields etc. we
Maturing 10C
used the partial for this prototype in future we use the whole
data for big and complete solution of smart farming. The
implementations of real-time protype by using DHT11 sensor
For the rule generated from the data by machine learning, show the new way of research to be get informed about the
when the value of temperature form real-time system become field about the atmospheric and soil conditions of data on time.
worst, the system generate serious alert and also made We effectively used the big data technologies like Hadoop
recommendation that how, the temperature can be lessened or ecosystem with spark to predict and suggest the plan for the
increased to get the optimal value. Is the irrigation required. agricultural practices.
When the temperature is greater or less then the optimal value
but not to worry, the recommendation system sends warnings.
6485
Abdul Rehman et al., International Journal of Emerging Trends in Engineering Research, 8(9), September 2020, 6482 – 6487
Cloud, in Proc. of IEEE International Conference on Recent
REFERENCES Trends in Information, Telecommunication and Computing,
[1] C. Abrar and A. Nadia. Climate-Smart Agriculture in Kochi, pp. 321-323, 2010.
Pakistan, CIAT / World Bank [16] R. Kumar, M. P. Singh, P. Kumar and J.P. Singh. Crop
https://cgspace.cgiar.org/handle/10568/83340, 2017 Selection Method to Maximize Crop Yield Rate using
M. Kaur, G. Heena and H. Kundra. Data Mining in Machine Learning Technique. In Proc. of IEEE
Agriculture on Crop Price Prediction Techniques and International Conference on Smart Technologies and
Applications, International Journal of Computer Management for Computing, Communication, Controls,
Applications, Vol. 99, no.12, pp. 1-3, August 2014. Energy and Materials ICSTM, India, 2015, pp. 138-145.
[2] S. Hussain, F. Kabeer, W. Ali and K. Jamshed. A New [17] Z. Peng, Y. Zheng and S. Hamlin. A Novel Architecture
Framework to Integrate Wireless Sensor Networks with Based on Cloud Computing for Wireless Sensor Network,
Cloud Computing, in Proc. of IEEE Aerospace Conference, in Proc. of 2nd International Conference on Computer
USA, 2013, pp. 2-9. Science and Electronics Engineering ICCSEE, pp 472-475,
[4] F. X. Diebold. On the Origin(s) and Development of the 2013.
Term “Big Data, Penn Institute for Economic Research, [18] R. Sudarsan, V. Rao, N. Satyanarayana and V. L.
Pennsylvania, 2012, pp-12-37. Prasanna. Generic Integrated Secured WSN-Cloud
[5] D. Laney. 3-D Data Management: Controlling Data Computing for U-Life Care, International Journal of
Volume, Velocity and Variety, META Group Research Note, Engineering Science and Advanced Technology, Vol. 2, no. 4,
Vol. 6, no. 70, pp.1, 2001. pp 897-907, 2011.
[6] Apache Spark: https://spark.apache.org/ [19] M. Firdhous, O. Ghazali and S. Hassan. Trust
[7] V. C. Patil, K. A. A1-Gaadi, D. P. Biradar and M. Management in Cloud Computing: A Critical Review,
Rangaswamy. Internet Of Things (IoT) and Cloud International Journal on Advances in ICT for Emerging
Computing for Agriculture: An Overview, in Proc. of agro- Regions, Vol. 4, no. 2, pp. 24-36, 2011.
informatics and precision agriculture (AIPA), India, 2012, pp. [20] V. Rajesh, O. Pandithurai and S. Magesh. Wireless
292-296. sensor data on cloud, in Proc. of IEEE International
[8] E. Khandakar, A. Unayes and M. A. Gregory. Integrating Conference on Communication, Control and Computing
Wireless Sensor Networks with Cloud Computing, in Proc. Technologies, Ramanathapuram, 2010, pp. 476-481.
of 7th International Conference on Mobile Ad-hoc and Sensor [21] Y. Rupika, J. Rathod and N. Vaishnavi. Big data meets
Networks (MSN), Beijing, 2011, pp.16-18. small sensors in precision agriculture, International
[9] D. S. Sawaitul, K.P. Wagh and P. N. Chatur. Journal of Computer Applications, Vol. 975, pp. 8887, 2015.
Classification and Prediction of Future Weather by using [22] A. Lounis, H. Abdelkrim, A. Bouabdallah and Y. Challal.
Back Propagation Algorithm- An Approach, International Secure and Scalable Cloud-based Architecture for e-
Journal of Emerging Technology and Advanced Engineering, Health Wireless sensor networks, in Proc. of 21st
Vol. 2, no. 1, pp. 110-113, January 2012. International Conference on Computer Communications and
[10] I. Jagielska, C. Mattehews and T. Whitfort. An Networks (ICCCN), Munich, 2012, pp 1-7.
investigation into the application of neural networks, fuzzy [23] P. Langendoerfer, K. Piotrowski, M. Diaz and B. Rubio,
logic, genetic algorithms, and rough sets to automated Distributed Shared Memory as an Approach for
knowledge acquisition for classification problems, Neuro Integrating WSNs and Cloud Computing, in Proc. of 5th
computing, Vol. 24, no. 1-3, pp.37-54, 2012. International Conference on New Technologies, Mobility and
[11] D. Ramesh and B. V. Vardhan. Analysis of Crop Yield Security, Istanbul, 2012, pp 1-6.
Prediction Using Data Mining Techniques, International [24] C. Srimathi, P. Soo-Hyun, N. Rajesh. Proposed
Journal of Research in Engineering and Technology, Vol. 4, framework for underwater sensor Cloud for
no. 1, pp. 47-473, January 2015. environmental Monitoring, in Proc. of 5th International
[12] S. Veenadhari, B. Misra and C. D. Singh. Data Mining Conference on Ubiquitous and Future Networks, Da Nang,
Techniques for Predicting Crop Productivity – A Review 2013, pp. 104-109.
Article, International Journal of Computer Science and [25] F. Tongrang, Z. Xuan and G. Feng. Cloud Storage
Technology IJCST, Vol. 2, no. 1, pp. 90-100, March 2011. Solution for WSN Based on Internet Innovation Union,
[13] W. Duncan, K. Rabah. Environmental Conditions’ Big International Journal of Database Theory and Application,
Data Management and Cloud Computing Analytics for Vol. 22, pp. 164-169, 2013.
Sustainable Agriculture, World Journal of Computer [26] S. Rajeswari, K. Suthendran and K, Rajakumar. A Smart
Application and Technology, Vol.2, no.3, pp. 73-81, 2014. Agricultural Model by Integrating IoT, Mobile and Cloud-
[14] R. Piyare, S. Park, S. Y. Maeng, S. H. Chan, S. G. Choi, based Big Data Analytics, International Journal of Pure and
H. S. Choi and S. R. Lee. Integrating Wireless Sensor Applied Mathematics, Vol. 118, no. 8, pp. 365-370, 2018.
Network into Cloud Services for Real-time Data [27] S. Rajeswari, K. Suthendran, K. Rajakumar and S.
Collection, in Proc. of International Conference on ICT Arumugam. An Overview of the MapReduce Model,
Convergence, Jeju, pp. 752-756, 2013. Lecture Notes in Computer Science, Vol. 10398, pp. 312-317,
[15] V.Rajesh, J. M. Gnanasekar, R. S. Ponmagal and P. 2017.
Anbalagan. Integration of Wireless Sensor Network with
6486
Abdul Rehman et al., International Journal of Emerging Trends in Engineering Research, 8(9), September 2020, 6482 – 6487
[28] M. Ongayev, Z. Sultanova, S. Denizbayev, G. Ozhanov
and S. Abisheva. Engineering and Process Infrastructure
of the Agro-Industrial Complex, International Journal of
Emerging Trends in Engineering Research, Vol. 7, no. 12, pp.
879-885, 2019.
[29] S. Aleksander, A. Konev, T. Kosachenko and D. Dudkin.
Threat Model for IoT Systems on the Example of
OpenUNB Protocol, International Journal of Emerging
Trends in Engineering Research, Vol. 7, no. 9, pp. 834-290,
2019.
[30] L. Boggula, B. Navyasri. Energy Efficient Routing
Mechanism for Harsh Environment in Wireless Sensor
Networks, International Journal of Emerging Trends in
Engineering Research, Vol. 7, no. 9, pp. 234-238, 2019.
[31] Apache kafka: https://kafka.apache.org/
6487
View publication stats