An internet of things based smart agriculture monitoring system using convolution neural network algorithm

Farming is a crucial vocation for survival on this planet because it meets the majority of people's necessities to live. However, as technology developed and the Internet of Things was created, automation (smarter technologies) began to replace old approaches, leading to a broad improvement in all fields. Currently in an automated condition where newer, smarter technologies are being upgraded daily throughout a wide range of industries, including smart homes, waste management, automobiles, industries, farming, health, grids, and more. Farmers go through significant losses as a result of the regular crop destruction caused by local animals like buffaloes, cows, goats, elephants, and others. To protect their fields, farmers have been using animal traps or electric fences. Both animals and humans perish as a result of these countless deaths. Many individuals are giving up farming because of the serious harm that animals inflict on crops. The systems now in use make it challenging to identify the animal species. Consequently, animal detection is made simple and effective by employing the Artificial Intelligence based Convolution Neural Network method. The concept of playing animal-specific sounds is by far the most accurate execution. Rotating cameras are put to good use. The percentage of animals detected by this technique has grown from 55% to 79%.


Introduction
Bird damage to fruit and crops can frequently be severe, and for a number of reasons, this damage appears to be getting worse.One of the contributing factors is the emphasis on monoculture and highly specialized crops in modern agriculture, as well as the high expense of getting the crop to the harvesting stage, where the majority of bird damage occurs [1].
The incredible breakthroughs in Artificial Intelligence (AI) and Internet of Things (IoT) technology have made smart farms, which use these technologies, more than just a pipe dream [2].The agriculture industry has changed significantly during the last several decades.All due to technological progress.Even the most inhospitable climate zones may now support the growth of plants.Insect, weed, and climate change resistance in crops is higher than ever.Finally, breeding highyielding farm animals is an option.However, a significant portion of the world's population remains undernourished despite all these achievements.The globe continues to face a serious problem with food insecurity, particularly in thirdworld countries.This is a result of climate change, fertiliser runoff, new pest and disease strains, and unexpected precipitation.Scientists are using AI and smart farming to overcome these issues that limit food production.Here, in this research paper examine in-depth how AI may revolutionise the agricultural sector [3].The value of fruit or grain that birds damage cannot be determined with any degree of accuracy.
Numerous field studies have been conducted; among the most convincing combinations are ducks and minor grains in California and the Canadian Prairie Provinces, blackbirds and rice in Arkansas, corn and blackbirds in Ohio and several other states, and so on.Canada's grain losses have become so severe that significant efforts have been made to mitigate them [4].

Figure 1. Sample Representation of Smart Farming
Figure 1 shows the sample representation of smart farming.
There have been a variety of methods used to scare the birds, including spreading grain near the marshes to entice them away from the unharvested grain fields.Both are timeconsuming, costly, and ineffective at times.Implemented Machine learning and the IoT which provide opportunities for crop protection against animal intrusion, which is crucial to crop cultivation's success.This paper discusses the region-based Convolutional Neural Network (R-CNN), storage single shot detector (SSD), the Wi-Fi board, and the Raspberry-Pi3 processor.When it comes to efficiency, accuracy, and computation time, the SSD algorithm performs better than the R-CNN algorithm.An app-based model can be made in future work to make it more mobile and easier to use [5].
Analyzed that as to enter the wilderness after the human population spreads worldwide.On the other hand, natural habitats are destroyed, and migration routes are blocked for wildlife.Humans and wildlife have become increasingly at odds over where to live and what to eat, resulting in injuries, loss of income due to crop attacks and livestock predation, and even death.In defense and retaliation, wildlife can be killed, reducing support for protection [6].The conflict between animals and humans is a global problem.
Founded on the limit processing device runs its Animal notoriety model for determining the goal and the type of ultrasound that will be produced by the creature's class is also sent back to the Animal Repulsion module when a creature is identified [7].The created creature data set, then the proposed CNN was evaluated.A wide range of instructional previews and investigation images were used to obtain the overall exhibits.The completed analysis trial results give that the proposed network of CNN has a respectable accuracy rate for a wider range of training photo entries.
Smart farming refers to the use of a variety of technologies, including as Unmanned Aerial Vehicles, AI, machine learning, robots, and IoT, to monitor farming operations, minimise the need for human labour, and improve both the quality and output of farms.In order to optimise and streamline the production of crops and animals, new information and communication technologies are being integrated into agriculture [8].
Today, farmers may manage their farms using a variety of technology, including: • Systems for determining one's location, include Global Positioning System, Geographic Information Systems, and satellite imagery

