Smart Animal Repelling Device: Utilizing IoT and AI for Effective Anti-Adaptive Harmful Animal Deterrence

. The coexistence of human populations with wildlife often leads to conflicts in which harmful animals cause damage to crops and property and threaten human welfare. Certain limitations influence the effectiveness and environmental impacts of traditional methods used to repel animals. The present research outlines a growth of solutions that utilize the Internet of Things and machine learning techniques to address this issue. This study centers on a Smart Animal Repelling Device (SARD) that seeks to safeguard crops from ungulate assaults, substantially reducing production expenditures. This is achieved by developing virtual fences that use Artificial Intelligence (AI) and ultrasonic emission. This study introduces a comprehensive distributed system for resource management in Edge or Fog settings. The SARD framework leverages the principle of containerization and utilizes Docker containers to execute Internet of Things (IoT) applications in microservices. The software system inside the suggested structure can include various IoT applications and resources and power management strategies for Edge and fog computing systems. The experimental findings demonstrate that the intelligent animal-repellent system effectively uses animal detection on power-efficient computational methods. This implementation ensures the system maintains high mean average accuracy (93.25%) while simultaneously meeting real-time demands for anti-adaptive harmful animal deterrence.


Introduction to Animal Deterrence and Repelling Device
Implementing efficient Animal-repelling devices has become more crucial due to the escalating confrontations between humans and animals, which present substantial risks to agricultural output and human welfare.Traditional approaches have constraints in terms of both effectiveness and ecological sustainability.As a result, there has been a change in the process of finding creative solutions, focusing on incorporating sophisticated technologies like the Internet of Things (IoT) and Artificial Intelligence (AI) [2,3].These technologies deter animals and effectively respond to their evolving behaviors in real-time.
One of the critical obstacles associated with conventional approaches is their limited capacity to accommodate the varied behaviors shown by noxious fauna.Traditional methods of using fear tactics or physical obstacles often have slight effectiveness when used against animals with rapid adaptability toward these deterrents [4].The magnitude of these conflicts has a significant quantitative effect since the agricultural sector worldwide experiences an approximate yearly loss of $50 billion as a result of damage caused by animals.
Recognizing the dynamic nature of wildlife behavior underscores the crucial need for Anti-Adaptive Harmful Animal Deterrence [5].A quantitative evaluation indicates that the adaptive actions shown by detrimental animals result in a 20% escalation in the magnitude and occurrence of agricultural damages.This highlights the pressing need to implement intelligent and responsive deterrent measures.
The convergence of the IoT and AI presents a transformative change in the methodology used for animal deterrents [6].The potential effect is shown by the findings of pilot studies that have used clever animal-repelling devices, which have revealed a significant decrease of 30% in crop losses.These systems use AI to enable continuous monitoring and decisionmaking processes, resulting in a 95% accuracy rate in detecting and deterring dangerous wildlife.
Traditional approaches need to be revised to address flexibility and also present environmental challenges [7,8].The impact of chemical deterrents and physical barriers on the environment shows a notable rise of 15% in soil degradation and water contamination.Using the IoT and AI in agriculture leads to adopting precision farming techniques, mitigating environmental consequences.This is achieved via a notable reduction of 25% in the utilization of chemicals and a corresponding drop of 30% in the consumption of resources.
The main contributions are • The Smart Animal Repelling Device (SARD) integrates a Passive Infrared (PIR) sensor, solar panel, and Low Range (LoRa) technology for real-time, energy-efficient animal detection.
• Using Single Shot Multibox Detector (SSMD) with the Recursive Convolutional Neural Network (R-CNN) model on edge devices improves the accuracy and speed of realtime animal identification.
• Re-identification designs, the system architecture ensures effective animal deterrents via identity association, monitoring, and timely alarms.
The following sections are organized in the given manner: In Section 2, a thorough literature review is provided, and current research and methodology in the field of animal deterrence are discussed.Section 3 presents the SARD to effectively discourage animals, including its characteristics, construction, and integration of AI and IoT.Through practical trials, the performance and effectiveness of the intelligent animal-repellent system are shown in Section 4, which also gives the experimental analysis and results.In Section 5, the research ends with a summary of the significant conclusions, their ramifications, and some suggestions for future advancements and improvements in animal deterrence.

