Environmental monitoring and disease detection of plants in smart greenhouse using internet of things

This research implements the idea of automation using Internet of Things (IoT) in a greenhouse environment. The development is focuses on deployment of agicultural greenhouses into small-scale level transforming it into a smart greenhouse. They are to help in monitoring the greenhouse environment conditions, water irrigation management, image collection using installed cameras as well as predicting diseases in the plants on collected leaf datasets. This research focus on development for the purpose of validating a proposed system design and architecture for a suitable IoT based monitoring for environment conditions, managing water irrigation system and a effective method for detecting leaf diseases on the plants inside a greenhouse environment.


Introduction
The Internet of Things (IoT) has been applied in many areas of technology such as smart farming, smart home, wearables devices, smart city, smart villages, connected healthcare, connected vehicles, connected drones and other areas. The IoT allows physical entities and objects to connect, communicate and coordinate with each other, share information and coordinate decisions. The IoT transforms traditional objects into intelligent smart objects by exploiting its enabling technologies such as communication technologies, internet protocols, application, and sensor networks. The global smart agriculture market is expected to reach $18.0 billion by the end of 2024 compared to $5 billion in the year 2016 [1]. Smart agriculture will become an important IoT application area in agri-products based exporting countries. The IoT application also deployed for smart agriculture using wireless sensor networks (WSNs) such as sensor network for irrigation, prediction of disastrous events, precision soil farming, blind entity identification, smart farming, and precision agriculture. To develop a green IoT-based agriculture solution, there are challenges, including, hardware, data analytics, maintenance, mobility and infrastructure. The hardware challenges concern the choice of sensors and distance for IoT devices. Therefore, there are various kinds of sensors types that can be used in IoT application (e.g., temperature sensor, proximity sensor, pressure sensor, water quality sensor, chemical sensor, gas sensor, humidity sensor etc). The data analytics challenge concerns the application of predictive algorithms and machine learning (e.g. deep learning approaches) in IoT data to obtain a productive solution for smart agriculture. The maintenance challenge concerns sensory performance for all IoT devices since they can be easily damaged in the agriculture field. The mobility challenge concerns the type and medium of wireless communication (e.g. 4G, 5G, WiFi, 6LowPan, LoRa) that can connect sensors distributed over a large area in the agriculture field. The infrastructure challenges concern the installation and development of IoT networking architecture using new technologies such as fog computing, edge computing, cloud computing, network virtualization etc.
The research implements the idea of Internet of Things (IoT) in a greenhouse as a development for smallscale deployment in greenhouse environment. The IoT enabling technologies applied for this development comprise of image processing tools, single-board microcontroller, temperature and humidity measuring sensor and a testing platform. They are to help in monitoring the temperature and humidity condition inside greenhouse and predicting diseases on the plant dataset. Therefore, both research and development are required Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI. in this kind of domain. However, this research focus on development in order to validate a proposed method suitable for detecting plant diseases on plant leaf dataset.
The various deployment of greenhouses into practice results into some major issues in plantation management and minor technical flaws on overall maintenance of these greenhouses. One of the major problems arise with the maintenance of temperature. The temperature control effect arises due to the structure of the greenhouse environment since the greenhouse is covered with large sheets from top-bottom and right-left surroundings. Therefore, the effect of sunlight, rainfall and natural air doesn't apply inside the greenhouse. It will create low-temperature, less humidity and turbulence in ventilation. It is required to have a continuous monitoring to have a sustainable maintenance of greenhouse environment manually within time schedules. Due to its covered structure, the irrigation of plants doesn't have direct access to the natural soil. Therefore, there is needed to have continuous supply of water for effective plantation manually within spans of schedule. Greenhouses were also affected with pest insects and flies due its covered structure which create turbulence for any reptile or fly to be stuck in the covered sheet. This turbulence can caused sever harm to plant health eventually results into the decline of their growth. Due to these concerns factors there is a need to review the practice of greenhouse and integrate technology to resolve those concerns.
This research focuses on implementing internet of things (IoT) as a solution to the problem related to monitoring of temperature and detecting potential disease in the plant from leaf datasets. This project will help the agribusinesses, farmers, horticulturist and potential investors to apply internet of things (IoT) into existing greenhouse to transform the greenhouse into a smart greenhouse. It also supports potential investor to review the benefits of internet of things (IoT) by applying into agribusiness as a startup in this industry.