•
Sensors to measure temperature, sunlight, soil PH, humidity, and water levels

•
Software designed specifically for agriculture that combines agronomy and cybernetics to make farm management is very simple

•
Low-power wide-area networks and cellular IoT solutions are used for communication.

•
Tools for data analysis that give farmers current information on crop and animal health With the aid of these technology, farmers may completely manage the operations on their fields.Additionally, they support them in making decisions that will improve their cattle and crops.IoT technology is necessary for smart farming [9].All of these technologies are connected through IoT, resulting in a data-based system that farmers can rely on to run their operations.The nicest part is that kids can accomplish anything on their tablet or smartphone.They are not required to visit their farms frequently [10].
Farm owners may gather and examine data using smart agriculture to find issues with their crops.They can choose the best course of action to handle the difficulties using the information that has been analysed.They will know what to do if there are water shortages or fertiliser shortages.The ultimate objective of intelligent agriculture is to boost crop yield while lowering production costs.Additionally, it encourages the effective use of resources, including human labour, fertiliser, energy, and water utilisation [11].
The literature reviews and the introduction about the available systems were included in Section I.The IoT and AI ecosystem architecture for smart agriculture is discussed in section II, and section III deals with the existing and proposed system.Section IV mentions CNN training, and proposed system result and its discussion are described in detail.The proposed system's conclusion and future scope are covered in sections V.

IoT and the AI Ecosystem Architecture for Smart Agriculture
Crops can be significantly harmed by a variety of animals, including wild boars, deer, elephants, monkeys, rabbits, and moles.Running over fields or consuming some of them can destroy plants.Crop damage from animals is more likely, and this might result in further financial hardship.Shrewd action is also needed to safeguard crops from wild animals.Therefore, every farmer should be conscious of and consider the need to protect the creatures he raises crops for.Farmer's Customary Method A range of interventions, some dangerous (like hunting) and others benign (like firecrackers, bright lights, dogs, and fire), can be used to solve this problem.Use a shotgun or a 22-rimfire rifle to kill pocket gophers without the use of poison.Whenever birds damage motion-activated water sprayers which recognize motion, they are splashed with water.
Since there are so many factors at play, including the climate and genetics, predicting crop yield is difficult.By using this, the world can predict future yields with accuracy if the way of understanding how these variables impact agricultural production.It can be facilitated with artificial intelligence.The relevant datasets may be given to the right computers in order to anticipate crop yield.By analysing historical crop yield data and comparing it to more recent data, AI systems can accurately anticipate agricultural productivity over time [12].With the aid of precise production estimates, growers will be able to manage their fields using data-driven decisions.Don't forget to consider their financial status.Farmers may use AI systems to determine how much light the foliage of their crops receives.Crop spacing can be changed to make enough room for sunlight penetration if certain plants don't get enough sunshine.The foliage gap must be manually observed, which is expensive and time-consuming.
Smart agriculture requires sensors, connections, gateways, location, data analytics, and IoT components [13].Sensors are used to support precise farming by collecting important data on a variety of agricultural properties, such as fertilizer level, soil moisture, and water level.Wi-Fi, cellular, and ZigBee are examples of networks that have connections.Gateways are referred to as microcontrollers.IoT components include things like the Raspberry PI, Arduino, and Device Hive.The main organizational framework of smart agriculture consists of four stages.The sensors initially gather information on the agricultural components required for the growth of a crop [14].Numerous sensors are used to detect various agricultural traits.
It may be challenging to stop the assault or reduce the harm it does if a quick Distributed Denial of Service (DDoS) attack happens before the system has been trained or the detection has been carried out.The system may better survive DDoS assaults by over-provisioning the network bandwidth capacity [15].The network infrastructure can be upgraded to do this, or traffic filtering services offered by Internet service providers (ISPs) can be used.DDoS attacks can be avoided or lessened by configuring firewalls and routers to reject traffic from known malicious IP addresses or to limit traffic to particular ports.By absorbing or reducing attack traffic, cloud-based security services can offer defense against DDoS attacks [16].These solutions may be swiftly put into place and are frequently more efficient than conventional on-premises ones.By minimizing the system's attack surface, vulnerabilities are harder for attackers to exploit.This can be accomplished by disabling unused services or protocols, repairing holes, and putting in place access controls [17].The system can swiftly recognize and react to assaults by developing an attentionbased gated recurrent unit neural network model to detect DDoS attacks.
The model may be swiftly adapted to new attack types since it can be trained on historical data or in a simulated environment [18].Even while it is usually ideal to have a detection system in place in advance of an attack, the above-mentioned precautions can assist lessen the harm caused by a quick DDoS assault that happens before the system has been trained or the detection has been carried out.AI systems with visual capabilities may also monitor and assess daily changes in plants to determine their pace of growth.These systems can use data from infrared sensors, satellite imagery, and thermal cameras [19].