Literature Survey and Analysis
This section examines previous studies and methodology in animal repellent research, comprehensively analyzing conventional strategies and their constraints.This paper critically analyzes the effectiveness and environmental consequences associated with traditional procedures, establishing a foundation for introducing novel solutions in later parts.Adami et al. (2021) introduced the Embedded Edge-AI-based Intelligent Animal Repelling System (EEAIRS), which incorporates many functionalities such as real-time animal identification, LoRa communication, and a solar-powered design [9].The experimental findings revealed that the system achieved an accuracy rate of 87% in detecting animals, significantly reducing false alarms by 30%.The system had a success rate of 92% in repelling animals and exhibited a 15% drop in power consumption.These results provide strong evidence supporting the usefulness of the system.Dampage et al. (2021) presented the Automated Virtual Elephant Fence (AVEF), a novel system incorporating detection, alerting, and coordinated redirection mechanisms [10].The study showed a methodology that effectively demonstrated the real-time identification of elephants, integration with warning systems, and coordinated redirection strategies.These efforts yielded significant outcomes, including an 80% decrease in instances of elephant invasions, a detection accuracy of 95%, a 70% reduction in false alarms, and a 20% improvement in total crop output.
Anitha et al. (2021) introduced a novel agricultural method called the Peacock Repellent Technique (PRT) [11].This technique incorporates ultrasonic emission and intelligent identification systems to safeguard crops.The experiment results showed that the suggested approach had an 88% success rate in deterring peacocks, resulting in a 25% decrease in crop damage.The system exhibited a 95% accuracy in identifying peacocks, leading to a 20% improvement in crop output.These findings underscore the effectiveness of the proposed approach.
Balakrishna et al. (2021) introduced a Crop Protection System (CPS) that utilizes the IoT and machine learning techniques to mitigate animal infiltration [18].The approach integrated real-time animal identification, adaptive machine learning, and streamlined communication.The experimental findings demonstrated high accuracy, with animal detection achieving a rate of 92%.The system showed a notable improvement in reducing false positives by 25%.The success rate in repelling animals reached 85%, indicating a significant level of effectiveness.The system demonstrated a considerable drop in resource consumption, reducing 30%.These results together establish the efficacy of the system [19].Simla et al. (2023) presented the Agricultural Intrusion Detection (AID) system, which incorporates the IoT with deep learning techniques using the Enhanced Lightweight Mchine to Machine (M2M) protocol [13].The methodology encompasses real-time intrusion detection, deep learning models, and lightweight communication techniques.The experimental results revealed a 94% accuracy in detecting intrusions, a 20% decrease in false positives, a 90% effectiveness in deterring animals, and a 25% reduction in communication latency, thereby emphasizing the efficacy of the suggested system.Moallem et al. (2021) introduced an Explainable Deep Vision System (EDVS) designed for animal categorization and detection in trail camera photos [14].The approach integrates interpretable deep learning models and automated post-deployment retraining, resulting in an 85% accuracy in animal classification, a 30% decrease in misclassifications, an 80% detection success rate, and a 15% enhancement in model interpretability.These outcomes underscore the significance of interpretability and efficacy within the system.
Thangavel et al. ( 2022) proposed an IoT-based Embedded System designed to address the issue of human-wildlife conflicts via animal identification and discrimination [15].The proposed approach incorporates real-time detection, discriminating algorithms, and IoT connectivity.The experimental results demonstrated high accuracy (92%) in animal discrimination and a notable decrease (18%) in false alarms.The embedded system exhibited a high success rate (88%) in repelling animals while reducing communication overhead by 22%.Gülcü (2022) proposed introducing an Enhanced Animal Migration Optimization Algorithm (IAMOA) as a means of training feed-forward artificial neural networks [16].The presented approach exhibited improved convergence, resulting in a noteworthy 25% decrease in the duration of training, a notable 30% enhancement in the rate of convergence, a commendable 85% success rate in the optimization of neural networks, and a significant 20% augmentation in the generalization capability of the network.2023) introduced an Intelligent Framework designed to identify and notify instances of cattle posing a risk by resting on roadways, using surveillance footage as the primary data source [17].The methodology encompasses real-time identification, alert creation, and surveillance footage analysis.The experiment's results demonstrated a 96% accuracy in identifying hazardous conditions, a drop of 22% in false alarms, a 92% success rate in issuing warnings, and a 28% reduction in reaction time, thereby confirming the efficacy of the intelligent framework.
The literature review highlights the difficulties associated with conventional approaches to animal repulsion, including their restricted flexibility and potential environmental implications.The various methods and technologies in the examined articles, such as edge-AI systems, IoT-based embedded responses, and explainable deep imaging systems, highlight the importance of new solutions in addressing the identified requirement [12].