Literature review and related work
In [2] presented the idea of internet of things (IoT) deployment in a tomato greenhouse located in Michurinsk, the Tambov region in Russia. This deployment is focuses on the automation for greenhouse on the 5000 m 2 total area of deployment. The purpose of this deployment is to identify the monitoring aspect of greenhouse and the growth rate of tomatoes. This system also comprises of various other subsystems which were deployed for achieving sensory information, data analytics, remote monitoring, modeling structure for plant growth, and lastly for data visualization and insights. The sensors and actuators deployed are used for the monitoring of greenhouse and the plants cultivated inside it. The purpose of these sensors and actuators are to gather the data relevant to the growth rate of plants and the changing conditions inside the greenhouse (e.g. ventilation, nutrition and illumination).
Management Information System supports the integration of sensors into a software-based interface to aim the control of deployed devices. A NoSQL based database were also deployed for unstructured data storage, retrieval and visualization. There are various mathematical models for describing the growth of the plants by applying Reinforcement Learning (RL) approach for optimal growth control. Similarly, the deployment of cloud-based simulation supports these resources intensive analysis to reduce the overhead on on-site devices [3]. Furthermore, this subsystem supports 24/7 clock the monitoring aspects of the 'things' deployed inside the system. The IoT system is segmented into two separate zones, the zone A (720 m 2 ) and zone B (2700 m 2 ) in area. The aim of this segmentation is to identify different climate and nutrition conditions inside the greenhouse. The remaining space is reserve for services and administrative purposes. In zone A, the process of seed propagation (breeding or reproducing new plants) occurs with equipped hydroponics system with continuous delivery of water (with sensor-based pumping motors) and illumination of sunlight (with high pressure sodium bulbs-600 w) to provide plants enough resources it requires to grow along with suitable ventilation for microenvironment control. In zone B, the foundation is also quite like zone A except with few changes. The rockwool substrate (growing slabs or blocks) and drip irrigation is installed for watering the plants. The dripper irrigator has the capacity to flow the water 2 liter per hour an average. The source of light in zone B is natural sunlight. The system also imparted with 2-Dimentional imaging cameras for growth monitoring and prediction. The images were taken by high-resolution camera (1980×1080) every two days.
The IoT-based tomato greenhouse have a great potential in terms of monitoring aspects related to this research. The automated watering system, suitable illumination facility and deployment of imaging cameras are some of its great features. However, the feature it lacks relevant to this research is the prediction of diseases in plants during the phases of its growth.
In [4] presented greenhouse monitoring system based on low power consumption devices. As presented, there are two major approaches for the monitoring of greenhouse environments i.e. The wired and wireless. The wired approach requires heavy amount of wiring inside the greenhouse to connect with main controller for data acquisition while the wireless approach requires to have wireless devices, routers and switches to transmit nodes from main controller for data storage and processing. Both approaches have impact on the performance, functionality, accuracy and the communication of the network.
The wired approach comprises a risk factor on the potential damage on overall cabling and wiring of network which could become malfunction in case of potential accident happened inside the greenhouse. On the contrary, the wireless medium supports modular implementation of the network which can be easily be recovered in case of any accidents. The developments on Wireless Sensors Network (WSN) opens the horizon on establishing smart greenhouse with WSN and remote monitoring with smart devices. It is now become an appropriate technology for low level application of IoT infrastructure where the requirements of data transfer rate are low, the installation of network nodes are in small size and the device need to be autonomous in power supply [5].
As presented in [6], the design and performance metrics of WSN based on ZigBee architecture shows the potential solution to this problem. The setup comprises of ZigBee which is a short-range low power device capable of operating in a 2.4 GHz industrial, scientific and medical (ISM) radio band. The network design is based on mesh topology with end nodes configured to send the data to the end-destination. The network is also tested for Quality of Service (QoS) with OPNET technology simulator. Similarly, the required hardware components used in the experiments are DHT11 based humidity and temperature sensors, Arduino UNO with Atmel ATmega 328P microcontroller, XBee Shield V03 module and XBee S2C Digi module. The XCTU configuration platform is used as a microcontroller-based C programming interface to interact with connected devices and processing of data acquired from the network [7]. The experiment shows the result that the overall system works efficiently with nodes consuming less power and suitable performance.
The low power consumption device for IoT based greenhouse monitoring have innovative solution to manage the power consumption problem. The strong side of this project is the use of wireless sensors specific to humidity and temperature in managing IoT infrastructure of the greenhouse. The weak side is the lack of integrating wide range of sensors into greenhouse monitoring.
In [8] proposed a development model for an agricultural monitoring system namely 'IoTOMATO' using chat bot. The aim of this system was to make sure for solving major problems related to agriculture industry. The IoTOMATO was proposed as an IoT based system for tomato monitoring using various sensors. The focused objectives of this system was to design it in a way that even in a small group of farmers can be able to deploy it in their fields. Analytics is another required feature which supports data gathering and collection in a more comprehensive way in tomato monitoring system using Arduino Microcontroller. Similarly, the monitoring system also collects and analyse data gathered from daily images and weather analytics on Agri-field. Agricultural analytic also deploys a disease detection system in greenhouse by integrating computer vision techniques to analyse the raw images. Furthermore, enabling deep learning has been utilized to detect diseases from leaves from various plants. By using AlexNet and SqueezeNet based Convolutional Neural Network models to train and test tomato images and determine a suitable deep learning algorithm for tomato diseases and pest's recognition is also part of its design goals.
In [9] proposed an extended system modules based on [8] by introducing some new features including camera nodes for taking snapshots every 10 min time span and sending it back to the central concentrating gateway station, gateway for providing wireless communication among camera and server peers via Raspberry Pi controller using HTTP protocol, server to transmit daily images from data storage to data analytics using Windows PC-based server integrated with MATLAB simulation software for image processing, computer vision, data analytics, lastly a notification platform using Slack API to send the latest information through webhook integration from MATLAB software. Similarly, the platform is also integrated with Object Detection APIs from various Deep Learning libraries for feature extraction through various optimization techniques automatically from collected images. The research also proposed an idea of Faster Region-Convolution Neural Network to examine the details of propositions by the classifier for checking the frequency of fruit regions from the collected images. The major goal is to identify the focused regions on the fruit, then crop them from the background stages. The identified and detected outcome will be used in classification for later stages of growth.
Plant diseases mostly infect the leaf of the plant which effect the growth and quality of agriculture crop. To avoid these economic loss, early detection and identification of leaf disease will be a better solution for this problem. In [10] experimented the use case of implementing IoT infrastructure for early detection on plant leaf diseases. The experimental setup comprises of raspberry pi processor which is a quad-core 64-bit arm 1.2 Ghz processor. It also includes a dual-core GPU multimedia processor to support multimedia application. A web camera interface is also attached with the raspberry pi processor for image recognition and processing. The web camera captures the images of leaves and compare these images with the existing compiled images in the database. The process of disease detection identification is applied with image recognition techniques e.g. OpenCV. There is a process need to be followed for achieving the predicted outcome. The illness of plants was diagnosed with the help of Bhattacharyya Distance Calculation which is a distance measure calculation measuring the similarity between two probabilistic distribution or sampling [11].
In [12] proposed the idea of smart lightining technology in greenhouse for rapid crop production. The system implements LPWAN technology with the licesend band NB-IoT communication module which exchange the data through Constrained Application Protocol (CoAP). Unlike those band which are unlicensed e.g. LoRA and Sigfox which are based on ISM Sub-1Ghz can only be communicated with proprietary band, the licesend band can easily communicated with properietary and non-proprietry bands respectively. The system integrates 3.3V core chip and peripheral circuits, LED lamp, temperature and humidity sensor along with I2C interface, NB-IoT communication and core chip for back-end communication. The system regualry checks for the important IoT enabling features e.g. temperature, humidity, light parameters and triggered their performance based on convenience, power consumption and its overall construction costs, maintenance.
In [13] introduces the framework for intelligent control for greenhouse using fuzzy logic. The system implements a fuzzy control which has more effectiveness in controlling complex and transforming conditions inside greenhouse system. Similarly, the implementation of network-based ZigBee protocol for wireless communications making system more stronger and more robust. The master node integrates mobile communication network to send data from initial perception to application layers respectively. This system has the characteristics for low cost effective, simplified structures, flexible networking and robust scalability focusing on the requirements of complex greenhouse control system. This proposed system also takes comprehensive consideration for the cost, implementation and related factors combining the IoT 'things' with fuzzy control method using GPRS positioning to remote control monitoring, designing an intelligent greenhouse monitoring system with stable performance, simplified structures and robust scalability. To compared with traditional greenhouse environment monitoring systems, the system had such advantages as high reliability and ease in scalability.
Plant sickness detection and identification concern most to the outcome from the agriculture crops [14]. The experiment performed is a general-purpose experiment proposing the idea to the early leaf sickness identification. Moreover, the proposed model has nexus relating to this research but not on specific to its implementation in a greenhouse environment. The experiments also lack the feature of implementation in open-source domain since the mentioned hardware is not an open-source hardware which also limits the implementation of this prototype into singe hardware manufacture only.

