You are on page 1of 6

Smart Aquaponics with Disease Detection

Roysing Barosa Sayed Issamuddine Sayed Hassen Leckraj Nagowah


Software and Information Systems Software and Information Systems Software and Information Systems
University of Mauritius University of Mauritius University of Mauritius
Réduit, Mauritius Réduit, Mauritius Réduit, Mauritius
roysing.barosa@umail.uom.ac.mu sayed.sayed1@umail.uom.ac.mu l.nagowah@uom.ac.mu

Abstract— The vision of the Mauritian’s Ministry of Agro- pH range of 6-7 among other parameters [7]. A smart
Industry and Food security is to further develop the agricultural aquaponics system is therefore one where these parameters are
sector and to promote the agro-industry by focusing on safety, automatically monitored and controlled using sensors and
supply, quality, innovation and new technologies. This research actuators.
work attempts to develop a smart aquaponics system that
combines conventional aquaculture with hydroponics. The As pointed out by Khirade and Patil, the identification of
system uses the Internet of Things to continuously sense and plant diseases is key to preventing losses in the yield and
control the environment and to provide real-time feedback and quantity of agricultural product [8]. Hence, Artificial
alerts to the owner through a mobile application. It features a Intelligence (AI) with image processing can be very useful in
camera surveillance system that enables live streaming of the a smart aquaponics system. Diseases in plants can therefore be
aquaponics setup and also allows for further image processing. identified, analyzed and classified automatically without any
Through the captured images, the system performs leaf human interaction.
recognition identifying the type of the leaf. Moreover, the system
also performs disease detection that identifies if the leaf, and The primary objective of this paper is to design and
consequently the plant, is suffering from a specific disease. If the develop a smart aquaponics system that combines
system detects a disease, it automatically generates a report conventional aquaculture with hydroponics. The owner of the
which is sent to the owner through the mobile application. The smart aquaponics system should be able to remotely monitor
prototype has been tested and looks very promising. We hope and automatically control the environment of the plants and
that this work paves the way towards a smart aquaponics system fish through a mobile application. The owner should also be
that detects, identifies and notifies the owner of possible diseases able to view the status of various parameters through sensor
at early stage before their propagation. readings and be automatically notified in case of anomalies.
The paper also introduces a disease detection system in such
Keywords— Internet of Things, smart aquaponics, image an environment where the system performs a leaf
processing, leaf identification, disease detection identification and detects the presence of diseases, if any, on
I. INTRODUCTION the leaves. A resulting report is then sent to the owner with the
infected leaf as attachment. A prototype application has been
Agriculture is undergoing a fourth revolution triggered by successfully implemented and tested.
the exponentially increasing use of information and
communication technology [1]. Agriculture has become The remainder of this paper is structured as follows. Some
autonomous through robots which perform most of the related works are summarized in section 2. Our system,
mechanical works either under the soil, around the plants or Plantabo Aevum, is presented in section 3. We discuss the
even aerially like livestock monitoring through drones. As a implementation of the prototype in section 4. Section 5
result, agriculture has now transformed into smart agriculture. presents an evaluation of our system and finally, we conclude
the paper in section 6.
The land area of Mauritius is about 1965 km2, with an
estimated population of 1.2 million people [2]. With land II. RELATED WORKS
under agricultural production reaching 44% of the arable land In this section, firstly, some works related to aquaponics
area, Mauritius is a big food importer with a self-sufficiency were surveyed to have a general idea about the setup and the
ratio of less than 30 %. On top of this, Mauritius, being a inherent characteristics, and secondly, an investigation was
tropical island, is often affected by natural calamities such as carried out on selected works related to disease detection using
cyclones and flash floods. As highlighted by Elia et al., a image processing.
possible solution to food security and sustainability is the use
of aquaponics [3]. Aquaponics is an integrated multi-trophic Adhitya et al. [9] used Arduino microcontrollers to control
system that combines elements of recirculating aquaculture the different agricultural features of a mushroom farm. The
and hydroponics whereby the water from the fish tanks, that Arduino sensor system collected the following data:
is enriched in nutrients, is used for plant growth [4]. While fish temperature and humidity, atmospheric pressure, soil moisture
farming is being done, their waste is used to fertilize the water and temperature, leaf wetness, solar and ultraviolet radiation,
which continuously flows through a water bank. wind speed and amount of rain. A sensor board extension was
used to connect all the sensors. Controlling air conditioning
Although aquaponics can solve the problems related to and irrigation system were examples of the uses of the sensors
food security and sustainability, its operation can be daunting and the sensor board. Moreover, MQ Sensor protocol was
since it is imperative to continuously monitor the parameters used to connect the device with the IoT Cloud and to transfer
for the healthy growth of the plants and fish [5]. The three the data.
groups of organisms, namely plants, fish, and bacteria, in an
aquaponics system, require adequate levels of water Channe et al. [10] used the SensorKit module to provide
temperature, pH, and dissolved oxygen for maximum growth memory, processing and GPS to track positional information.
and health [6]. The ideal parameters for an aquaponics system Sensors were used to measure soil pH, soil moisture and
can be considered as an agreement between these three groups concentration of potassium, phosphorus and nitrate in the soil.
of organisms and involve a temperature range of 18-30 °C, a The AgroCloud modules stored information about the farmers

