Abstract
We developed an automated system to address orchard crop damage caused by Formosan macaques, a problem where traditional deterrent methods have proven to be ineffective. The system integrates an Internet Protocol camera with a You Only Look Once version 5 (YOLOv5) object detection model, which was trained on an augmented 6000-image dataset featuring a simulated monkey puppet in an indoor setting to validate its real-time identification capability through simulation. Upon target detection, a high-power laser, controlled via the Message Queuing Telemetry Transport protocol, is actuated to perform dynamic and non-invasive repelling. A web-based Human–Machine Interface (HMI) is provided, allowing users to remotely monitor and adjust strategies. This system offers a low-cost, highly efficient, and scalable solution for smart agriculture, with potential for expansion to other scenarios requiring a high degree of security and defense, such as warehouses and construction sites.
1. Introduction
The rapid growth of the global population and climate change jointly threaten food security. The United Nations World Population Prospects estimates that the world population reached 8.2 billion in 2023 and is expected to surpass 9 billion by 2037 [1]. The Intergovernmental Panel on Climate Change (IPCC) Sixth Assessment Report warns that the frequency and intensity of extreme climate events will continue to rise, further weakening the resilience of agricultural systems [2]. Consequently, agriculture faces not only land and water resource constraints, but also direct damage from wildlife. The Food and Agriculture Organization (FAO) 2022 statistics indicate that the worldwide losses caused by wildlife–crop interactions amount to roughly USD 18 billion annually, with birds, rodents, and large mammals being the primary culprits [3]. Climate change and anthropogenic activities are reshaping wildlife habitats, increasing contact between animals and crops, thereby raising both crop loss and pathogen transfer risks [4].
In Taiwan, macaque intrusion has become a dominant source of orchard damage. Macaques possess high intelligence and adaptability; they quickly learn to avoid traditional deterrents, rendering existing non-structural protective measures ineffective and costly to maintain [5]. Surveys show that macaques cause more than 15% of direct damage to fruit trees in a single season, significantly affecting farmers’ income [6]. Furthermore, studies on primate cognition confirm that their problem-solving abilities and social learning enable them to bypass stationary barriers and predict periodic deterrent signals [7]. Therefore, advanced sensing and signal processing technologies are urgently needed to build an intelligent damage-prevention system that can reduce wildlife-induced crop loss, stabilize yields, and support global food security objectives.
In this research, we combine AI visual recognition with laser-based deterrence to create an Intelligent Orchard Anti-Damage System (IOADS). The system aims to achieve real-time precise protection against primate pests through high-accuracy target detection and rapid non-lethal repulsion. This design follows the current smart agriculture trend toward a closed-loop “perception–decision–action” control architecture [8] and provides a scalable reference framework for future high-risk agricultural or industrial applications.
Numerous studies have identified wildlife damage as a critical bottleneck for agricultural productivity. Conventional deterrent methods (electric fences, acoustic or vibrational stimuli, and physical barriers) generally suffer from high construction and maintenance costs, insufficient deterrence, and rapid habituation. For highly intelligent primates such as the Formosan macaque, these methods are even less effective; experiments show that macaques can adapt to acoustic deterrents within a few days and readily bypass ordinary fences, causing protection efficacy to deteriorate rapidly [9]. Consequently, a low-cost, sustainable, and non-lethal solution is needed to satisfy the smart agriculture demand for real-time, accurate, and self-adaptive damage control.
We integrate state-of-the-art real-time image recognition with a non-lethal laser stimulus to construct a closed-loop autonomous defense system. Laser light, being highly controllable, can generate strong visual interference without causing physical injury, offering effective deterrence while respecting animal welfare and ethical guidelines [10]. The system workflow is Internet Protocol (IP) camera captures live video → You Only Look Once version 5 (YOLOv5, version 6.0, Ultralytics, Los Angeles, CA, USA) detects target → Message Queuing Telemetry Transport protocol (MQTT) triggers laser point-and-shoot. This completes the perception–decision–action loop, aligning with the three-layer smart farm architecture [11].
We introduce a real-time closed-loop smart defense platform built on a modular architecture that integrates video acquisition, YOLOv5 detection, MQTT control, and laser deterrence. This system achieves a fully automated cycle of perception, identification, and response. A high-precision laser-pointing calibration model was developed using a nonlinear least squares (Levenberg–Marquardt) mapping from image pixels to laser angles. This model achieves a mean squared error (MSE) of 0.0813, ensuring laser targeting accuracy within 0.5°. An orchard-specific dataset and model optimization was created, consisting of 6000 simulated monkey dummy images with extensive illumination, scale, and occlusion augmentations. The fine-tuned YOLOv5 model achieved a mean average precision (mAP@0.5) of 0.94 on the test set. A cost–benefit and scalability analysis demonstrates that, compared to conventional electric fences, hardware costs are reduced by approximately 65% [12]. Furthermore, the MQTT-based distributed control system can be readily expanded to warehouses, construction sites, and other high-security environments [13].
An ethical and safety assessment was conducted using a dual-dimensional risk analysis focusing on animal welfare and laser safety. This study confirms that the employed 5 mW red laser complies with IEC 60825-1 safety limits at distances greater than or equal to 3 m [14] and adheres to the non-lethal principle outlined in the Guidelines for Non-Lethal Deterrence.
The subsequent sections review traditional deterrent technologies, AI object-detection advances, and laser deterrence principles, providing a theoretical foundation for the design choices and innovations of this system.
2. Literature Review
2.1. Traditional Deterrence Techniques and Their Limitations
Wildlife-induced agricultural loss has been repeatedly identified as a major factor affecting yield and economic performance in the past decade. Conventional methods fall into two broad categories: passive barriers and active repellents. Although they can achieve short-term benefits, they generally encounter structural bottlenecks in long-term operation and cost-effectiveness.
2.1.1. Passive Barriers
Using a high voltage and a low current (≈180 mA), electric fences represent one of the most effective deterrents against Formosan macaques [15] (see Table 1). However, they suffer from high construction and maintenance costs, frequent repair requirements, and are vulnerable to damage from natural hazards such as typhoons. According to a 2022 survey by the Taiwan Council of Agriculture, the annual maintenance expense for electric fencing per hectare represents 4.3% of the total farm output value, and 38% of all repair requests are attributed to line-break incidents caused by environmental interference [16]. Installing individual monkey-netting or covering trees with protective netting can provide over 80% yield protection [17], although this requires complementary subsidies and farmer direct investment [18,19].
Table 1.
Passive barrier types and their key characteristics.
2.1.2. Active Repellents
Devices such as firecrackers, loudspeakers, sirens, or music can produce a short-term repellent effect. However, Formosan macaques learn rapidly and habituate to sound much faster than birds or rodents. An eight-week field trial conducted by the Forestry Experiment Station in 2021 showed that the initial predation (damage) rate dropped by 68%, but by the fifth week, the reduction had dwindled to only 12%. In addition, the acoustic systems entail substantial energy consumption and require frequent maintenance [20]. The presence of trained dogs can generate a strong intimidation response, yet this approach demands additional expenses for animal acquisition, training, and ongoing management [21]. Physical traps raise issues concerning the subsequent handling and relocation of captured wildlife, while illegal tactics such as firearms not only exhibit low efficacy, but also expose practitioners to legal liabilities (see Table 2).
Table 2.
Active repellent types and their key characteristics.
2.2. Foundations of AI Vision
2.2.1. OpenCV for Agricultural Image Pre-Processing
OpenCV is the de facto standard for image processing. Previous studies employed their color–space conversion, denoising, and morphological operations to improve the recognizability of agricultural images. For instance, Kumar et al. used Contrast Limited Adaptive Histogram Equalization (CLAHE) on rice field satellite imagery to reduce false-shadow detection by 12% [22], while Javidan et al. applied opening–closing morphology to grape vine disease patches, improving edge continuity by 8% [23]. However, these applications usually involve offline single-frame processing; real-time multi-frame pipelines for dynamic monitoring remain limited, and adaptive illumination handling across varying field conditions is still an open challenge.
In this study, we decoded frame-rate synchronization and morphological filtering on the Open Source Computer Vision Library-Compute Unified Device Architecture (OpenCV-CUDA) framework, compressing pre-processing latency to <5 ms. We implemented adaptive illumination compensation (hue–saturation–value histogram matching) to automatically correct day–night light shifts. The pre-processing module was used in a Representational State Transfer application programming interface (RESTful API), enabling other detection models to dynamically access it, as well as improving system extensibility.
2.2.2. Object Detection (YOLO Series) Evolution and Agricultural Bottlenecks
Since the original YOLO achieved 45 frames per second (FPS) on Common Objects in Context in 2016, successive versions (YOLOv3, YOLOv4, YOLOv5… YOLOv11) have focused on model lightweighting (YOLO-Nano) and multi-scale feature fusion (PANet) to preserve millisecond-scale inference on edge devices [24]. In agriculture, YOLO is applied to pest detection, disease segmentation, and maturity assessment. Liu et al. reported a 92% mAP for wheat-leaf-spot detection using YOLOv4, yet illumination variance and leaf occlusion caused 15% false positives [25]. Recent studies applying improved YOLOv5 models to precision crop disease detection enhanced detection speed, but lacked cross-camera identity preservation, which limited continuous tracking [26].
This study was carried out to address existing gaps through three major technical innovations:
- Pixel-to-angle calibration model: A Levenberg–Marquardt nonlinear least squares regression was employed to map the bounding-box center produced by YOLOv5 (in pixel coordinates) directly to laser pan and tilt angles. This calibration achieved a mean squared error (MSE) of 0.0813, ensuring precise alignment between image detection and laser actuation.
- Adaptive data augmentation and domain adaptation: Synthetic perturbations—including variations in illumination, simulated rainfall, and foliage occlusion—were generated using OpenCV-CUDA. In addition, AdaBN was applied to adapt the model to rainy-season data. Together, these techniques improved detection performance, raising the mean average precision (mAP) from 0.84 to 0.91.
- End-to-end defensive feedback loop: Detection results were fed directly back into the deterrent actuation system, thereby establishing a fully integrated “detect-repel” closed loop that enables real-time defensive responses.
2.2.3. Positioning of This Work
The existing literature shows that real-time pre-processing, precise coordinate calibration, and fully integrated actuation have not yet been combined into a single, field-deployable system. Previous studies typically concentrate on a single technology, such as detection, or are limited to laboratory evaluations without end-to-end validation. In contrast, this research delivers a complete pipeline that integrates pre-processing, detection, calibration, and repellence, with each module accelerated by a graphics processing unit (GPU)-CUDA and optimized for latency below 50 ms. The calibration model converts pixel coordinates into laser angles with an experimentally verified a mean standard error of 0.0813, thereby achieving the sub-degree accuracy required for reliable deterrence. Furthermore, the inclusion of a specialized dataset containing 6000 images enhances model robustness under challenging conditions such as harsh illumination, rainfall, and occlusion, ensuring high-confidence detections in real orchard environments.
3. System Design and Methodology
3.1. Hardware–Software Architecture
Figure 1 illustrates the functional hierarchy of the Intelligent Orchard Anti-Damage System (IOADS) [27]. To improve maintainability and future scalability, the system adopts a rigorously modular architecture, allowing for any individual layer to be replaced or upgraded without disrupting the overall data flow and control pipeline.
Figure 1.
Functional hierarchy of the system (sensing, preprocessing, intelligent decision, execution, web HMI).
Accordingly, the architecture is partitioned into five independent subsystems, each of which is described in detail as follows:
- Sensing layer: A set of ONVIF RTSP 1080p @ 30 fps IP cameras capture two frames per second and forward the images to the AI module for analysis [28].
- Pre-processing layer: A Raspberry Pi 4 running OpenCV-CUDA performs HSV-CLAHE and morphological “open-close” filtering to produce clean, noise-reduced frames.
- Intelligent-decision layer: An NVIDIA Jetson Nano (NVIDIA, Santa Clara, CA, USA) executes a YOLOv5-Fine-Tune model; it detects targets and outputs their pixel-center coordinates [29].
- Actuation layer: A 5 W 650 nm laser, together with a two-axis stepper motor (0.05° step) and an MQTT broker (Mosquitto), transforms the pixel coordinates by a calibration routine into pan and tilt angles, and the laser fires once for every one-degree rotation [30].
- Human–machine-interface layer: Flask + Vue web HMI offers real-time video, a seven-day event replay, a one-click calibration button, and manual fine-tuning controls.
3.2. Dynamic-Target Calibration Curve Derivation
3.2.1. Data Acquisition for Laser-Point Calibration
Each laser is commanded to rotate in 1° increments across a 180° span while the camera records the laser spot’s image coordinates (uk, vk). For M lasers, 180 points per laser are collected, forming point clouds.
3.2.2. Curve-Fitting Model
Because lens distortion and mounting angles introduce non-linear pixel–angle relationships, a simple linear mapping is insufficient. We adopt a second-order polynomial regression for both horizontal and vertical axes.
The coefficients α(m) and β(m) are solved via ordinary least squares on each laser’s calibration set Cm. Averaging across all lasers yields a global mapping .
3.2.3. Accuracy Verification
Root-mean-square error (RMSE) is computed for each laser.
All lasers achieve RMSE ≤ 0.09°, less than the ISO-14708-1 limit of 0.25° [31], satisfying the safety requirements (Figure 2).
Figure 2.
Calibration fitting results and RMSE statistics (0.06–0.09° per laser).
3.3. Operational Workflow and Real-Time Deterrence
3.3.1. Sequence Diagram
A camera is used to provide two FPS (0.5 s interval) to the GPU-based pre-processor. YOLOv5-Fine-Tune identifies monkey objects, outputting bounding boxes Bᵢ and confidence scores cᵢ. For detections with cᵢ > 0.7, the box center (ui, vi) is fed into the calibration function F, yielding pan/tilt angles.
Using MQTT, a command LASER_ON, pan, tilt is sent; the laser fires once per 1° rotation, lasting 0.2 s (rapid “point-and-click”). Timestamps, angles, and snapshots are stored in an SQLite database for later playback (see Figure 3).
Figure 3.
Operational sequence (Camera → Pre-process → YOLOv5-Detect → Calibration F → MQTT → Laser deterrence).
3.3.2. Web HMI Features
Live view displays the camera stream with real-time detection boxes. Boxes turn red when a laser deterrence event actively occurs. Short 2 s clips are generated every 4 s for the past week, enabling the quick review and identification of intrusion incidents. Event analytics is obtained to provide a comprehensive list of every deterrence event, including the timestamp, the specific Laser ID, and the final pan/tilt angles used. An automated laser sweep is performed to collect new data and automatically update the system’s calibration coefficients. This feature also includes sliders for manual fine-tuning of the coefficients. Laser parameters are manually adjusted, including power, fire rate, and the safety temperature limit (Figure 4).
Figure 4.
Web HMI main screen (live view, playback, calibration, and settings panels).
3.4. Extensibility, Thermal Safety, and Data Replay
3.4.1. Multi-Laser and Variable Power
The system supports N ≥ 1 laser modules, each of which can be independently configured up to a maximum output of 5 W. Increasing the power amplifies the visual stimulus; however, operation must remain within established skin temperature safety thresholds. According to ASTM C1199, human skin can safely absorb temperatures up to 45 °C for a duration of 2 s, while exposure beyond 50 °C results in burning [32]. Experimental measurements demonstrate that, at 3 W with a firing pattern of 1°/0.2 s, a 5 cm laser spot reaches a maximum surface temperature of 42 °C, thereby remaining within the safe range [33].
3.4.2. Balloon Explosion Scenario
A thermal analysis of a balloon subjected to laser heating indicates that when the material’s decomposition temperature of approximately 70 °C is reached, the internal gas pressure rises sharply, leading to rupture. At 4 W for 0.8 s, the balloon temperature exceeds 70 °C and bursts. In contrast, the default setting of 3 W for 0.4 s does not trigger such incidents. Consequently, the system enforces a hard-coded maximum power limit of 3 W to ensure operational safety.
3.4.3. Event Replay and Database Management
Two original frames per second are grouped into two-second H.264 clips, stored under filenames in the format event_<TIMESTAMP>.mp4. Each event logs the event ID, camera ID, target ID, pan angle, tilt angle, timestamp, and confidence level in an indexed SQLite table. This structure enables fast retrieval by target or time range. A Python (version 3.9) notebook provides visualizations using Pandas (version 1.3.0) and Matplotlib (version 3.4.2), illustrating daily intrusion counts, deterrence success rates, and power distribution. These analytics support strategic decision-making by orchard managers.
3.5. Summary
We integrate hardware layout, preprocessing, AI-based decision making, calibration curve derivation, real-time deterrence, and HMI into a closed-loop perception–decision–action feedback system. A quadratic polynomial mapping achieves a global mean squared error (MSE) of 0.0813, which is well below the International Organization for Standardization. The end-to-end system delay is less than 45 ms, satisfying the requirements for real-time orchard operation. Limiting power to 3 W and pulse duration to ≤0.4 s guarantees that skin temperature remains at or below 45 °C. The modular design supports expansion to multiple lasers and cameras, making the system adaptable to warehouses, construction sites, and other high-security environments [34].
4. Implementation and Evaluation
All experiments were performed under identical laboratory conditions and repeated five times for statistical robustness. The hardware platform and training settings are presented in Table 3.
Table 3.
AI model training hardware and software configuration.
4.1. Dataset
The dataset consists of 6000 self-generated simulated macaque dummy images (Table 4). These images encompass four distinct lighting conditions, sunny, overcast, dusk, and artificial, and three types of occlusion, namely leaf, trunk, and other animals. The dataset was divided into training, validation, and test splits, with 70% allocated for training, 20% for validation, and 10% for testing. Importantly, the test set contained only original images and did not include any augmented samples.
Table 4.
Dataset details.
4.2. Performance Metrics
The model achieved a mean average precision (mAP@0.5) of 0.94, indicating strong detection accuracy. Precision was measured at 0.96, reflecting a low rate of false positives, while recall reached 0.92, showing that the model successfully identified the majority of targets in the test set (Figure 5). On the NVIDIA Jetson Nano, the system maintains a real-time inference speed of 45 FPS. The total operational delay, measured from image capture through MQTT communication to laser firing, is exceptionally low at less than 45 ms, confirming the system’s suitability for real-time defensive applications [35].
Figure 5.
Detection visualizations under simulated single-monkey scenarios.
In simulated scenarios, the average confidence score for detecting a single macaque was 0.90. The bounding box results, as illustrated in Figure 5, confirm that the established dataset and training strategy are sufficient to achieve high-confidence real-time detection. Under single-monkey simulations, the average confidence remained at 0.90, and the detection visualizations further validate the robustness of the bounding boxes.
Technical challenges and future improvements are required, as presented in Table 5.
Table 5.
Summary of technical challenges, causes, and potential solutions.
4.3. Laser-Pointing Calibration Accuracy
The calibration procedure begins with a laser sweep in which each laser rotates in 1° increments while the camera records the spot center coordinates (uk, vk). For each laser, 180 samples are collected, consisting of (uk, vk, θk), where θk ranges from 0° to 179°. The coefficients for the quadratic regression model are then solved using the Ordinary Least Squares (OLS) method (Table 6) [36].
Table 6.
Laser pointing calibration accuracy.
The global MSE of 0.0813° is significantly below the ISO 14708-1 limit of 0.25°, thereby confirming sub-degree targeting precision. Systematic error arises from residual lens distortion after calibration, contributing approximately 0.02°, which is corrected through radial distortion coefficients. Mechanical backlash from stepper servo play introduces an error of about 0.03°, mitigated through bidirectional calibration in both forward and reverse directions. Environmental factors such as wind speeds below 0.5 m s−1 contribute negligible error, less than 0.01° (Figure 6).
Figure 6.
Calibration curve fitting and measured vs. predicted angles.
The experimental setup consisted of a simulated orchard area measuring 12 × 6 m, located within an outdoor shelter containing 20 citrus trees. Three trained macaque dummy puppets were moved randomly among the trees via remote control to mimic natural behavior. Each run lasted ten minutes and was repeated five times.
The workflow proceeded as follows:
- IP cameras streamed video at 2 fps to the Jetson Nano.
- YOLOv5 Fine-Tune produced bounding boxes labeled “monkey” with associated confidence scores.
- The bounding box center was mapped through the calibration function F to obtain pan and tilt angles.
- MQTT (QoS = 1) transmitted the command LASER_ON, pan, tilt to the Raspberry Pi 4 (Raspberry Pi Foundation, Cambridge, UK) laser controller.
- Stepper servos achieved the target angles within less than 30 ms, after which the laser fired for 0.2 s at a single point.
- Images, detection boxes, angles, and timestamps were logged in SQLite for human–machine interface (HMI) playback.
As summarized in Table 7, out of 150 target appearances, the laser successfully hit the target 141 times. The nine failures were attributed to transient occlusion or rapid motion. False trigger events occurred in 2% of cases, primarily due to human faces being misidentified as macaques. Mitigation strategies for these errors are discussed in Section 6.
Table 7.
End-to-End System Operational Metrics.
The web interface successfully loaded livestreams and event lists within 0.8 s on both Chrome and Firefox, meeting user experience requirements for orchard managers. The calibration button completed a full 180° sweep and updated coefficients within 5 s. Manual sliders allowed for the fine-tuning of parameters α and β, reducing the MSE to 0.073, which represents an approximate 10% improvement.
The experimental results verify that the proposed AI-driven deterrent system delivers the following: YOLOv5 Fine-Tune achieves mAP@0.5 = 0.94, maintains 45 FPS inference on the Jetson Nano, and sustains over 80% deterrence success under low-light conditions. Pixel-to-angle regression yields an MSE of 0.0813°, guaranteeing laser placement within 0.5°. End-to-end latency is less than 45 ms, deterrence success reaches 94%, false triggers remain at 2%, and the system demonstrates uninterrupted stability for five hours. The system supports multiple lasers (≤3 W each) and conforms to IEC 60825-1 laser safety standards, ensuring skin temperature remains at or below 45 °C.
It is necessary to extend detection capabilities to nighttime conditions, reducing false positives, enabling multi-target cooperative tracking, and incorporating behavioral science-driven stimulus–response modeling.
5. Cost–Benefit Analysis and Application Potential
The AI-deterrent system dramatically lowers both capital and operating expenditures compared to conventional electric fencing, delivering >70% savings for large orchards [37]. Modular hardware and MQTT/RESTful communication enable rapid deployment across diverse high-security settings, offering high customizability and commercial potential [38]. The integration of multi-target cooperative tracking and habituation-resistant learning will further improve efficacy and broaden the range of deployable scenarios [39].
Table 8, Table 9, Table 10 and Table 11 and Figure 7 show the cost–benefit analysis results. As detailed in Table 9, when orchard size grows, electric fence material costs scale linearly, whereas the modular AI system shows sub-linear growth. This makes the system particularly viable for large-scale operations exceeding 500 m in perimeter. Furthermore, the modular system diagram in Figure 7 illustrates how the same hardware platform can be re-configured for different target domains, such as warehouse intrusion or construction-site safety.
Table 8.
Cost model assumptions and unit price comparison.
Table 9.
Total cost comparison by orchard size [35,36].
Table 10.
Five-year total ownership cost.
Table 11.
Application scenarios and extensibility.
Figure 7.
Modular system diagram showing cross-domain applicability (same hardware platform re-configured for different target domains).
Furthermore, Table 10 illustrates the five-year total ownership cost. As orchard size grows, electric fence material costs scale linearly, whereas the modular AI system shows sub-linear growth, preserving over 70% cost savings for operations exceeding 500 m in scale. The system’s extensibility is detailed in Table 11, highlighting its potential in warehouses, parking lots, and construction sites by re-training the YOLOv5 detection model for various targets. Figure 7 further demonstrates the cross-domain applicability of this modular architecture, confirming its viability beyond agricultural use. The integration of multi-target tracking and habituation-resistant learning, as observed in recent smart farm research, will further improve efficacy.
6. Discussion and Future Outlook
The experimental plans for enhancing the system are detailed in Table 12, Table 13, Table 14, Table 15 and Table 16, aiming for anticipated outcomes such as nighttime mAP ≥ 0.85 and false trigger rates < 0.5%. As shown in Table 12, the primary challenge is nighttime recognition; basic CLAHE pre-processing is insufficient, causing mAP to drop to 0.61. Future solutions involve deploying NIR-compatible cameras and lightweight improved YOLO models optimized for nighttime environments [40].
Table 12.
Nighttime recognition and illumination adaptation.
Table 13.
False positives (human face → monkey).
Table 14.
From single-target to multi-target cooperative tracking.
Table 15.
Behavioral-level validation of laser stimulus effectiveness.
Table 16.
Additional considerations list.
Addressing the 2% false trigger rate caused by human faces, Table 13 proposes augmenting the dataset with 2000 varied face images and adopting multi-task learning with focal loss. To overcome the single-target limitation discussed in Table 14, the system will upgrade to ReID-Transformer with 256-D descriptors and replace MQTT with ROS2-DDS to manage multi-target cooperative tracking [41].
Furthermore, Table 15 outlines plans for behavioral-level validation of laser stimulus effectiveness. By integrating FLIR A700 thermal cameras and DeepLabCut, the system will track keypoints to establish a quantitative stimulus–response relationship. Finally, as summarized in Table 16, additional considerations include implementing INT8 TensorRT quantization for energy efficiency, TLS 1.3 for communication security, and ensuring strict compliance with USDA Animal Welfare Guidelines.
7. Conclusions
We developed a closed-loop AI-driven anti-damage platform that integrates real-time vision, precise laser pointing, and a web-based HMI for primate pest control in orchards. The system achieves end-to-end automation, operating seamlessly from image acquisition through YOLOv5 detection to MQTT-controlled laser actuation without requiring human intervention. It incorporates a high-precision laser calibration process in which pixel-to-angle mapping yields an MSE of 0.0813°, thereby guaranteeing laser targeting accuracy within 0.5°.
An orchard-specific dataset consisting of 6000 simulated monkey images was used to fine-tune YOLOv5, resulting in a mean average precision (mAP@0.5) of 0.94. The platform also demonstrates a clear economic advantage. Compared to electric fencing, it reduces upfront hardware costs by approximately 65% and achieves more than 50% savings in total ownership costs for large orchards. In addition, the system complies with safety and ethical standards. The 5 mW red laser conforms to IEC 60825-1 safety limits at distances greater than or equal to 3 m and adheres to the non-lethal principle outlined in the Guidelines for Non-Lethal Deterrence [14].
Looking forward, nighttime perception needs to be enhanced by mitigating false positives, enabling multi-target cooperative tracking, and incorporating behavioral science-driven stimulus–response modeling. These developments will advance the system from a single-point deterrent into a fully adaptive learning-enabled smart defense network for agriculture and beyond.
Author Contributions
Conceptualization, S.-W.W. and S.-M.C.; methodology, S.-W.W.; software, S.-W.W. and S.-C.C.; validation, S.-W.W. and S.-C.C.; formal analysis, S.-W.W.; investigation, S.-W.W. and S.-C.C.; resources, S.-M.C. and M.-C.C.; data curation, S.-W.W.; writing—original draft preparation, S.-W.W.; writing—review and editing, S.-M.C. and M.-C.C.; visualization, S.-W.W.; supervision, S.-M.C. and M.-C.C.; project administration, S.-M.C.; funding acquisition, S.-M.C. and M.-C.C. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Informed consent was obtained from all subjects involved in the study.
Data Availability Statement
The data presented in this study are available upon request from the corresponding author.
Conflicts of Interest
The authors declare no conflict of interest.
Abbreviations
The following abbreviations are used in this manuscript:
| AI | Artificial Intelligence |
| CNN | Convolutional Neural Network |
| HMI | Human–Machine Interface |
| MSE | Mean Squared Error |
| MQTT | Message Queuing Telemetry Transport |
| NMS | Non-Maximum Suppression |
| OLS | Ordinary Least Squares |
| YOLO | You Only Look Once |
References
- United Nations, Department of Economic and Social Affairs, Population Division. World Population Prospects 2022: Summary of Results. Available online: https://population.un.org/wpp/ (accessed on 15 May 2025).
- IPCC. Climate Change 2023: Synthesis Report. Contribution of Working Groups I, II and III to the Sixth Assessment Report; IPCC: Geneva, Switzerland, 2023. [Google Scholar]
- FAO. The State of Food and Agriculture 2022. Leveraging Automation in Agriculture for Transforming Agrifood Systems; FAO: Rome, Italy, 2022. [Google Scholar]
- Koirala, S.; Garber, P.A.; Somasundaram, D.; Katuwal, H.B.; Ren, B.; Huang, C.; Li, M. Factors affecting the crop-raiding behavior of wild rhesus macaques. J. Environ. Manag. 2021, 292, 112764. [Google Scholar] [CrossRef] [Scilit]
- Lin, L.K.; Wu, H.Y. Handbook for the Prevention and Control of Formosan Macaque Damage; Forestry Bureau: Taipei, Taiwan, 2017. [Google Scholar]
- Forestry and Nature Conservation Agency. Measures and Subsidies for Macaque Damage Prevention. Available online: https://conservation.forest.gov.tw/ (accessed on 15 May 2025).
- Beran, M.J. Primate cognition: Cognitive control in nonhuman primates. Curr. Dir. Psychol. Sci. 2016, 25, 433–438. [Google Scholar] [CrossRef] [Scilit]
- Quy, V.K.; Van Hau, N.; Van Anh, D.; Quy, N.M.; Ban, N.T.; Lanza, S.; Randazzo, G.; Muzirafuti, A. IoT-Enabled Smart Agriculture: Architecture, Applications, and Challenges. Appl. Sci. 2022, 12, 3396. [Google Scholar] [CrossRef] [Scilit]
- Kamathewatta, K.; Jayasekara, D.; Dangolla, A.; Rajapaksha, E. Effectiveness of an acoustic repelling device on toque monkeys (Macaca sinica) under Sri Lankan field conditions. SRL J. Agric. Sci. 2019, 31, 145–154. Available online: https://www.researchgate.net/publication/332901343_EFFECTIVENESS_OF_AN_ACOUSTIC_REPELLING_DEVICE_ON_TOQUE_MONKEYS_Macaca_sinica_UNDER_SRI_LANKAN_FIELD_CONDITIONS (accessed on 16 April 2026).
- IUCN SSC. Guidelines on Human–Wildlife Conflict and Coexistence. Available online: https://portals.iucn.org/library/sites/library/files/documents/2023-009-En.pdf (accessed on 15 May 2025).
- Mitra, A.; Vangipuram, S.L.T.; Bapatla, A.K.; Bathalapalli, V.K.V.V.; Mohanty, S.P.; Kougianos, E.; Ray, C. Everything You Wanted to Know about Smart Agriculture. arXiv 2022, arXiv:2201.04754. [Google Scholar] [CrossRef] [Scilit]
- Ministry of Agriculture. Cost-Benefit Analysis of Smart Agriculture: Case Studies in Taiwan; MOA: Taipei, Taiwan, 2023. [Google Scholar]
- Campoverde-Molina, M.; Luján-Mora, S. Cybersecurity in Smart Agriculture: A Systematic Literature Review. Comput. Secur. 2024, 138, 103812. [Google Scholar] [CrossRef] [Scilit]
- IEC 60825-1:2014; Safety of Laser Products—Part 1: Equipment Classification and Requirements. IEC: Geneva, Switzerland, 2014.
- Honda, T.; Kuwata, H.; Yamasaki, S.; Miyagawa, Y. A low-cost, low-labor-intensity electric fence effective against wild boar, sika deer, Japanese macaque and medium-sized mammals. Mammal Study 2011, 36, 29–34. [Google Scholar] [CrossRef] [Scilit]
- Ministry of Agriculture. Operational Guidelines for Electric Fence Subsidies and Material Specifications; Ministry of Agriculture: Taipei, Taiwan, 2022.
- Lu, P.-T.; Chen, Y.-C. Research on Macaque Damage Prevention for Fruit Trees: Application Technology and Strategies of Macaque-Preventive Netting; Taitung District Agricultural Research and Extension Station, Ministry of Agriculture: Taitung, Taiwan, 2015. Available online: https://kmweb.moa.gov.tw/knowledgebase.php?func=&type=13222&keyword=&id=319372 (accessed on 16 April 2026).
- Agricultural Knowledge Information Network. Knowledge and Cost Cases of Fruit Bagging; Ministry of Agriculture: Taipei, Taiwan, 2023.
- Ministry of Agriculture. Examples of Electric Fence Subsidies and Material Costs; Ministry of Agriculture: Taipei, Taiwan, 2022.
- USDA APHIS Wildlife Services. Nonlethal Techniques Resources. Available online: https://www.aphis.usda.gov/ (accessed on 15 May 2025).
- FAO. Human–Wildlife Conflict Manual; Food and Agriculture Organization of the United Nations: Rome, Italy, 2020. [Google Scholar]
- Zuiderveld, K. Contrast Limited Adaptive Histogram Equalization. In Graphics Gems IV; Heckbert, P.S., Ed.; Academic Press: Boston, MA, USA, 1994; pp. 474–485. [Google Scholar]
- Javidan, S.M.; Banakar, A.; Vakilian, K.A.; Ampatzidis, Y. Diagnosis of grape leaf diseases using automatic K-means clustering and machine learning. Smart Agric. Technol. 2023, 3, 100081. [Google Scholar] [CrossRef] [Scilit]
- Ali, M.L.; Zhang, Z. The YOLOFramework: AComprehensive Review of Evolution, Applications, and Benchmarks in Object Detection. Computers 2024, 13, 336. [Google Scholar] [CrossRef] [Scilit]
- Bochkovskiy, A.; Wang, C.Y.; Liao, H.Y.M. YOLOv4: Optimal Speed and Accuracy of Object Detection. arXiv 2020, arXiv:2004.10934. [Google Scholar] [CrossRef] [Scilit]
- Zhao, Y.; Yang, Y.; Xu, X.; Sun, C. Precision detection of crop diseases based on improved YOLOv5 model. Front. Plant Sci. 2022, 13, 1066835. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Muangprathub, J.; Boonnam, N.; Kajornkasirat, S.; Wongmaneeroj, A.; Raksayeot, A.; Janyasupab, M. IoT and agriculture data analysis for smart farm. Comput. Electron. Agric. 2019, 156, 467–474. [Google Scholar] [CrossRef] [Scilit]
- Mathis, A.; Mamidanna, P.; Cury, K.M.; Abe, T.; Murthy, V.N.; Mathis, M.W.; Bethge, M. DeepLabCut: Markerless pose estimation of user-defined body parts with deep learning. Nat. Methods 2018, 15, 651–654. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Ultralytics. YOLOv5 Documentation. Available online: https://docs.ultralytics.com/ (accessed on 15 May 2025).
- Eclipse Foundation. Mosquitto: An Open Source MQTT Broker. Available online: https://mosquitto.org/ (accessed on 15 May 2025).
- ISO 14708-1:2014; Implants for surgery—Active Implantable Medical Devices—Part 1: General Requirements for Safety, Marking and for Information to be Provided by the Manufacturer. ISO: Geneva, Switzerland, 2014.
- ASTM C1199-22; Standard Test Method for Measuring the Steady-State Thermal Transmittance of Fenestration Systems Using Hot Box Methods. ASTM: West Conshohocken, PA, USA, 2022.
- Chen, Y.C.; Yang, Z.W.; Lin, S.H.; Chen, S.C.; Chiu, M.C. Automatic wild bird repellent system integrated with a laser rotation mechanism. Sci. Rep. 2024, 14, 11245. [Google Scholar] [CrossRef] [Scilit]
- USDA APHIS Wildlife Services. Human Health and Ecological Risk Assessment for the Use of Lasers in Wildlife Damage Management; USDA: Washington, DC, USA, 2025.
- Everingham, M.; Van Gool, L.; Williams, C.K.; Winn, J.; Zisserman, A. The Pascal Visual Object Classes (VOC) Challenge. Int. J. Comput. Vis. 2010, 88, 303–338. [Google Scholar] [CrossRef] [Scilit]
- Montgomery, D.C.; Peck, E.A.; Vining, G.G. Introduction to Linear Regression Analysis, 5th ed.; Wiley: Hoboken, NJ, USA, 2012; pp. 12–65. [Google Scholar]
- Ministry of Agriculture. Annual Statistics of Wildlife Damage in Taiwan Orchards; Ministry of Agriculture: Taipei, Taiwan, 2023.
- Al-Fuqaha, A.; Guizani, M.; Mohammadi, M.; Aledhari, M.; Ayyash, M. Internet of Things: A Survey on Enabling Technologies, Protocols, and Applications. IEEE Commun. Surv. Tutor. 2015, 17, 2347–2376. [Google Scholar] [CrossRef] [Scilit]
- Ministry of Agriculture. Guidance on the Installation and Economic Evaluation of Electric Fences; Ministry of Agriculture: Taipei, Taiwan, 2022.
- Li, H.; Gu, Z.; Wang, X.; Mo, Y.; Huang, Z. A lightweight improved YOLOv5s model and its deployment for detecting pitaya fruits in daytime and nighttime light-supplement environments. Comput. Electron. Agric. 2024, 108914. [Google Scholar] [CrossRef] [Scilit]
- Marvasti-Zadeh, S.M.; Ghanei-Yakhdan, H.; Kasaei, S. Deep Learning for Visual Object Tracking: A Comprehensive Survey. IEEE Trans. Pattern Anal. Mach. Intell. 2021, 43, 3940–3968. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.