Proposed System Architecture
Using the 1800 motion camera module, this article proctored the area to be protected by this security system.The camera module can cover a 3600-square-foot area, which is the proctoring area.It is a continually operating, low-power module.It detects animal entrance and emits the resulting repulsive sound to annoy the devoted animal to protect the crops and increase farming security.Through an IoT application, the user has the option to watch the fields in realtime.A Repeller alarm that emits an obnoxious sound for animals can be placed in various areas.
The annoyance sound produced by invading animals falls between the decibel ranges of 90 and 120.In this proposed system, the categorization of animals or birds using artificial intelligence technologies based on particular characteristics.Depending on their prey and the annoyance that causes the intruder animal to leave the limited premises (fields), different Repeller sounds are stored for various animals.Animal recognition is done with the use of the CNN algorithm.Feedforward neural networks are used in CNN because of their proven effectiveness.Multiple inputs are subjected to convolution, and nonlinearity may be added subsequently.A deep learning model that analyzes user-supplied photos recognizes objects, and generates numerical values is referred to as an "animal identification algorithm" (also known as an "image Classifier").Utilizing the traits it discovered during the training phase, it then produces the image's contents.Or, to put it another way, the result is a class label (cat, cow, etc.).

Convolutional Layer
The primary objective of the Convolutional Layer is to extract features from the image input data.A crucial part of the convolutional network gives it great computing capacity.Convolution preserves the spatial connection between pixels while transforming tiny squares into visual features.By teaching new neurons to misinterpret incoming images, confusion is generated.A convolutional has been applied to the subsequent input layer using the activation map. Figure 2 shows the proposed architecture of the elaborated system.

Pool Layer
The most important information is preserved by flattening the activation maps and overlaying the input photographs with a series of rectangles.Each area is down sampled using an average process.The layer resists translation and distortion, converges more quickly, and is more generic.Frequently, two convolutional layers are layered together with this layer.

Rectified Linear Unit Layer (ReLU)
A feature map's value that has a negative value will be reset to zero throughout the element-wise transformation.The literature on neural networks states that for a ReLU that accepts input from a neuron as x, f(x) is defined as max (0, x).Consequently, f(x)= max allows for system correction.

