Whale Optimization based Deep Residual Learning Network for Early Rice Disease Prediction in IoT

Disease detection on a farm requires laborious and time-consuming observation of individual plants, which is made more difficult when the farm is large and many different plants are farmed. To address these problems, cutting-edge technologies, AI, and Deep Learning (DL) are employed to provide more accurate illness predictions. When it comes to smart farming and precision agriculture, IoT opens up exciting new possibilities. To a certain extent, the goal-mouth of "smart farming" is to upsurge productivity and efficiency in agricultural processes. Smart farming is an approach to agriculture in which Internet of Things devices are interconnected and new technologies are used to optimize existing methods. Utilizing Internet of Things (IoT) devices, smart farming aids in more informed decision making. In many parts of the world, rice is the staple diet. This means that early detection of rice plant diseases using automated techniques and IoT devices is essential. Growing rice yields and profits may be helped along by DL model creation and deployment in agriculture. Here we introduce DRL, a deep residual learning framework that has been trained using photos of rice leaves to recognize one of four classes. The suggested model is called WO-DRL, and the hyper-parameter tuning procedure of DRL is executed with the help of the Whale Optimization algorithm. The outcomes demonstrate the efficacy of our suggested approach in directing the WO-DRL model to learn important characteristics. The findings of this study will pave the way for the agriculture sector to more quickly diagnose and treat plant diseases using AI.


Introduction
Globally, people rely on agriculture more than any other industry [1].Farmers engage in agricultural activities, growing crops according to soil and weather conditions.Natural disasters, a lack of water, crop infections, and other threats are just some of the difficulties that farmers face.The goal of using cutting-edge scientific technology is to reduce the severity of problems like these.Curing plant diseases early on allows one to get the most out of plants without hiring a specialist.One of the most pressing issues in agriculture today is the ability to foresee the spread of a disease among plants [2].With more people realizing how crucial agriculture and food supply are, there is a higher need for disease prediction and categorization of crops.
The rapid increase in India's population calls for equally rapid advances in farming techniques.Rice, the staple meal, is the most widely consumed crop in India [3].However, plant diseases have a significant influence on rice making and yield, reducing the crop's overall profitability.Predicting and preventing plant illnesses at early stages itself is necessary for recovery from such issues and improving agricultural management [4][5].Verifying the presence of diseases often and adopting regular plant health monitoring as a strategy are both important steps toward achieving sustainable farming.Many studies have been done on plant disease detection thus far, and they all point to the possibility that the illnesses may be visible, making the observation procedure straightforward and sophisticated.Manual crop infection prediction is notoriously unreliable and imprecise, adding more complexity to the process.Human intervention is labour-intensive and calls for more expertise in identifying the precise illness.Therefore, scientists have developed plant illness prediction models using IoT, AI, and image processing [6].Many hybrid approaches, which successfully addressed the aforementioned problems, have been presented.A group of sensors, network nodes, and end users make up the Internet of Things (IoT).Through the use of wireless sensors, the Inter-net of Things creates a greater possibility for the growth of dynamic industrial net-works and of real-world domains [7].With the aid of IoT and embedded mechanism, it is feasible to integrate and incorporate the observation mechanism in data collection.The implementation of IoT is the essential process in this infrastructure.This is because it uses a wireless communication system and an inference module to anticipate plant ailments and file them under the heading of nutrient deficiency [8].While it comes to solving the problems that arise while trying to anticipate and categorize plant diseases, this method is often regarded as the best option.The collected agricultural data is then used to develop a Decision Support System (DSS) and technologies for warning farmers of potential danger.Since IoT data is generated rapidly, picking the right characteristics is crucial.Having access to large amounts of heterogeneous data reduces the impact of the generalization function [9,10].However, this issue may be solved by using the DL approach, which improves classification accuracy while simultaneously decreasing the number of factors.Image classifications are only few of the stages involved in using image pro-cessing for illness diagnosis.After inspecting the diseased plants by hand, these procedures are carried out [11].Diseases of plants may often be anticipated by scrutinizing its primary parts, such as its leaves and stems.Plant diseases may show a wide range of symptoms.In addition, the symptoms of plant illness may vary in hue, size, and texture, while the specifics of each disease are different.Diseases that cause yellowing are uncommon, as are those that cause green leaves to become dark [12].In addition to causing colour changes, plant diseases may alter the morphology of leaves without affecting their appearance.Once the diseased parts of the plants have been isolated, the overall portion showing symptoms of the illness may be collected.Manual illness prediction using just the naked eye is labour-intensive, not always precise, and expensive.Estimating it is difficult, and predictions of illness types are often inaccurate [13].The lack of information about the plant causes these problems.In accordance with this, rice output might be negatively impacted if diseases affecting rice plants are not anticipated or recognized in their early stages, as has been the case during the last several decades [14].The following are some of the main takeaways from this study: a) Demonstrating the DRL model, a deep learning-based system for illness identification.b) Rather than using a single spectral feature, WOA performs the hyper-parameter tuning process by using deep features that mix spatial and spectral characteristics.c) The ability to use real-time, accurate, and automated rice plant disease detection.d) Using a residual, depth-wise, and split convolution block e) Developing a new kind of loss function to address imbalanced situations.f) Validating the applicability of different datasets for training The remaining parts of the document serve as: The related research on rice plant disease detection is obtainable in Section 2. Section 3 delivers a concise summary of the optional model, while Section 4 provides a visual representation of the model's outcomes analysis.Section 5 provides the research's scientific contribution.