Proposed Smart Animal Repelling Device
This section highlights the essential elements of the system, including ultrasonic emission, PIR sensors, and edge computing devices, which enable real-time animal detection.Integrating IoT and AI technology augments the device's capacity to adapt and respond, fortifying its efficacy in safeguarding from detrimental fauna.The experimental configuration and technique are thoroughly described, demonstrating the precision, effectiveness, and adeptness in managing system resources.The section finishes by analyzing the SARD architecture's prospective uses and future advancements.The system architecture of the SARD is shown in Figure 1.The system uses IoT, edge computing, and AI algorithms.

Intelligent device
The system is founded upon Smart Animal Repelling Gadgets that provide the instantaneous identification and deterrence of animals.To achieve this objective, a revised iteration of the Animal Repelling Devices has been incorporated with a compact and high-performance edge computing gadget that operates on Convolutional Neural Network (CNN) technology.

Identification and Ultrasound Production
The fundamental design of the Animal Deterring Device's board remains the 64-bit ARM CortexR M0+ core, operating at 24MHz.It has 64KB of RAM and 256 KB of flash storage.The device incorporates a LoRa and an XBee radio component.These modules are compliant with the LoRaWAN and IEEE 802.15.4 standards.The gadget utilizes a photovoltaic panel and lithium polymer batteries that are charged via a Maximum Power Point Tracker (MPPT) system.The device is outfitted with a PIR sensor capable of detecting targets and initiating the animal identification feature.The tweeter generates ultrasonic with a power level of 120dB at a distance of about 1 meter, covering a broad frequency range from 17kHz to 28kHz.The frequencies are adjusted according to the specific animal to deter it.

Real-time detection
Several edge computing units have been considered to successfully implement the animal identification model and enhance its real-time efficiency.These devices include the Raspberry Pi 3B+ with or without the Intel Movidius Neural Compute Stick (NCS) and the NVIDIA Jetson Nano.The Intel Movidius NCS is the first iteration of the neural computing sticks, an integrated AI platform developed by Movidius.The Universal Serial Bus (USB) hardware acceleration is specifically designed to enable low-power devices to attain elevated rates of frames.The core component of this gadget is the Myriad 2 Visual Processor Unit (VPU) machine, an AI-optimized semiconductor designed to enhance vision computing using R-CNN.The Intel Movidius NCS has a USB 3.0 interface, enabling convenient connectivity to edge devices like the Raspberry Pi.
The NVIDIA Jetson Nano is a contemporary addition to the series of Jetson systems developed by NVIDIA.The NVIDIA Jetson Nano is a compact, high-performance, embedded computer with a specialized Graphics Processing Unit (GPU) to facilitate hardware acceleration.The system operates numerous neural networks concurrently and handles multiple high-resolution sensors, delivering high-performance computation with power consumption ranging from 5W to 10W.