System hardware design
The research is related to the area of implementing internet of things (IoT) application in the agriculture with specific to horticulture (practice of gardening and cultivating plants). The focus on transformation of greenhouse into a smart greenhouse applied with state-of-the-art sensors and actuators inside the greenhouse. The features applied in this research is the monitoring aspect of the greenhouse e.g. Temperature, humidity and irrigation automation. Similarly, the research also imparts the implementation of early plant disease detection with specific to early identification of leaf sickness and disease detection in the plant by acquiring leaf images from greenhouse and apply image processing techniques and computer vision algorithm on it. The system design architecture is comprised of two parts i.e. firstly, automated monitoring and irrigation system. Secondly, the plant leaf disease detection analysis phases respectively.
The research design constitutes the implementation from microcontrollers, temperature and humidity sensors, water pumps, water flow sensors, moisture sensors, VGA camera module, image processing tools, computer vision algorithms for developing software package for disease identification of plants from acquired leaf dataset and monitoring the environment and irrigation mechanism of greenhouse. The sensory devices connects with microcontroller to make a network of devices ready to perform their tasks. The microcontroller then be linked with software-based portal to receive the data from the sensory devices for analysis. Similarly, the images of the plants leaf captured from greenhouse will be used to apply image processing and computer vision algorithms for the detection and identification of leaf health condition. The devices used in this research are based on open-source hardware manufacturers which can be implemented with various others hardware components from different manufacturers.