Related Works
This research by Lu,Y.,et al. [15] proposes a unique approach to disease detection in rice by using network (CNN) methods.500 images of damaged and healthy rice leaves and stems from an experimental rice field are used to teach CNNs to recognize 10 common rice illnesses.To achieves 95.48 % accuracy.This precision is far better than that of conventional machine learning algorithms.The simulation results for disease detection in rice show the potential and effectiveness of the proposed method.In this research, Agustin,M. et al. [16] created a real-time video system with a rice disease classification system.The Livestream scheme employs 4G network connectivity and the WebSocket protocol to provide real-time interaction and assist the YOLO (You Only Look Once) algorithm-based rice disease detection system.Livestream also uses the raspberry pi camera V2 to record video streams.The efficiency of the Livestream system was evaluated with the use of four tests: one each for functionality, connection, categorization, and implementation.The Huy Minh Do dataset, consisting of 5447 images, was utilized for training the classification system, while Wireshark and Conky were employed for testing.Parameter results index indicates that all programs run normally with satisfactory Quality of Service.It is also found that the data may be reduced in size by delivering it in a format other than base64, by roughly 200,000 bytes/s, and that the classification scheme performs well, with an average accuracy of 80%, while being highly demanding on the Raspberry Pi.Research into data transfer and the efficacy of machine learning in microcontrollers will benefit from further refinement and enhancement of this technology.Agrawal,M.,and Agrawal,S. [17]  The four principal rice illnesses are rice panicle stem blast; to identify these, Pan,J et al. [18] presented a two-stage technique called RiceNet.To begin, YoloX was used to detect the diseased areas of the rice photos, and based on those findings; a new rice disease patch dataset was created.The Siamese Network was used to locate the dataset for the rice disease patch created in the first stage.YoloX's mAP for rice disease images was 95.58%, making it the top performer in the comparative experiment's detection stage.In terms of identification performance, Siamese Network was superior to all other models, with a success rate of 99.03%.The results of the experiments show that the proposed RiceNet model is superior to state-of-the-art approaches.It was also the lightest and fastest option for diagnosing rice illnesses.Atalla et al. [19] use the realistic WSN (Wireless Sensor Network) simulator COOJA (Contiki OS Java) to lowpower and lossy networks (RPL) in the two agricultural scenarios.The mobility of nodes is the primary distinguishing factor between the simulation settings for stationary and mobile nodes.The research characterizes many facets of performance requirements in the two agricultural scenarios duty cycle, and sensor network graph connection levels.As a novel approach to modelling and replicating the movement of animals, the random waypoint model (RWP) is implemented to describe horse motions in the COOJA simulator.The results show how mobile and stationary sensor networks may benefit from using the RPL (Responsys Personalization Language) routing protocol, which allows for flexible network architectures and higher overall performance.The suggested architecture is proven to be applicable to both fixed and mobile contexts via simulation and experimental validation, demonstrating high communication performance with minimal latency.The results have different practical implications for precision agriculture as a consequence of providing an efficient monitoring and management solution for farms that grow both crops and animals.This research provides a comprehensive analysis of the performance scalability of WSNs in the agricultural sector by using a novel categorization approach and performance assessment criteria for stationary and mobility circumstances in 6LowPAN networks.Results demonstrate that the proposed framework is well suited for precision agriculture due to its high throughput in transmission and little delay.In their research, Jiang,M. et al. [20] projected a method for disease detection in rice that makes use of a modified version of the DenseNet network.The DenseNet benchmark model is used to train the approach, and the channel attention technique squeeze-and-excitation is employed to boost desirable characteristics while dampening undesirable ones.In order to maximize parameter utilization and training efficiency, we swap out the dense network's regular convolutions with depth-wise separable convolutions.In combination with adaptive optimization, the AdaBound technique expedites parameter tuning.Experiments on five distinct datasets linked to rice dis-ease show that the method outlined in this study has an average classification accuracy of 99.4%, which is 13.8 percentage points better than the original model.ResNet, VGG, and Vision Transformer, three other well-known methods, are compared with it.This method improves detection rates, successfully classifies rice illness images, and represents a novel step forward in the evolution of crop disease identification technology and smart farming.