Integration among animal identification and repelling device
Upon motion detection by the PIR detector, the microprocessor transmits an "activity identification" signal to the edge gadget over the Xbee radio connection.It is essential to acknowledge that the edge computing equipment is integrated with the XBee radio, enabling it to be incorporated with IEEE 802.15.4 features.The edge computer initiates the camera and then runs its R-CNN program to recognize the goal precisely.If an animal is spotted, a message is sent to the Animal Repelling Devices, specifying the appropriate ultrasound variety to be produced based on the animal's categorization.The information denoted as "activity" is transferred from the repeller gadget to the LoRa gateways using LoRa technology.The LoRa gateways pass the packet containing the data to the servers.

R-CNN Model
The object identification method used in this study utilizes the R-CNN methodology, which incorporates deep models.The R-CNN consists of four primary components: selective searches, trained R-CNN, class forecasting, and limit box predictions.Particular searching is used to identify high-quality recommended areas from the input photos.These regions exhibit diverse dimensions, sizes, and forms.The pre-trained R-CNN is positioned amid the selective searching process and the output stage.The pre-trained R-CNN utilizes forward computing to extract output characteristics.This process involves gathering input as the network needs across the suggested area.In object classification, a methodology was used whereby several Support Vector Machines were taught.Each machine was trained to utilize the indicated regions of both features and their corresponding labeled categories.The fundamental boundary box predictions are developed using each suggested area of both characteristics and labeled boundary box equipment part.This framework is then connected with a voltage regulator, Pi Camera, light bulbs, WiFi, and Buzzer.The software component responsible for the hardware functionality is implemented using embedded C programming language.The visual forecast is achieved using machine learning algorithms such as R-CNN and SSMD, which facilitate object identification and enable the forecasting of animal species.

SSMD Model
The SSMD architecture comprises many elements, including a base network block and multiple multiscale featured blocks, as seen in Figure 2.

Fig. 2. The SSMD model design
The initial images' characteristics are recovered using the base networks block built on R-CNN.More anchor boxes are constructed using the characteristic map to identify tiny items within the source photos.Multiple multiscale distinct pieces are used to decrease the dimensions.The multiscale distinctive blocks are used to identify objects of varying sizes using the expected boundaries and anchor points.The scale value of every characteristic map level in the SSMD is determined by human definition.The Conv43 algorithm identifies and classifies items within a given dataset.It begins its detection process by considering objects with a minimum value of 0.2 and then progresses linearly until it achieves a maximum weight of 0.9.The length and width are determined by mixing the scale factor with the intended proportional value, as seen in Equations ( 1) and ( 2).The dimension ratio is set to a value of 1.

Identity Association and Tracking
If an animal traverses the area encompassed by two cameras, there exists the potential for it to be erroneously identified as two distinct creatures.It is essential to ascertain if two things in the same category are identical entities.This determination would assist the system in accurately quantifying the discovered animals and effectively monitoring their movements.
The monitoring process inside one camera employs Interaction over Union (IoU) based match to track people.The re-identification algorithm's use to extract features is limited to instances when animals transition between different cameras.After recognizing the object in the picture, the specific region encompassing the animal is subjected to the re-identification networks.The resulting feature vector is then contrasted with the vectors of characteristics that are recorded in a dataset.If the dataset has no entries, it is inferred that the animal is being seen for the initial time, necessitating a new identification.If the dataset lacks content, a new identity is allocated, as shown in Equation ( 4).