Arduino microcontroller
A microcontroller comprises of single integrated circuit board considered to be a small computer with one or more processor with memory unit and input/output peripherals. The project uses an Arduino Uno based microcontroller board based on the ATmega328P having 14 digital input/output pins, 6 analog inputs, a 16 MHz quartz crystal. It connects with a USB connection to the PC and powered by a power jack. It also has an ICSP header and button to reset.

DHT11 temperature and humidity sensor
Temperature sensor is used to measure heat and its impact on the environment. Humidity is the amount of water vapor present in the air and it can be measured with hygrometer. The temperature and humidity sensor used in this project is based on DHT11 sensor. It is a small size and low consumption sensors with long transmission distance of 20 m to be applicable for all kind of complex temperatures and humidity environment.

Water flow sensor
The water flow sensor comprises of a valve plastic design, a water rotor and a hall-effect sensor. When the flow of water passes through the rotor, the rotor rolls and the centripetal force changes the motion of rotor with a different rate of flow. The hall-effect sensor records the output of the corresponding pulse signal. The sensor comprises of different diameters, water pressure (MPa) and rate of flow (l m −1 ) ranges. The sensor has 20 mm diameter along with 1.75 MPa water pressure and~30 l m −1 rate of flow range.

Soil moisture sensor
Soil moisture sensors measure the content level of water in volumetric scale from the soil. The gravimetric measurement with direct contact to free soil moisture requires removing, drying, and weighing of a soil sample. On the contrary, the soil moisture sensors measure the volumetric water content indirectly by using properties of the soil, inlcuding electrical resistance, dielectric constant, or interaction with neutrons, as a substitute for moisture content. The applied sensor has two major parts i.e. the sensor probes and module board. The sensor is comprised of two probes which needs to be inserted into soil. The sensor applies two probes to easily pass current through the soil and records the resistance level for the purpose of reading the moisture level. The large volume of water makes the soil to conduct electricity more easily with less resistance, while dry soil conducts electricity poorly with more resistance. The module also includes a comparator and adjustable potentiometer to adjust and reset the threshold to toggle digital output signals.