978-1-7281-1460-6/19/$31.00 ©2019 IEEE


and their soil parameters. The IoT setup sensed the soil and
environment parameters and sent these values to the
AgroCloud. Big data analytics was carried out on the
AgroCloud data to guide the farmers for their fertilizer
requirements, total production and current stock and market
requirements.
The system of Dan Wang et al. [11] consisted of 3 main
components: data acquisition, mobile transfer and interactive
application. The data acquired by the sensors and the webcam
were analyzed and processed for man-machine interaction.
The system also catered for a mobile application with which
the users can interact to remotely control and monitor the
aquaponics setup.
Mohanty et al. [12] used 54,306 pictures of infected and
healthy plant leaves for their dataset of which they created 3
versions: color, gray-scale, and segmented. They carried
several tests on two popular neural network architectures
namely AlexNet and GoogLeNet. They could identify 14 crop
species and 26 diseases with an accuracy of above 85%.
Sannakki et al. [13] demonstrated the detection and Fig. 1. Architecture of Plantabo Aevum
quantification of plant disease symptoms by combining
thresholding and fuzzy logic. Thresholding is an algorithm • The IoT Setup
that converts the RGB pixels into a color measurement that
binary machines can understand. Instead of considering a The IoT setup is positioned on top of the aquaponics setup
value to be either true or false, the fuzzy reasoning considers and consists of two Raspberry Pi (RPi) 3 and one Arduino
its percentage of truth and false values. Thresholding was used Uno. The latter has been used since it processes analogue data
to determine if the plant was infected and fuzzy logic was used much faster and more accurately than a RPi equipped with an
to determine if the plant or plant’s part was infected. analogue to digital convertor. The first RPi is responsible for
collecting data from the other sensors which are then sent to a
Gavhale et al. [14] performed five main steps in order to real-time database. The RPi reads the user’s instructions from
extract and classify leaf diseases. The image was captured the real-time database and activates the actuators accordingly.
using a digital camera. They pre-processed the captured leaf The IoT setup consists of the following sensors: air
images using image enhancement and color space conversion. temperature and humidity, soil temperature and humidity, pH,
Segmentation was then done using the feature-based k-means light sensors and pi cameras. The other RPi is dedicated to the
algorithm. A texture feature extraction was then performed disease detection system. This allows the possibility to tailor
using statistical Gray-Level Co-Occurrence Matrix and finally the system according to different stations and allow further
classification was achieved by using Support Vector Machine. works like advanced video processing.
The smart aquaponics systems seem to have a
• Leaf and Disease Detection
standard list of sensors, actuators and modules irrespective of
the microcontrollers used. The most commonly used sensors This component uses one Raspberry Pi with an increased
include air temperature and humidity, soil moisture and RAM to run OpenCV. Images of leaves are captured and
temperature and pH sensors. With respect to disease detection processed to identify the leaf and to detect the possible
using image processing, several works have been carried out diseases through a machine learning classifier.
with MATLAB since it can easily be used to build deep
learning models. However, few works have been performed • Real-Time Database
on disease detection in a smart aquaponics environment. The The FireBase real-time database stores data obtained from
automatic identification of diseases can be very beneficial to the sensors and actuators. ThingSpeak has been used to
and vital for the small planters. generate user friendly interpretations in the forms of graphs
and widgets for monitoring purposes. The real-time database
III. SYSTEM ARCHITECTURE therefore acts as a bridge between the IoT setup and the mobile
Fig. 1 gives the architectural diagram of the proposed application.
system, named Plantabo Aevum. It consists of the following
main components: • Mobile Application