Full connectivity Layer
A "layer of complete connectivity" is a collection of filters connected to each layer.These photos are layered using convolutional, pooling, and reLU layers according to their high-level attributes.Using Fully Connected Layers simplifies the classification of input photographs into several categories after the training dataset has been examined.A classifier is connected to the attributes using an FCL with a SoftMax activation function.The final layer receives features from these classifier levels.There is just one probability for the input and the output.The SoftMax activation function ensures this.Using SoftMax, the function converts a real-valued rankings vector to a vector of values from 0 to 1, which accumulates until it equals 1.Real value rank vectors are reduced to their smallest possible size while applying this classification.
Here is a simplified diagram of the system's operation and its process flow.The alarm will activate, and the opponent prey sound will be played whenever an animal is spotted by the surveillance camera to ward it off.The sound recordings are played in order to take immediate action.

Training of CNN for Animal Detection
The values for all of the filters and parameters are arbitrary.The input pictures are utilised for training and forward propagation, and the softmax function is used to determine the output probability for each class.The categorical crossentropy formula is then used to get the overall error. (1) Where CE stands for cost errors, Y represents the actual output, Y' represents the outcome predicted by probability, and n represents the total number of inputs.Once the gradient of the error with respect to the weights has been calculated, the Root Mean Square prop algorithm is used to update the filter settings and parameters to minimize the output error.The following is the Root Mean Square propagation optimizer formula: (2)  3 shows the proposed architecture using the CNN algorithm.The technology can track and gauge how the crops react when farmers apply fertilizers and insecticides.Utilizing the data, farmers may see crops that aren't doing well and take the appropriate action to solve the issue.Autonomous tractors can use IoT and AI technologies to assist in gathering realtime data regarding soil health, including water levels, temperature, and PH.Farmers may monitor the health of their crops using various sensors, satellite pictures, and drone cameras.The findings, when analyzed, can assist producers in locating nutritional deficiencies in the soil as well as crop pests and illnesses.
Large corporations are already using AI to create autonomous tractors that a farmer can operate from a distance.Self-driving tractors will improve agricultural productivity and crop output in addition to lowering labor expenses.Farmers will be able to remotely monitor crop conditions and take pictures of their crops using autonomous drone technology.Growers may spray agricultural treatments like fertilizer and insecticides from the air using UAVs.Large-scale farms can use drones equipped with AI-powered cameras.The cameras will aid farmers in identifying agricultural problems, counting fruits, and even predicting crop production.
Other farming tasks including harvesting, sowing, weeding, and crop sorting may also be automated thanks to AI.In fact, a farm in Australia uses robotics and artificial intelligence to perform hands-free farming.Farmers may employ strong and effective AI technologies to manage all the incoming data.Utilizing data effectively may lower labour costs, boost output, and lessen farming's environmental impact.In order to maximize production and profitability, it may also assist farmers in evaluating their agricultural tactics and resource management.Figure 4 shows the block diagram representation of the proposed algorithm.The farmer begins by taking into account a number of factors, such as the type of soil they have access to, the crop that would thrive in their climate, and the market demand for that commodity in the local areas.AI, which can be used through any UI, is used to assist in all of these analyses.