VGA camera module
The camera module applies in the greehouse enables the frequent access to greenhouse visual representation and plants conditions visually with 24/7 clock time. The module namely 'OV7670 Camera Module' comprised of small image sensor, low operating voltage, enabling comprehensive functionality of a single chip VGA camera and image processor. With SCCB bus control, the sensor has the ability to output the complete frame, sampling, and various resolution upto 8 bits of data. The installed VGA image can reach up to a maximum of 30 frames per second. It can be comprehensively control and effectively measure the image quality, data format and transmission mode. The process including image processing functions can be performed through SCCB programming interface, such as gamma curve, white balance, saturation and chroma.

Disease detection framework
We use an image processing framework for analysis of disease in the leaf dataset as shown in figure 1. The Leaf Disease Detection analysis is applied by using MATLAB simulation software. The process starts from acquisition of images for making a leaf dataset. It is prepared by collecting RGB leaf images from greenhouse environment as shown in figure 2.

Image pre-processing
The acquired images then passed through image pre-processing process for color transformation in which the images are shaped into a device-independent color space. The device dependent color space produces resultant color depending on specific device. In case of RGB values i.e. RGB (0, 255, 0) which is a green color. The RGB color changes with the change in the brightness and contrast of producing device configuration. The values remain same, but the output displayed will looks different. This property of color is referring to the device dependent color space structure.

Image segmentation
The color transformed images then passed through image segmentation in which an image is partition into multiple segments or for our experiment set of pixels/objects. The purpose of image segmentation is to make the image into something meaningful typically objects e.g. line, curve, boundaries, shape, points etc and assign a label on every pixels of specific characteristic.

K-Means Clustering algorithm
The K-Means Clustering algorithm is then applied into image segmentation process to classify the set of features into K clusters. It applies K pre-defined non-overlapping distinct sub-groups knowns as clusters in which every  data points have relation to only single fraction of disease group. The clustering is applied by reducing the sum of squares of the space between the required object and corresponding cluster.
The K-means approach determines to resolve the problem namely called by 'Expectation Maximization' for applying the assignment mechanism to required data points towards the nearest cluster as shown in equation (1). The w ik =1 for data points of x i if it adheres to k clusters else with w ik =0. Similarly, the μ j is the centroid of cluster x i . However, K-means clustering partitioned the leaf image into two clusters in which multiple clusters contains infected leaf image.
The minimization problem consists of two major parts. Firstly, the minimization of C relative to w ij and consider μ j as constant. Similarly, the minimization C relative to μ j and consider w ij constant. Assign the data point x i to the nearest cluster evaluted by its sum of squared distance from its cluster centroid as in equation (2). To adjust the parameters, the possibility to solve the inference problem which is generated by Gaussian Mixture Model (GMM) for every data points in E-step as mention in equation (3).
Every Gaussain determines the posterior probability for every data points. To fit the Gaussain weighted on data points it can drive to nearest form of updates for all the paremeters. Translate the re-calculation of centroids of every cluster to reflect the assignments in M-step as in equation (4).

Feature extraction
The images then passed through feature extraction in which Color Co-occurrence Method (CCM) is applied. The CCM comprises of a matrix characterized by images under the distribution of co-occuring pixel values at given offsets (grayscales or colors) as in equation (5). The RGB transformed image is converted into HSI (Hue, Saturation, Intensity) color space transformation. Each pixel is mapped into color co-occurrence matrix with three CCM matrices e.g. for every H, S, I correspondingly. The CCM method uses Spatial Gray-level Dependence Matrices (SGDM) in which gray level CCM is used to describe the shape by statistical sampling. The sampling of gray-level occurs in a way that is mostly related to other grey-levels.
x y x n y m , 1 1

Disease detection
The identification for sickness and disease detection in plant leaf is applied by implementing Convolutional Neural Network (ConvNet/CNN) with AlexNet algorithm.