• Aquaponics Setup The mobile application retrieves the status of the sensors
through ThingSpeak web view and Firebase. The user is also
The setup consists of the different components needed for able to perform a live viewing of the aquaponics and its IoT
a proper farming of plants and fish. The fish reside in the water setup. The application can also be used to set the actuators in
of the lower component. The fish excrements fertilize the their desired positions. Alerts about any suspected diseases are
water which is then pumped to the plant component for plant sent to the mobile application through emails with an attached
nourishment. photo.
extraction (e.g. convexity, extreme points from diagonals,
length center to extreme points, segments number, segments
lengths etc…) and post-processing (areas, perimeters, ratio
etc…) to obtain a better classification of the leaf name which
is computed through a decision tree comparing the values of
different extracted features. The training of the anomaly
detection is more concerned about the pre-processing and
feature extraction of the images. The different filters, i.e.
thresholding, dilatation and erosion amongst others have
different limit values and the ideal values are found during the
training sessions. Finally, the post processing calculations and
Fig. 2. Aquaponics and IoT Setup the results obtained from the two sections are then merged to
obtain a final classification of the possible disease name.
Fig. 2 shows the aquaponics and IoT setup. The main
components of the setup are as follows: IV. SYSTEM PROTOTYPE
• Fish Component - the main habitat of the aquatic As highlighted in the previous section, the Plantabo
animals with their excrements. The waste produced Aevum project consists of a number of components namely the
by the fish supplies the nutrients for plants grown aquaponics setup, IoT system, the mobile application and the
hydroponically which in turn purify the water. leaf identification and disease detection.
• Plant Component - the site of fresh living plants using A. Setting up the Environment
the cycled and fertilized water within the setup. To setup the environment, several hardware and software
• Soil Component - the site of fresh living plants using have been used and are as follows:
the cycled and fertilized water as watering system. • The IoT Setup
• Sensor Components - to collect all required data and For the IoT setup, the following hardware has been used:
send them to the microcontrollers. 2 x Raspberry pi 3 B +, Arduino Uno, LED Screen, wireless
keyboard and mouse, DHT11, LDR, Soil Hygrometer, Float
• Actuator Components – to help in achieving a proper
meter, PH electrode probe BNC, Water Level Sensor, 240V
climatic condition
Pump, Mini Submersible Water Pump 3-6V, 12V Cooling
• Microcontroller components – to retrieve the sensor Fan, SG90, GPS Module Ubox NEO-6m, LED, Buzzer,
data, process them and give instructions to actuators. Relays and 2 pi cameras.
Fig. 3 highlights the proposed framework. The following software and libraries/plugins have been
used: Raspbian OS Jessie, Python Programming Language V
2.7.3, ADAFRUIT library V 2.1.0, Pyrebase Library (Python-
firebase) V 3.0.27, Urllib2 Library V 2.7.9, Picamera Library
V 1.10.1, SocketServer Library, SMTPlib Library V 1.0 and
MIMEMultipart Library V 1.0.
• The Android mobile application
To create the mobile application, the following hardware
has been used: MacBook Pro 15”, Samsung Galaxy S7 and
Samsung Galaxy Note 8.
The following software and libraries/plugins have been
used: Android Studio IDE (V3.2.1 for Mac OS), GoogleMap
library V16.0, Firebase-auth library V16.1.0, Firebase-
database library V16.0.5, Firebase-messaging library V12.0.1
and Google play services library V16.0.0.
• The Leaf Identification and Disease Detection System
The following hardware has been used: low-resolution
camera on Samsung Galaxy S7, pure white led stripe and
white A4 paper.
The following software and libraries/plugins have been
used: Raspbian OS Wheezy, Python Programming language
V 3.6, OpenCV2 V 3.1.0, Numpy library for cv2 V 1.9.2,
Fig. 3. Proposed Framework Imutils library for cv2, Smtplib Library V 1.0, MIME
Multipart Library V 1.0 and TinyGPS.
The disease detection system is divided into two core
section which are the leaf type (name) detection and the B. The Prototype
anomalies detection. Both sections require training for pre- Fig. 4 shows the smart aquaponics prototype which
processing, feature extraction or post-processing. The leaf consists of the aquaponics and IoT setup. The following
detection section requires more training after the feature functionalities have been successfully implemented:
Data Monitoring - The data from sensors and actuators are C. Leaf Identification
read, sent to ThingSpeak and displayed on the mobile In order to identify the leaf type/name, the following
application in the form of graphs and widgets as shown in Fig. processes have been carried out.
5. The monitored data are temperature, humidity, soil
moisture, water level, water pH, light intensity, location and • Pre-Processing
status of actuators.
Converting an image in grayscale eases the process image
processing since differentiating between different colors can
be complex. Blurring the image allows to remove noise on the
image and thresholding acts as a barrier between white and
black colors. It consists of dilating and eroding the image to
fill small holes in the image.
• Feature Extraction
To find contour of leaf, the second largest area is detected
since the largest area is the frame of the photo itself. The area
of the leaf has been found using the
contourArea(‘contour_index’) function in the openCV library.
The perimeter of the leaf (Fig. 9a) was found using the
arcLength(‘contour_index’, True). A rectangle was then
bounded around the leaf to get the length and width of the leaf.
The threshold image was then broken down into 16
segmentations (Fig. 9b). Contours were drawn, and bounding
Fig. 4. The smart aquaponics prototype rectangle have been produced on each segmentation so as to
get their length. From the bounding rectangle of the leaf, the
Controlling Modes – Three different modes of controlling length, midpoint of length, width and midpoint of width were
the smart aquaponics system have been implemented, namely found. Using these lengths, 1 horizontal line, 1 vertical line
the manual, automatic and timer modes. In the manual mode, and 2 diagonals were drawn (Fig. 9c). A circle is drawn on the
the user can control the different actuators. In the automatic point where the lines cross each other so that the 4 lines
mode, the user presets the parameters, e.g. temperature, become 8 lines.
humidity etc.… and the actuators are automatically
manipulated for the environment to reach the targeted values,
e.g. by watering the soil or by turning on the lights. In the timer
mode, the user sets the time for which the actuators should be
turned on and off. Fig. 6 shows the screen for the manual mode
and Fig. 7 shows the watering system being turned on.
Camera Surveillance - The user can use the mobile app to
have a live view of the smart aquaponics setup. Fig. 8 shows
a snapshot of the live camera feed.