Data Preparation
In this work, we examine brown spot, rice leaf blast as three examples of common rice illnesses.The most common method of manual diagnosis relies on seeing outward manifestations of illness.Brown spots are dark-brown, spherical to oval lesions surrounded by a yellow halo.Lesions stay spherical as they get larger, with a necrotic, grey core and a reddish-brown to dark brown periphery.As a result of rice hispa injury, only the bottom epidermis of leaf blades survives.Leaf tissue is not immune to the disease's tunnelling effects.When plants are severely damaged, their vitality decreases.Seeing the insect on the leaf is a certain way to identify rice hispa damage.Rice leaf blast manifests as a spectrum of lesions, from tiny, round, black spots to larger, oval patches with reddish-brown edges and a gray or white core.Long, thin, diamond-or linearshaped spots develop, with gray, lifeless centers surrounded by reddish-brown borders.We used a dataset consisting of 2370 samples of rice leaves, split evenly across the three categories and also include healthy rice samples [20].Table 1 provides the specifics for each category.Each category has 100 samples chosen at random for training and testing purposes.Morphology, are a few of the other picture preprocessing techniques used in the sample preparation phase.To overcome some of the constraints of the dataset, a preprocessing method is carried out on the images.Specifically each photograph has a mostly white backdrop and a rice sample taken at an unusual angle.The white background was removed and Otsu's thresholding technique was used to identify the leaf.The samples were then shifted such that they were all horizontally aligned.Otsu's threshold and opening morphology are used in the first step to determine the rice leaf's structure.In the second step, the recognized item is isolated from its irrelevant backdrop by shifting the picture horizontally.This improves learning performance by eliminating as much noise as possible from the original data.
Before feeding them into the deep learning model, all of the rice leaf photos are scaled down to 299 by 299 pixels.In the section on classification performance, the effect of varying input size is also explored.

Pre-processing
Image contrast is improved using the (CLAHE) [22] technique for optimal rice plant image categorization.Here, the modified CLAHE is helpful for eliminating amplified noise.Plus, CLAHE is used to calculate a number of histograms, each of whose nodes is based on the boundaries of the canonical picture.In order to reduce any further amplification, the histogram is widely distributed.

Proposed Deep Learning Architecture
For rice disease identification, a deep learning approach with two streams of features was presented.This design makes use of multiscale convolution layers, which are all implemented as layers.The multiscale block makes WO-DRL more resistant to changes in size [23].As a result, WO-DRL is better able to identify rice diseases.It has been shown that the residual blocks eliminate the vanishing gradient issue and provide efficiency on par with a more indepth network.In addition, the depth/point-wise convolutions are less expensive operators that cut down on the need for a small set of robust model parameters, which in turn lowers the computing cost.The Multiscale 2D convolutional layers are used to first extract the shallow features.Then, each deep feature extractor channel receives the extracted deep features.Due to the fact that even a tiny outbreak may spread quickly, we up-sampled the first channel by a factor of two before extracting the deep features.This route integrated multiscale residual block with residual block to draw out in-depth characteristics.Concurrently, the second channel was unearthed by the original resolution dataset's deep features using a combination of the residual block and the multiscale residual block.Then, the summing operator combined the two layers' retrieved deep features.The retrieved features were then combined into a single feature map and sent to a 2D-convlotution layer, which made the final classification decision (disease or not).In the following sections, we will dive further into the architecture of WO-DRL.