Convolutional neural network
The ConvNet/CNN is a deep learning algorithm which intially inputs images, assigns important learnable weights and biases to various aspects and objects present in the image and be able to differentiate from each other. In earliest methods, filters are usually hand-engineered with enough training while ConvNets/CNN have the ability to learn from these filters and characteristics. The ConvNets/CNN required less image pre-processing as compared with other classification algorithm. ConvNets/CNN can identify patterns in images to detect the objects directly from the images using classification without any manual feature extraction. A ConvNets/CNN can take input image, put weights and biases on image objects and classify the patterns. The objective of ConvNets/CNN is to reduce the image into a simplified structure without losing its characteristics for the purpose of getting good prediction. A ConvNets/CNN is also composed of an input layer, an output layer, and many hidden layers in between these layers as shown in figure 3. These layers perform different operations in order to adjust the data with intent of feature learning specific to given data. The most common layers in ConvNets/CNN are: Convolution, Activation or ReLU, and Pooling. Convolution Layer puts the input images over a set of convolutional oriented filters each of them triggered certain features from the given images. Rectified linear unit (ReLU) allows for more faster and highly effective training by mapping negative property values to zero and preserving positive property values. It is commonly referred to as activation since the only activated features are moving forward into the upcoming layer. The pooling facilitate the output by performing nonlinear downsampling scaling down the number of parameters that the network needs to learn. These operations are iterated over large numbers of layers having each layer learning to identify different features.

AlexNet optimized CNN architecture
The AlexNet performance optimized algorithm contains eight layers for learning including five convolutional and three fully connected layers. The output of the most recent fully connected layer is delivering into the way of just about 1000-way softmax which constructs a distribution over the 1000 class labels. The AlexNet network maximizes the multinomial logistic regression objective which is mostly comparable to maximizing the typical beyond the training cases of the log-probability for proper labelling within the given prediction distribution. The second, fourth and fifth kernels of the convolutional layers are connected specific to the kernel maps in the previous layer attached on the same GPU. The third kernel of convolutional layer are connected to every kernel map in the second layer. The neurons in the entire connected layers are connected to every other neuron in the previous layer as shown in figure 4.
The primary response-normalization layers pursue convolutional layers in the first and second layers. The layers in Max-pooling part with its kind follows for both response-normalization layers in addition to the fifth convolutional layer. The ReLU non-linearity is applied to the outcome of all the involved convolutional and fully  connected layers. The primary convolutional layer filters the 224×224×3 input image with 96 kernels of size 11×11×3 with a length of 4 pixels (since the distance between the receptive field attract towards the centres of neighbouring neurons across the kernel map). The second convolutional layer accept the input in (response- normalized and pooled) output for the primary convolutional layer and filters it with 256 kernels of size 5×5×48. The subsequent third, fourth, and fifth convolutional layers relate to each other without any intervening pooling or normalization layers. The third convolutional layer comprises of 384 kernels of size 3×3×256 connected to the normalized and pooled outputs of the second convolutional layer. The fourth convolutional layer comprises of 384 kernels of the size 3×3×192, and therefore the fifth convolutional layer has 256 kernels of size 3×3×192. The fully connected layers comprise of 4096 neurons in each. Similarly, the AlexNet neural specification has 60 million parameters. Despite with all the 1000 classes of ILSVRC make each training example impose 10 bits of constraint on the mapping from image to label since it seems to be insufficient to find out such a big number of parameters without considerable overfitting. Below, we describe the 2 primary ways during which we combat overfitting [15].

Interoperability
There are two phases of implementation in this development i.e. The experimental prototype and plant leaf disease detection analysis. The experimental prototype focuses on primary setup for hardware components and their proper functioning for required purpose. Similarly, plant leaf disease detection analysis focuses on identifying the disease infected with the given leaf dataset. The design of system comprises of two levels i.e. monitoring, analysis and prediction. The core of system is the microcontroller based on Arduino Uno connects with a computer. The sensors connect with breadboard joined with the core microcontroller to send and receive data. The required sensors plugs into the breadboard which joins with microcontroller. The required sensors captures latest analytics perceived from the environment towards the system. The early identification of disease is applied on MATLAB simulation software package based on the image taken from the actual greenhouse. These images will be the test cases for plant disease identification process.