Fig. 9. Contour, Bounding Rectangle and Segmentation

Threshold and contours were applied to cut the lines on the


edge of the leaf. Using a loop, the 8 lines contours and their
corresponding bounding rectangles were drawn. From the
length and width of the bounding rectangles, the length of the
lines was found by using Pythagoras theorem (Fig. 10).

Fig. 5. Monitoring with graphs and Fig. 6. Manual Mode


widgets

Fig. 10. Calculating the length of the lines

Moreover, a convex hull line was drawn. Consequently,


the perimeter and area of the perimeter were found as well as
the convexity points. The values of all extracted features were
Fig. 7. Manually watering the Fig. 8. Live view of the setup then inserted in an array.
soil
D. Disease Identification - Brown/Black Spots name, area, perimeter, area_hull, perimeter_hull, ratio
This section outlines the detections of brown and black perimeter to area, ratio perimeter_hull to area, convexity,
spots using OpenCV and Fig. 11 shows the results. extreme points from diagonals, length center to extreme
points, segments number, segments lengths and areas.
• Pre-Processing
The Gaussian blur has been applied to the image in such a
way that the small brown spots on the leaf are not considered
as noise and are not removed. Dilatation has been preferred
over erosion since the white spots tend to expand with the
latter. However, with dilation, the number of iterations were
carefully chosen so that noises on the leaf image are not be
considered either as brown spots or black spots.
• Feature Extraction
All possibilities of brown objects are found through their
Fig. 12. The constructed dataset
contours. The contours are drawn if detected.
• Post Processing The classifier took the values of the features extracted
from the image and obtained from the above sections and use
The number of brown/black contours are saved and the ratio principle (e.g. the ratio perimeter to area or
returned to the main class. perimeter_hull to area_hull) to compare it to the classifier.
E. Disease Identification - White Spots After the leaf type has been detected through the classifier,
This kind of disease is very common in many types of the system searches for possible diseases based on the types
plants. This section outlines how it was detected on OpenCV. of spots identified and based on the identified leaf. The system
then predicts the probable disease names along with their
• Pre-Processing prediction accuracy. The degree to which the leaf has been
All the pre-processing phases are mostly the same as for affected is also displayed and has been calculated using the
the leaf detection. following formulae:
• Feature Extraction %White infected = White Area/leaf Area * 100
All possibilities of white objects are found through their %Black infected = Black Area/ leaf Area * 100
contours. Since a white background was used, its contour was %Brown infected = Brown Area/ leaf Area * 100
also detected. So, to remove this unwanted contour, the
position of the largest contour area has been calculated and A mail, with an image of the infected leaf attached, is then
removed. The contours are drawn if detected. sent to the user. Table I shows some of the testing carried out
on healthy and unhealthy leaves. The system could
• Post-Processing successfully identify the leaf and the probable diseases from
The number of white contours was then saved and returned which the leaf and plant suffered.
to the main class for further calculations. V. EVALUATION
We evaluated our system, Plantabo Aevum, against other
similar smart aquaponics and deduce that in terms of sensors
and actuators, Plantabo Aevum performs comparatively with
respect to other systems whereby similar devices were used.
The main feature that demarcates Plantabo Aevum with other
smart aquaponics system is its ability to detect the presence or
absence of diseases on the leaves of a plant. Though in our
prototype, we made use of a low-resolution camera to capture
only the infected leaf, we believe that with a powerful camera,
this limitation would have been easily overcome and a picture
of the whole plant could have been taken with the different
Fig. 11. Identification of While, Brown And Black Spots leaves being extracted. As the leaf identification and disease
detection system is based on a constructed dataset, the
F. Machine Learning Classification accuracy of the system can easily be increased since it depends
In order to identify the disease, the classifier has been on the number of leaves’ features collected and the number of
implemented using RapidMiner [15]. It uses the decision tree records in the dataset. Fig. 13 shows the 3D scattered graph
methodology which analyzes the variables in the dataset to see obtained from our dataset which shows that the training data
which ones are most informative and predictive of classes in used was reliable. The values were well grouped and quite
the dataset. In the absence of a dataset for our local context, distinct. Another important aspect worth noting is that since
we constructed our own dataset with more than 50 leaves of our system uses different ratios, the system performed
each plant species being used with due consideration given to correctly irrespective of the distance between the camera and
both sides of the leaves. The 4 leaf species considered were the leaf and also irrespective of the side of the leaf.
the eggplant, chilli, citrus and mandarin. Fig. 12 shows an
extract of the dataset obtained. The fields stored were the leaf
TABLE I. LEAF AND ANOMALY DETECTION can have a live camera feed and observe the plants and fish. A
Original Leaf Leaf & Anomaly Notification on Mobile disease detection system has also been presented which firstly
Detection App identifies the leaf and then attempts to detect the presence or
absence of diseases on the leaf. We constructed our own
dataset with more than 50 leaves of each of the 4 species
considered in this work, namely eggplant, chilli, citrus and
mandarin. If an anomaly is detected, the owner is notified
through an email with the infected leaf sent as an attachment.
The system can be enhanced in several ways. The system
could be trained to detect a larger number of leaves especially
those available in the local context and those who are regularly
infected by diseases. The number of leaves of each species
could be increased to achieve a higher accuracy for the disease
prediction. Moreover, latest deep learning models such as
GoogLeNet and AlexNet could be investigated.
Leaf Healthy - REFERENCES
No notification received.
[1] A. Walter, R. Finger, R. Huber and N. Buchmann, “Opinion: Smart
farming is key to developing sustainable agriculture”, Proceedings of
the National Academy of Sciences, 114(24), pp. 6148-6150, 2017.
[2] Ministry of Agro Industry and Food Security, “An overview",
Agriculture.govmu.org, 2019. [Online]. Available:
http://agriculture.govmu.org/English/AboutUs/Pages/An-
overview.aspx. [Accessed: 30- Jan- 2019].
[3] E. Elia, C. Hodoşan, L. Nistor, F. Dumitrache and N. A. Udroiu,
“System cycling stage on aquaponic systems as required prerequisite
for soilless agriculture,” Scientific Papers: Series D, Animal Science,
vol. LVIII, pp. 381–384, 2015.
[4] S. Goddek, B. Delaide, U. Mankasingh, K. Ragnarsdottir, H. Jijakli,
and R. Thorarinsdottir, Challenges of sustainable and commercial
aquaponics. Sustainability, 7(4), pp. 4199-4224, 2015.
[5] A. K. Ng, Y. K. Lim, H. S. Tay, W. S. Kwang, S. R. Hettiarachchi, “A
smart recirculating aquaculture system with NI compactRIO and
Leaf Healthy - WSN,” in Proceedings of NI Engineering Impact Awards
No notification received. ASEAN/ANZ Regional Contest, pp. 24-32, 2016.
[6] C. Somerville, M. Cohen, E. Pantanella, A. Stankus and A. Lovatelli,
"Small-scale aquaponic food production: Integrated fish and plant
farming”, FAO Fisheries and Aquaculture Technical Paper No. 589.
Rome, FAO, pp. 262, 2014.
[7] T. Shafeena, “Smart aquaponics system: challenges and opportunities,”
European Journal of Advances in Engineering and Technology, vol.
3(2), pp. 52–55, 2016.
[8] S. D. Khirade and A. B. Patil, “Plant disease detection using image
processing”, In 2015 International conference on computing
communication control and automation, pp. 768-771, IEEE, 2015.
[9] R. Y. Adhitya, M. A. Ramadhan, S. Kautsar, N. Rinanto, S. T. Sarena,
I. Munadhif, M. Syai'in, R. T. Soelistijono and A. Soeprijanto,
“Comparison methods of Fuzzy Logic Control and Feed Forward
Neural Network in automatic operating temperature and humidity
control system (Oyster Mushroom Farm House) using
microcontroller”, In 2016 International Symposium on Electronics and
Smart Devices (ISESD), pp. 168-173, IEEE, 2016.
[10] H. Channe, S. Kothari and D. Kadam, “Multidisciplinary model for
smart agriculture using internet-of-things (IoT), sensors, cloud-
computing, mobile-computing & big-data analysis”, Int. J. Computer
Technology & Applications, 6(3), pp. 374-382, 2015.
[11] D. Wang, J. Zhao, L. Huang and D. Xu, “Design of A Smart Monitoring
and Control System for Aquaponics Based on OpenWrt”, In 5th
International Conference on Information Engineering for Mechanics
and Materials, Atlantis Press, 2015.
Fig. 13. 3D Scattered Graph
[12] S. P. Mohanty, D. P. Hughes, and M. Salathé, “Using deep learning for
image-based plant disease detection”, Frontiers in plant science, 7, pp.
VI. CONCLUSION 1419, 2016
In this paper, a smart aquaponics system has been [13] S. S. Sannakki, V. S. Rajpurohit, V. B. Nargund, A. Kumar and P. S.
presented which combines conventional aquaculture with Yallur, “Leaf disease grading by machine vision and fuzzy logic”, Int
J, 2(5), pp. 1709-1716, 2011.
hydroponics. The system uses the Internet of Things that
[14] K. R. Gavhale, U. Gawande and K. O. Hajari, “Unhealthy region of
continuously monitors and controls the environment. The citrus leaf detection using image processing techniques”, In
system features a mobile application that can be used to view International Conference for Convergence for Technology-2014, pp.
the status of the smart aquaponics system and also control the 1-6, IEEE, 2014.
different actuators present in the setup taking into account the [15] M. Hofmann and R. Klinkenberg, “RapidMiner: Data mining use cases
sensor readings. Through the mobile application, the owner and business analytics applications”, CRC Press, 2013.

You might also like