Results and Discussion
After analyzing all of this data, he or she decides which crops to produce.The farmer then assesses yet another set of data, which includes caring for the seeds that are sowed through the use of humidity sensors to monitor their moisture levels and the fertility of the soil by determining the quantity of nutrients with the aid of a color sensor.This section includes the default simulation settings that were utilized in the experimental comparison of the suggested framework with the PSO-ECHS and EECRP solutions.Network Simulator2 (NS2), a well-known open-source and top simulation tool for analyzing network routing and communication, is used to carry out simulation tests.The simulation settings and their default values are displayed in Table 1.The outcomes of the simulation are assessed after varied numbers of rounds.A single simulation round lasts for 20 seconds.In addition, there are 105 farm sensors and 20 anonymous nodes, respectively.All of the agricultural sensors, such as anonymous nodes and temperature, light, soil moisture, position, and airflow sensors, are dispersed at random.105 agricultural sensors are now available.There will always be 15 malicious nodes.The payload size (256 bytes) and packet size (k) are both set to 64 bits.Agriculture sensors have a non-uniform residual energy range of 2j to 5j.Constant Bit Rate data flow is used between the sensor nodes, and the transmission range for agricultural sensors is set at 25 meters.The crop's nutrition facilities, such as the adjustment of moisture and fertility, are successfully automated using IoT technology.
If the validation and training loss or accuracy improved and stabilized at a certain point (i.e., the model does not underfit or overfit), the optimal fit will be apparent.When the epoch size varies, accuracy and loss are both investigated.Figure 5 shows how the IoT Botnet's validation and training accuracy both increase linearly and then stabilize for a long period after crossing a particular threshold.The examination of temporal complexity is shown in Figure 6.Here, the CPU operating time and memory consumption of the suggested AGRU architecture grow linearly.In this case, the suggested AGRU has a lower temporal complexity than the current LSTM, DNN, CNN, and RNN designs.

Figure 6. Performance Analysis of Proposed system
The threshold parameter estimator is obviously biased.Given that it is constrained above by the minimum data value, this is to be anticipated.The other two histograms suggest that the log-location parameter (the first histogram) may also be a dubious assumption of approaching normality.The generated standard errors must be understood in light of this, and the log-location and threshold settings may not be suitable for the typical calculation of confidence intervals.
By depending on energy from a power source that could travel like a power bank, a functional test of the prototype gadget was utilised to gauge the conditions of the soil's acidity, alkalinity, and moisture content around the durian plants.In order to eliminate the need for human labor, the soil pH measurement in Figure 7 was changed from the original human measurement to a common measuring device that had been modified for the ESP32 microcontroller board.The farmer is further helped by recommendations of the fertilizer most suited for the crop chosen, its market accessibility, and a comparison of their costs at various locations.

Conclusion
In this paper, the main conclusion and results indicate that when an animal enters the premises, the system sends the user a warning message and plays a Repeller sound based on the animal's type.The recognition of cats, chickens, dogs, elephants, horses, monkeys, sheep, spiders, and squirrels is possible because to this system's seven-layer convolutional neural network architecture.Our model contains 150 training iterations, 150 validation iterations, a training accuracy of 0.9445, a validation accuracy of 0.7767, and a validation loss of 0.8973.Most animals cannot tolerate the Repeller sound because it can reach 120 dB, which is very loud.In this repellent system, the identification of animals is crucial because it allows us to play the sound in a way that prevents animal entry.In this proposed system, the simplified detection of the intrusive animal by utilizing the different layers of the convolution neural network.Since our proposed system has the capability of playing the sound of the other animal, which forces the intruder to leave the farm, the straying animal can depart without actually visiting there.The focus of this article is an AI-based animal repeller security system.The proposed approach provides the farms in agriculture with their security output.The system continuously notifies the owner.It educates and notifies users while producing a repulsive sound to safeguard the fields.
Based on an animal's category, it finds that animal.The camera modules continuously rotate to give 3600 angles of protection for the fields.It educates and notifies users while producing a repulsive sound to safeguard the fields.So the system is set up for precise and efficient implementation.
Figure 3. Smart Agriculture Using IoT

Figure 4 .
Figure 4. Block Diagram based on Proposed Algorithm Figure 5 shows the training and validation loss of the Tonne IoT dataset, showing that the training and validation losses will vary somewhat.This indicates that the model is correctly fitted (neither under-nor overfit).The model seems to work.

Figure 5 .
Figure 5. Accuracy and Loss Analysis of proposed system

Figure 7 .
Figure 7. Proposed parameter Estimation of location and threshold

Table 1 .
Proposed Simulation Parameters

Table 2 .
Output values of the proposed system