Convolution Layers
Extracting high-level deep features from the input dataset is the primary responsibility of the convolution layers in a convolutional neural network (CNN) [24,25], [26], [27].
The calculation for a layer l convolutional layer may be written as (1).
where (g) is weighted pattern, (b) is the bias vector, and (x) is the layer l-1 input data.Using equation ( 2), we can determine the output of the jth feature map (f) in the ith layer at the given spatial position (x, y).
where m is the feature cube in the (i -1)th layer that is linked to the present feature cube through a kernel, W is the (r, s)th value of the kernel that links the mth feature layer before it, and R and S are the dimensions of the convolution kernel.
The WO-DRL design makes use of three techniques: We avoid the vanishing or exploding gradient problem by using residual blocks layers, which allow the gradient to be directly back-propagated to earlier layers, and we use multiscale kernel convolution (i.e.different kernel size convolutions), as described in [23], [28] to ensure robustness against variations in scale.The third kind of convolution layer is the depth/point-wise convolution block, which uses a single filter for each feature in the input.When gauging training error, the loss function uses the difference among the predicted and actual values.The weight binary-cross entropy-dice (WBCED) loss function is employed in this study because it is more effective for lowdimensional targets (Equation 3).The WBCED loss function is defined among the predicted value (p) and the real value (y) by combining the dice loss (Equation ( 4)) and the weighted (Equation ( 5)).
: In order to mix things up during practice, we shuffled things up.Tensorflow 2.4.1 and Keras 2.4.3 were used in the development of WO-DRL.WO-DRL connected to a working CNN, in this case the MSR-UNet.The primary cause is because MSR-U-Net, like DRL, uses a combination of multi-scale kernel convolution filters and residual blocks to extract deep features.Encoderdecoder architecture is also used in MSRU-Net to probe hidden characteristics.

Hyper-parameter Tuning using Whale Optimization Algorithm
WOA is a method for maximizing efficiency.Its mathematical model is based on its efficiency in the field.The WOA employs a hunting technique called bubble-net feeding, which was originally developed by a type of killer whales known as hump-back whales.Each whale's position, marked by the symbol X_b, represents a solution that may be modified based on the whale's current attitude toward attacking the prey.There are two methods that whales might utilize to kill their food.The first tactic is called "encircling prey," and it involves the humpback whale finding its prey and then surrounding it.WOA operates on the assumption that the optimal response is (X_b(t)).Once X_b (t) is determined, the other whales will try to adjust their locations such that they are in agreement with X_b(t), as illustrated in Equations ( 8) through (10).
In Equation ( 10),   stands for the distance among   () and   ().A is a co-efficient vector and is calculated by the subsequent equation: where  ∈ [0, 1].Whereas, a parameter whose value changed is indicated by the letter a: where   stands for the sum of generations.Bubble-net assaulting, which stands in for the exploitation phase, is the second tactic, and it employs two methods: the spiral update of location, and a diminishing encircling mechanism.To accommodate the contracting encircling process, we must decrease an in Equation ( 10).The following expression uses the spiral updating position mechanism to determine the gap between X_i and X_b: In Eq. ( 12), the number l represents the logarithmic spiral's form.In this manner, the whales are capable of both a decreasing circle and a spiralling route while circumnavigating the X_b.To further pinpoint this optimal site, we may utilize the subsequent equation, which is derived by combining Equations ( 8)-( 10) and ( 12)..
In Equation ( 13),  ∈ [0, 1] to control the updating mechanism.Furthermore, as demonstrated in the equation below, X_r may be used in place of X_b to update each whale's location: Algorithm 1 delivers the basic ladders of WOA.

Autonomous Robot
We have trained the model to recognize symptoms of illness in plant leaf photos.To put it into practice right now, we utilize a robot that can go about a farm or greenhouse autonomously and take pictures of the plant leaves.To go about without human intervention, we've designed a robot equipped with an obstacle avoidance system.The robot's camera pole is extendable so that a high-resolution photograph of the leaf may be taken.The robot is equipped with a global positioning system (GPS) location sensor that records the precise coordinates of the photo's capture.The robot first moves while using an algorithm designed to avoid obstacles.Meanwhile, the camera will keep scanning for leaves in real time using the same model we used.If the model predicts that a leaf is more likely to be present than not, the robot will cease taking pictures of it and instead record its GPS coordinates as the file name.The Raspberry Pi 4 is the appropriate microcontroller for this task.This is on-going, and we've already taken and used photographs of real leaves to test our model.