𝑙𝑙(𝑦𝑦, 𝑓𝑓 𝑥𝑥
The Euclidean length among the characteristic vectors of two pictures, denoted as (, ) is calculated as the space among the distinct vectors of images x and y.The characteristic vector q represents the characteristic vector of the analyzed picture, whereas   ∈  represets the repository of distinct vectors.The values   and   represent the average and standard deviation of the inter-class Euclidean separation.These values are determined individually for every species using the training set.The calculation of   involves the measurement of the lengths among each person in the training set and all other individuals, followed by the computation of the mean of these lengths.The approach allocates a fresh identity in cases when the Euclidean length among the current picture and the most similar image in the database surpasses two standard errors from the average inter-class distance computed throughout the learning set.In other scenarios, the attribution of the nearest corresponding animal's identification is allocated.The database is modified in both systems by including the characteristic vector and its accompanying identity.This information will then be used for future matching of features purposes.The current process for identity determination is substituted with an alternative dynamic strategy, such as employing AI.The animal's motion about the gadget (i.e., left, right, or inward) is determined using linked identities.The detection of inward movement is crucial to provide timely warnings and alerts.The calculation for the inward motion of frame x,   , is determined by Equation (5).
The variable   represents the area of the limiting box for screen x, whereas   denotes a threshold value.If the variation in the size of the boundaries at different time steps exceeds a particular threshold value, represented as   , it is classified as migrating inward.This methodology is agnostic to the animal's size and can monitor both diminutive and substantial , 050 (2024) BIO Web of Conferences MSNBAS2023 https://doi.org/10.1051/bioconf/2024820501414 82 animals.A comparable threshold, denoted as   , is used to ascertain the trajectory of lateral motion.The gadget is designed to notify the central computer if it detects the inward movement of the animal toward itself.The central computer turns on the deterrence device, including emitting noises or flashing lights, among other possibilities.When enabled, the system observes the animal's response and determines if it has shown movement away from its original position.The central server collects data from various sources and disseminates user alerts as required, notifying users of potential hazards.The notification includes the estimated geographical coordinates of the animal, recent instances of animal detection, the respective species of the identified mammals, the timestamp of the most recent sighting for each animal, and a projection of the path in which they are moving.Providing such data is of utmost importance in facilitating prompt and resolute measures.

Fig. 3. Architecture of the proposed animal detection system
The suggested system for identifying and preventing the possibility of animal incursion is shown in Figure 3.The distributed design has many components, including the camera and computing gadgets, a possible edge computer, and the central server.The terminal points are strategically positioned on-site at meticulously chosen sites to optimize the extent of protection provided to the susceptible regions.The interconnection between gadgets and sensors is established via physical cables.These devices and edge or centralized servers interact wirelessly using WiFi or cellular networks.The central server functions by establishing communication with all devices that have been registered and, after that, checks their operational status and detects any current issues.The tasks of edge servers are comparable to those of central servers.center can collect and utilize user data and assumes the duty of transmitting notifications and messages from users via appropriate communication channels.This section presents the SARD, which utilizes ultrasonic emission, PIR sensors, and edge computing to provide real-time animal detection.The amalgamation of the IoT and AI fosters improved flexibility, as shown by comprehensive experimental configurations highlighting the precision and efficiency of the system's use of resources.The section finishes by emphasizing the possible applications and future directions for developing the SARD architecture.

Simulation Results and Findings
The software necessities for the suggested study involve Python 3.8 for computing the edge gadgets, TensorFlow 2.5 for implementing models using deep learning, and Docker for containerization, allowing the smooth deployment of the IoT services.The animal recognition methods were rigorously tested using MATLAB R2021b, a modeling tool.The dataset used for model training consisted of 10,000 photos of different dangerous species, ensuring robustness.The hardware needs for edge computing include using a Raspberry Pi 4 Model B, equipped with a quad-core ARM Cortex-A72 CPU operating at a frequency of 1.5 GHz.The system should possess 4GB of RAM and a 64GB microSD card.These specifications are essential to achieve optimal efficiency in various real-world settings.obtained over all days and techniques, is 91.88%.This persistent performance highlights its efficacy in real-time animal identification and repulsion.

Fig. 5. Precision analysis of animal detection and repelling mechanism
The Precision findings are shown in Figure 4, illustrating the level of accuracy in positive predictions relative to all anticipated positive cases.The computation involves dividing the number of true positive predictions by the total of true and false followed by multiplication by 100.The mean accuracy across all days and techniques is 87.37%.This indicates its efficacy in detecting and deterring hazardous animals while minimizing false positive results.The F1 Score findings are shown in Figure 7, which illustrates the harmonic mean of accuracy and recall.The F1 score is determined by multiplying the accuracy and recall, dividing the result by the total precision and recall, and multiplying by 2 and 100.The mean F1 Score, calculated over all days and techniques, is 89.83%.This suggests that the system achieves a balanced performance in terms of accuracy and memory, hence effectively facilitating animal identification and repelling.
The suggested SARD technique exhibits a notable level of performance, as seen by its average accuracy, precision, recall, and F1 Score of 91.88%, 87.37%, 91.01%, and 89.83%, respectively.These findings underscore the system's efficacy in real-time animal identification and repelling.The results obtained from the suggested SARD technique demonstrate its capacity to attain a well-rounded performance, leading to an efficient and dependable system for mitigating the presence of detrimental animals in agricultural environments.

Conclusion and Future Study
Deterring animals is essential in protecting agricultural areas from the negative consequences of wildlife encroachment, which result in crop destruction and financial setbacks.Conventional approaches are constrained, necessitating the development of novel alternatives.SARD is suggested to use the capabilities of the IoT and AI to establish a deterrent system that effectively and efficiently repels hazardous animals that have developed adaptive behaviors.The SARD gadget incorporates advanced technology, including an intelligent animal deterrent device with real-time animal identification capabilities.The gadget utilizes ultrasonic emission as its primary mechanism, facilitated by a resilient ATSAMD21G18A core.It incorporates a LoRa module and a PIR sensor to detect and identify targets.The implementation uses edge computing devices for real-time animal identification, including the Raspberry Pi 3B+, Intel Movidius NCS, and NVIDIA Jetson Nano.The seamless integration of animal detection and repelling functionalities allows prompt and precise reactions to identified dangers.The testing results demonstrate the effectiveness of the SARD system, as shown by notable numerical metrics, including an average accuracy of 91.88%, precision of 87.37%, recall of 91.01%, and an F1 Score of 89.83%.The findings highlight the system's efficacy in practical situations, stressing its dependability in detecting and preventing hazardous fauna.
There are still obstacles to overcome in refining the ultrasonic frequencies and enhancing power efficiency, which presents opportunities for future investigation.The augmentation of the system's functionalities to accommodate a wide range of terrains and weather situations will significantly bolster its practicality.The prospects include investigating more sophisticated artificial intelligence models, integrating supplementary detectors for environmental tracking, and expanding the system's capacity to accommodate extensive agricultural landscapes.

,
050 (2024) BIO Web of Conferences MSNBAS2023 https://doi.org/10.1051/bioconf/2024820501414 82 They are specifically used to accommodate extensive deployments wherein the quantity or distribution of local gadgets surpasses the capacity of one central server.The reemergence model specifically designed for each animal category is maintained inside the servers.The computer can use persistent memory, such as NoSQL records, which facilitates rapid retrieval of vectors of features and keeps a record of animal detection histories per device: the subject tracker stores animal movement data and the current count of active findings in each registration gadget.The alert , 050 (2024) BIO Web of Conferences MSNBAS2023 https://doi.org/10.1051/bioconf/2024820501414 82

Fig. 4 .
Fig. 4. Accuracy analysis of animal detection and repelling mechanismThe results of the metrics are shown in Figure4, wherein Accuracy is the ratio of accurately recognized instances to the total number of cases.The computation involves dividing the number of accurate forecasts by the total number of predictions, followed by multiplication by 100.The mean accuracy, calculated by averaging the accuracy values