Evaluation
The evaluation is implemented in two parts including i.e. internet of things based system implementaiton including, temperature and humidiy sensor, water flow sensors, moisture sensor and DC water pumping motor and the VGA camera implementation and plant leaf disease detection analysis using software packages.

Plant leaf disease detection evaluation
The leaf disease detection was implemented with MATLAB simulation software. For the experiment purposes, 2 fruits were selected including Apple and Grape along with 3 vegetables including Corn (Maize), Potato and Tomoate with overall 25 cateogries of diseases including i.e. apple scab, septoria spot, early blight etc with 375 infected and healthy leaf image datasets.
The process start from training the images. The training process train the complete given training dataset. The image pre-processing and normatilzation effect was applied in the back-end part of the process. This process includes the image pre-processing, image segmentation, feature extraction. After the traning process with CNN completed, the infected and healthy test images can be applied to test whether the leaf is infected with disease or healthy as shown in figure 5. The process is mentioned as shown in figure 6.

Internet of things based system evaluation
The internet of things-based system implementation comprises of different modules including temperature and humidity sensor, moisture sensors, hall-effect water flow meter and VGA camera module as shown in figure 7. The evaluation determines the effective working of all the modules and gathering real-time data from them for analytics purposes.

Temperature and humidity sensor
The temperatue and humity is implemented with 4-pin DHT11 sensors along with Arduino Uno microcontrollers. The DHT11 is connected to required pins with Arduino Uno via electronic breadboard. The sensor were programmed with Ardunio Uno IDE in C++ language to test the sensors and obtained the results from it.

Hall-effect water flow meter sensor
The water flow sensor is implemented with 3 pins port including GND, VCC and D12 port with Arduino Uno microcontroller. The working is ranging from voltage 5 V-24 V depending upon the input. The operating temperature start from 0°C∼80°C and the flow ranges from 1∼30 l min −1 . The operating pressure is within the range of 1.7 Mpa. The water flow meter measures the flow of water passes through it after pumping from DC pumping motor.

Soil moisture sensor
The soil moisture sensor is connected with two probe modules to be inserted inside the soil to allow the flow of current inside the soil to read the resistance level from the soil. The sensor its then connected with 3 pins port including GND, VCC and D13 port with Arduino Uno microcontroller. The power supply required from sensor is ranging from 3.3 V∼5 V and the.

VGA camera
The VGA camera is comprised of 20 pins ports connected with Arduino Uno microcontroller. The camera has the power capacity of 3.3V and dynamic range of 52 dB. The pixel size of camera comprises of 3.6 μm×3.6 μm. The camera captures the images when input signals it do so.

Analysis of results and outcome
The analysic of the results is comprised into two part i.e. IoT based smart greenhouse with all the related sensors and modules implementation and the plant leaf detection images analysis.

Leaf disease detection perfromance analysis
The leaf disease detection experiment output the results as stated in table 1.
There were 50 Epoch with almost 100 iteration in three phases of experiment. The loss rate is also different for each passing epoch and iteration. Similarly, the learning rate is changes with shuffling of each epoch and iteration. The accuracy is also changing from epoch and iteration as shown in figure 8.

IoT based smart greenhouse analysis
The IoT based implementation of DHT11 temperature and humidiy sensor output the result from current existing environment temperature and humidity. The environment for testing temperature is nearly 29 Degree  Celcius while the Humidity is nearly the range of 73 to 76 approx. Similarly, the soil moisture module and water flow meter work together to maintain the irrigation system for plants. The soil moisture module connects with two probes to records the current resistance from soil while the wate flow meter joins with plastics pipes for watersupply, the two-channel relay connects with DC motor and 9V battery. The VGA camera also connects with microcontroller and getting images when required as shown in figure 9. Lastly, the LCD keypad screen connects with I2C LCD interface joins the microcontroller for getting numeric data and displays in on the screen. The overall system works efficiently and outcomes as per the requirements of the research.

Conclusion
This research implements the idea of leaf disease detection and monitoring of environment conditions and irrigation system inside the greenhouse environment. The experimental prototype and analysis is working as per the expectations. The results obtained as per the expetations during the experiment and ananlysis process. For future, there will be more space to implement more functionalities with this system and these improvement will be considered for further developments in future.