Evaluation Metrics
As metrics, the authors included training duration, average accuracy, precision, recall, and recall rate.Matrix of Confusion: This indicates the proportion of properly and erroneously labelled samples.Here, TB represents the number of blast disease samples that were properly categorized, FB represents the number of blast disease samples that were mistakenly classified, TR represents the sum of rust disease samples that were correctly diagnosed, and FR represents the number of rust disease samples that were wrongly classified.The authors define the matrices using the labels provided in the confusion matrix.In the above Table 3 represent that the Analysis of Proposed Model on various classes.In this we evaluate different ratios as analysis, Brown Spot, Rice hispa damage, Leaf blast and Healthy.In first the Brown Spot reached the accuracy as 98.98 and the precision rate of 99.58, and also the recall value as 99.64 and also the F1-score as 99.11.and another the Rice hispa damage reached the accuracy as 98.98 and the precision rate of 98. 68, and also the recall value as 99.29 and also the F1-score as 98.42.and also, the Leaf blast reached the accuracy as 98.68 and the precision rate of 99.58, and also the recall value as 99.64 and also the F1score as 99.11.and finally, the Healthy reached the accuracy as 99.79 and the precision rate of 99. 29, and also the recall value as 98.59 and also the F1-score as 98.94 respectively.

Conclusion
This study introduced a unique WO-DRL model for disease diagnostics in rice plants in a precision agriculture setting.The suggested technique includes many steps, such as gathering and pre-processing images, and then classifying them, all of which occur on the server.Specifically, Internet of Things gadgets in rice-growing areas take pictures of the crops and upload them to the cloud, where they can be analysed.The contrast of the incoming photos is increased by a pre-processing step.The suggested model achieves 99% accuracy on healthy leaves and 98% accuracy on Rice hispa damage, Leaf blast, and brown spot thanks to the WOA model's optimum selection of DRL's hyper-parameter tuning.The given approach may be expanded in the future to identify illnesses that typically affect other plant types than rice, such as fruit plants.We want to soon implement a real-time classifier inside the microcontroller that will allow us to apply this method to all plant species, resulting in more precise and useful results.We also want to develop a mobile application that can keep track of this data and send out notifications when a potentially unhealthy plant is found.We'd also want to supplement our current data collection with information gathered from other sources and via excursions to the field.
have studied and trained several Convolution Neural Network models using unique permutations of training and learning approaches in an effort to improve accuracy.Baseline and transfer learning techniques are used to create state-of-the-art large-scale architectures including VGG19, XceptionNet, ResNet50, DenseNet, SqueezeNet, and Convolution Neural Network.Many different kinds of datasets were utilized for training and testing these models.Experimental the highest accuracy (97.5%) compared to other Convolution Neural Network designs and previously published studies.
where s and t are the width and height of the Mask, and where Mask is derived by the overage pooling of the reference map.Backpropagation with weights started with the Golorot initializer [31], [32], [33] is used to train the WO-DRL architecture via an Adaptive Moment optimizer [30], [29].WOA (Section 3.3.2) is used to choose the best values for the hyperparameters that guide DRL training.: (i) Batch-size =7-patches (ii) Learning rate = 10 −3 (iii) Number of Epochs =250.
. 1. Average accuracy: It's how certain you are that the categorization is accurate.: This is how well blast samples can be categorized into blast types.: Number of blast class samples correctly identified as belonging to that class as a percentage of all blast class samples.
15 and finally the F-score value as 91.68.And also another scheme as RNN reached the accuracy as 92.46 and precision rate of 93.48 and recall rate of 92.44 and finally the F-score value as 91.81.After that the CNN reached the accuracy as 89.52cand precision rate of 90.21 and recall rate ofc89.54candfinally the F-score value as 89.03.After the LSTM reached the accuracy as 94.53 and precision rate of 96.61 and also the recall value as 92.52 and finally the Fscore value as 92.24.And the DRL reached the accuracy as 94.16 and precision rate of 96.17and precision rate of 92.32 92.10.And also, the WO-DRL 95.62, 98.32 and also the recall value of 94.62 and finally the F-score value as 94.53 respectively.In this comparison analysis, the WO-DRL model reached better performance than other compared models.

Figure 1 :
Figure 1: Analysis of Proposed Model for Accuracy

Figure 5 :
Figure 5: Validation Analysis of Different classes using Proposed Model

Table 1 :
Thorough category information of the rice disease dataset.

Table 2 :
Comparative analysis of Projected Model with Existing TechniqueIn the above Table2represent that the Comparative analysis of Projected Model with Existing Technique.In this analysis, we used different model to evaluate the performance range.In the first evaluation of MPL method was used, in MLP reached the accuracy as 80.10 and precision rate of 87.21 and also the recall value of 80.15 and finally the F-score value as 80.43. in the second evaluation of AE reached the accuracy as 85.71 and precision rate of 84.32 and also the recall value of 85.93 and finally the Fscore value as 83.45.In another, DBN reached the accuracy as 92.10 and precision rate of 92.43 and recall rate of 92.

Table 3 :
Analysis of Proposed Model on various classes