论文信息

Farkhod Akhmedov / Sadikov Mahmudjon Akmuratovich / Mukhriddin Mukhiddinov 等 7 人

Agriculture

论文解读

AI 辅助整理
方法
在YOLO26中集成通道、空间注意力与深度代理特征调制,使用6万余张伪标注图像。
发现
验证集mAP@0.5达0.940,CBAM+深度代理配置较基线提升F1与mAP。
机会点
伪标注框固定且未人工校验,可研究真实精细标注下的检测与遮挡鲁棒性。

论文摘要

准确的动物检测对于智慧农业、野生动物监测和动物入侵预警系统十分重要,尤其是在无法进行持续人工观察的环境中。在本研究中,我们开发并评估了AYOLO-26,这是一种面向多类动物检测的注意力增强型YOLO26检测器,并将其检测精度和计算性能与基线YOLO26模型进行了比较。所提出的模型将通道注意力、空间注意力和深度代理特征调制集成到基于YOLO26的检测器中,以改善特征判别能力,并在伪标签协议下提升识别性能。研究构建了一个包含101个动物类别、61,062张图像的组合图像数据集,采用YOLO格式。由于源图像主要按图像级类别文件夹组织,因此使用归一化坐标(0.50, 0.50, 0.86, 0.86)为每张图像自动生成一个伪边界框。数据集被划分为48,845张训练图像和12,217张验证图像。因此,所报告的指标量化的是模型与伪标注之间的一致性,不应被解释为针对人工核验目标边界的性能。模型采用精确率、召回率、F1分数、mAP@0.5和mAP@0.5:0.95进行评估,并结合消融实验、鲁棒性、延迟和置信度阈值分析。主要训练后的AYOLO-26检测器在伪标签验证集上取得了0.923的精确率、0.880的召回率、0.901的F1分数、0.940的mAP@0.5和0.939的mAP@0.5:0.95。在一项单独的受控消融实验中,与相应的YOLO26基线相比,CBAM + 深度代理配置将F1分数从0.882提升至0.892,将mAP@0.5:0.95从0.927提升至0.932。最佳F1工作点出现在置信度阈值约为0.393时。在一个未标注的46张图像集上进行的鲁棒性代理分析显示,相对于原始图像,平均置信度保留率在低光照退化下为99.7%,在噪声下为91.1%,在遮挡下为75.1%,在模糊下为62.6%。这些结果为模型在模拟视觉退化条件下的行为提供了初步证据,但并未确立其在实际农业部署中的鲁棒性。

全文

Agriculture

Academic Editor: Francesco Marinello
Received: 30 September 2026
Revised: 10 November 2026
Accepted: 17 November 2026
Published: 18 November 2026
Copyright:© 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.
Article
AYOLO-26: An Attention-Enhanced YOLO Framework for
Multi-Class Animal Detection in Smart Agriculture
Farkhod Akhmedov 1, Mahmudjon Sadikov 2, Mukhriddin Mukhiddinov 3,4, Sarvarbek Sodikovich Yusupov 5,
Oybek Usmankulovich Mallaev 6, Toshtemir Abdikhafizovich Khujakulov 7
and Halimjon Ergashevich Khujamatov 8,*
1 Department of Computer Engineering, Gachon University, Sujeong-gu,
Seongnam-si 13120, Gyeonggi-do, Republic of Korea; farhod34@gachon.ac.kr
2 Department of Data Communication Networks and Systems, Tashkent University of Information
Technologies, Tashkent 100084, Uzbekistan; imaxmaxmud@gmail.com
3 Department of Computer Systems, Tashkent University of Information Technologies Named after
Muhammad Al-Khwarizmi, Tashkent 100084, Uzbekistan; m.mukhiddinov@tuit.uz
4 Department of Industrial Management and Digital Technologies, Nordic International University,
Tashkent 100128, Uzbekistan
5 Department of Mechanical Engineering, Kimyo International University in Tashkent,
Tashkent 100121, Uzbekistan; s.yusupov@kiut.uz
6 Department of Digital Technologies, Alfraganus University, Yukori Karakamish Street 2a,
Tashkent 100190, Uzbekistan; o.mallayev@afu.uz
7 Department of Computer Engineering, University of Tashkent for Applied Sciences,
Tashkent 100125, Uzbekistan; t.khujakulov@utas.uz
8 Department of Applied Informatics and Information Security, Osh State University, Osh 723500, Kyrgyzstan
*Correspondence: kh.khujamatov@tuit.uz
Abstract
Accurate animal detection is important for smart agriculture, wildlife monitoring, and
animal-intrusion alert systems, particularly in environments where continuous human
observation is impractical. In this study, we develop and evaluate AYOLO-26, an attention-
enhanced YOLO26 detector designed for multi-class animal detection, and compare its
detection accuracy and computational performance with those of the baseline YOLO26
model. The proposed model integrates channel attention, spatial attention, and depth-
proxy feature modulation into a YOLO26-based detector to improve feature discrimination
and improved recognition performance under the pseudo-label protocol. A combined
image dataset containing 101 animal classes and 61,062 images was prepared in YOLO
format. Because the source images were primarily organized using image-level class folders,
one automatically generated pseudo-bounding box was assigned to each image using the
normalized coordinates (0.50, 0.50, 0.86, 0.86). The dataset was divided into 48,845 training
images and 12,217 validation images. The reported metrics, therefore, quantify model
agreement with the pseudo-annotations and should not be interpreted as performance
against manually verified object boundaries. The model was evaluated using precision,
recall, F1-score, mAP@0.5, and mAP@0.5:0.95, together with ablation, robustness, latency,
and confidence-threshold analyses. The primary trained AYOLO-26 detector achieved a
precision of 0.923, recall of 0.880, F1-score of 0.901, mAP@0.5 of 0.940, and mAP@0.5:0.95 of
0.939 on the pseudo-labeled validation set. In a separate controlled ablation experiment,
the CBAM + depth-proxy configuration improved the F1-score from 0.882 to 0.892 and
mAP@0.5:0.95 from 0.927 to 0.932 compared with the corresponding YOLO26 baseline. The
best F1 operating point was obtained at a confidence threshold of approximately 0.393. A
robustness proxy analysis on an unlabeled 46-image set showed mean confidence retention
of 99.7% under low-light degradation, 91.1% under noise, 75.1% under occlusion, and 62.6%
under blur, relative to the original images. These results provide preliminary evidence of
Agriculture2026,16, 2544 https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 2 of 37
model behavior under simulated visual degradations, but do not establish robustness in
real agricultural deployments.
Keywords:wildlife intrusion monitoring; smart farming; attention-enhanced YOLO;
CBAM; edge computing; Internet of Things; pseudo-labeling; real-time inference;
agricultural surveillance

  1. Introduction
    Wildlife intrusion into agricultural areas represents a persistent challenge to crop pro-
    tection, livestock safety, food security, and sustainable farm management. Animals entering
    cultivated fields can consume or damage crops, disturb or prey upon livestock, damage
    farm infrastructure, and create safety risks for farmers and surrounding communities.
    These impacts are particularly serious where agricultural land borders forests, protected
    areas, wildlife habitats, or migration corridors. Moreover, the economic burden of human–
    wildlife conflict is often disproportionately high for low-income rural households and
    livestock keepers in developing economies [1]. The magnitude of agricultural losses varies
    substantially across locations, crops, seasons, and animal species. For example, farmers
    in severely affected agricultural communities in southern India reported crop losses of
    approximately 50–60% for maize and tapioca [ 2]. These findings highlight the need for
    timely and reliable intrusion-detection systems that can support appropriate intervention
    while reducing risks to both agricultural livelihoods and wildlife.
    Conventional wildlife-control measures include fences and other physical barriers,
    manual patrols, acoustic or visual deterrents, camera traps, passive infrared (PIR) sensors,
    and ultrasonic sensing devices. Although these approaches can provide basic protection
    or intrusion awareness, each has practical limitations. Physical barriers require regular
    maintenance and may have different levels of effectiveness for animals of different sizes and
    behaviors, whereas continuous manual monitoring is labor-intensive and difficult to main-
    tain over large agricultural areas. PIR and ultrasonic sensors can provide low-cost motion
    or proximity triggers but generally cannot independently determine the species, number,
    or precise location of the detected animals. PIR measurements can also be affected by
    sensor placement, environmental temperature, restricted fields of view, and the movement
    of non-target objects [3]. Camera-based monitoring provides richer visual and contextual
    information, but conventional image-processing methods remain sensitive to illumination
    variation, shadows, vegetation movement, partial occlusion, object-scale variation, and
    background complexity.
    Recent advances in deep learning (DL), computer vision, the Internet of Things (IoT),
    and edge computing have created new opportunities for automated agricultural surveil-
    lance. Convolutional neural networks (CNNs) can learn hierarchical visual representations
    directly from annotated images, reducing dependence on manually designed features.
    One-stage object detectors from the You Only Look Once (YOLO) family perform local-
    ization and classification within a unified inference pipeline and consequently provide a
    favorable balance between detection accuracy and computational efficiency [4,5]. These
    characteristics make YOLO-based models attractive for real-time animal monitoring using
    fixed cameras, camera traps, unmanned aerial vehicles, and embedded platforms.
    Nevertheless, animal detection in unconstrained agricultural environments remains
    difficult. Target animals may appear at different distances and spatial scales, be partially
    hidden by crops or vegetation, overlap with other animals, or resemble elements of the
    surrounding background. Performance may also deteriorate under low illumination, ad-
    https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 3 of 37
verse weather, motion blur, image noise, and unfamiliar deployment environments. Recent
analyses of deep learning-based animal detection have identified small-object detection,
class imbalance, environmental variability, and limited cross-location generalization as
persistent challenges [5].
Attention mechanisms provide a potential means of improving feature discrimination
under these conditions by adaptively emphasizing informative responses and suppressing
less relevant background features. Channel-attention mechanisms, such as squeeze-and-
excitation networks, model interdependencies among feature channels and assign greater
weights to channels containing task-relevant information [6]. Spatial-attention mechanisms
identify informative locations within feature maps. The Convolutional Block Attention
Module (CBAM), for example, sequentially applies channel and spatial attention while
introducing relatively limited architectural overhead [7]. The combined use of these mecha-
nisms may benefit animal detection when targets are small, partially occluded, or embedded
within visually complex vegetation.
Depth-related information can provide complementary geometric cues concerning
scene structure, relative object distance, and apparent scale. Depth maps may be obtained
using RGB-D sensors, stereo cameras, or monocular depth-estimation models [8]. However,
the practical value of depth-proxy attention depends on the accuracy of the depth repre-
sentation, its spatial alignment with the RGB image, the feature-fusion strategy, and its
additional computational cost. Consequently, a depth-aware detection framework should
clearly specify how depth is acquired or estimated and should isolate its contribution
through controlled ablation experiments.
Another important challenge concerns the deployment of detection models in rural
agricultural environments. Cloud-only processing requires sensor or video data to be
transmitted to remote infrastructure and may consequently introduce communication
delay, bandwidth consumption, and dependence on network availability. These limitations
are particularly relevant in geographically distributed agricultural areas where connectivity
may be intermittent. Edge computing addresses some of these concerns by processing time-
critical data near the camera or sensing device, enabling local inference and alert generation
while reducing the need to continuously transmit raw video [9]. Cloud infrastructure can
subsequently support centralized event storage, historical analysis, model management,
and monitoring across multiple locations. Hybrid edge–cloud architectures can, therefore,
combine the responsiveness of local processing with the storage and analytical capabilities
of centralized platforms [10].
Motivated by these considerations, this study presents AYOLO-26, an attention-
augmented animal-detection framework intended for IoT-enabled agricultural surveillance.
The proposed model extends a lightweight YOLO26 detector by integrating channel-,
spatial-, and depth-proxy attention components.
The principal contributions of this study are summarized as follows:

  1. A lightweight attention-augmented animal-detection architecture, referred to as
    A YOLO-26, is developed by modifying the YOLO26 detector with channel attention,
    spatial attention, and depth-proxy attention components to improve feature discrimina-
    tion and improved recognition performance under the pseudo-label protocol.
  2. A large-scale animal-detection dataset is constructed by combining Animals-10 and
    ScienceDB animal-image datasets. Class names are harmonized, overlapping cate-
    gories are standardized, duplicate and invalid samples are screened, and the final
    dataset is organized into a YOLO-compatible detection format.
  3. A pseudo-labeling procedure is applied to convert image-level animal category data
    into object-detection annotations. Each image is assigned a class label and a normal-
    https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 4 of 37
ized pseudo bounding box, enabling detector training on datasets that were originally
not fully prepared for object-detection learning.
4. A comprehensive experimental evaluation is conducted using precision, recall, F1-
score, mAP50, and mAP50:95, together with ablation analysis of the proposed attention
components.
5. Detection behavior is further analyzed under challenging visual conditions, includ-
ing illumination degradation, blur, noise, and partial occlusion, and computational
characteristics are examined in terms of model size and inference latency.
Despite these developments, an important scientific gap remains. Existing animal-
monitoring studies commonly focus on a limited number of species or evaluate individual
sensing and detection components separately. There is limited evidence on whether a
compact YOLO-based detector combining channel–spatial attention with depth-proxy
feature modulation can improve multi-class animal detection while retaining real-time
inference capability. In addition, deployment-oriented analyses of latency, confidence
thresholds, and robustness under visual degradation are often reported separately rather
than within a unified evaluation. Therefore, the objective of this study is to develop and
evaluate AYOLO-26, an attention-enhanced YOLO26 detector, and to compare it with a
controlled YOLO26 baseline using detection metrics, ablation experiments, computational
measurements, and robustness proxy analysis.
Recent developments in artificial intelligence, computer vision, the Internet of Things
(IoT), and edge computing have enabled automated animal monitoring for agricultural
protection and wildlife management. Early systems commonly used PIR sensors, GSM
communication, and rule-based alerts [ 11]. More recent architectures have combined
distributed sensors, edge or fog processing, cloud services, and remote notification [9,12].
Although these systems can provide low-cost event triggering and remote access, non-
visual sensors generally provide limited information about animal species, number, and
precise location [3,13]. Motion-based visual methods have also been investigated for animal
detection in aerial imagery [ 14], but their performance may be affected by illumination
changes, shadows, moving vegetation, camera motion, and weather variation.
Deep-learning methods have reduced the dependence on hand-crafted features and
have been applied to animal recognition and intrusion monitoring [ 15–17]. However,
several systems focus on specific species, particularly elephants [18,19], which limits their
direct generalization to animals with different sizes, appearances, and behaviors. In ad-
dition, camera-trap models may perform poorly when evaluated at locations or under
conditions not represented during training [ 20]. Before the adoption of deep-learning
detectors, animal recognition commonly used segmentation, hand-crafted texture features,
and conventional classifiers. For example, Radhakrishnan and Ramanathan combined
watershed segmentation, Gabor features, and an SVM for agricultural animal-intrusion de-
tection, achieving an accuracy of approximately 54.32% [21]. Such multi-stage pipelines are
sensitive to illumination, viewpoint, scale, occlusion, and background variation, motivating
the use of end-to-end learned object detectors. Two-stage detectors such as R-CNN, Fast
R-CNN, and Faster R-CNN can provide strong localization but may involve greater compu-
tational cost [22–24]. One-stage detectors, including YOLO, SSD, and RetinaNet, provide a
more suitable accuracy–speed trade-off for time-sensitive monitoring applications [4,25,26].
Subsequent detector designs have further explored efficient backbones, multi-scale feature
fusion, model scaling, and transformer-based representations [27–29].
Attention mechanisms can improve feature representation by emphasizing task-
relevant information. Channel attention recalibrates feature channels, whereas CBAM
combines channel and spatial attention to identify informative channels and spatial re-
gions [6,7]. Transformer-based self-attention has also influenced visual representation
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 5 of 37
learning, although its computational cost may be significant for resource-constrained de-
vices [29,30]. For agricultural animal detection, attention may be useful when animals
are small, partially occluded, or embedded in vegetation and other complex backgrounds.
However, attention visualizations alone do not establish performance improvements; the
contribution of individual components should be examined using equivalently trained
baselines and controlled ablation experiments.
Geometric or depth-related information may provide additional cues about scene
structure, object position, and apparent scale. Such information can be obtained using
RGB-D sensors, stereo cameras, or monocular depth estimation [8]. In the present study,
however, the proposed depth-proxy module does not use an external depth sensor or a
pretrained depth-estimation model. It combines a learned spatial gate with a fixed vertical
image-coordinate prior and should, therefore, be interpreted as a weak spatial proxy rather
than metric depth. The computational cost and independent contribution of this proxy
require quantitative evaluation.
Edge computing can support local inference and reduce dependence on continuous
cloud processing. Raspberry Pi, Google Coral, and NVIDIA Jetson platforms offer different
trade-offs among processing capability, memory, power, and cost. Neural-network quanti-
zation, pruning, and knowledge distillation can further reduce computational requirements,
although their effects on accuracy must be measured on the intended hardware [31]. Exist-
ing agricultural IoT systems have combined motion triggering, visual recognition, GSM
communication, and local deterrence [11,32], while broader smart-agriculture architectures
have used edge–cloud processing and centralized event management [9,10]. Nevertheless,
many studies evaluate individual components rather than the complete sequence from
image acquisition and inference to temporal verification, communication, notification, and
response activation.
Previous studies have demonstrated the usefulness of PIR, vibration, ultrasonic, and
UWB sensors for energy-efficient intrusion triggering. However, these sensors provide
limited information for species identification, animal counting, and precise spatial local-
ization [3,13]. Visual recognition can provide richer semantic information, but existing
agricultural monitoring systems often focus on a single high-risk species, particularly ele-
phants [18,19], and their generalization to different species, locations, and environmental
conditions remains insufficiently established [ 20]. Conventional vision methods based
on hand-crafted features are also sensitive to illumination, viewpoint, scale, background
clutter, occlusion, and noise [21,33].
Attention mechanisms, including channel and spatial attention, can improve feature
discrimination by emphasizing informative responses [6,7]. Nevertheless, their individual
and combined contributions to multi-class agricultural animal detection require controlled
component-level evaluation. Similarly, depth representations may provide geometric
information related to object distance and scale [ 8], but depth-guided attention has not
been sufficiently examined with respect to depth acquisition, feature integration, compu-
tational overhead, and independent detection contribution. In addition, many studies
evaluate either the recognition model or the IoT communication layer, without measuring
deployment-related characteristics such as model size, computational complexity, latency,
throughput, and robustness under degraded visual conditions [5,9,10,34–36].
The main scientific gap addressed in this study is the lack of a unified evaluation of a
compact multi-class animal detector that combines channel attention, spatial attention, and
depth-proxy feature modulation within a YOLO-based framework. To address this gap, we
develop AYOLO-26 and compare it with a controlled YOLO26 baseline using performance
metrics, component ablation, computational measurements, and robustness proxy analysis.
The detector is further incorporated into an IoT-enabled edge–cloud architecture supporting
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 6 of 37
local inference, temporal event verification, multi-channel notification, and cloud-based
event logging.
2. Materials and Methods
The proposed methodology comprises four principal components: (i) an IoT-based
hardware and software architecture for acquiring and transmitting surveillance data;
(ii) image preprocessing and normalization; (iii) the design and training of the attention-
augmented YOLO26 model, referred to as AYOLO-26; and (iv) edge-based inference,
intrusion-event processing, and multi-channel alert generation. These components are
integrated into an end-to-end framework intended to support animal detection under
the variable illumination, object-scale variation, occlusion, and background complexity
commonly encountered in agricultural environments.
2.1. System Architecture
As illustrated in Figure 1, the proposed system follows a layered edge–cloud architec-
ture consisting of four functional components: (A) CCTV-based image acquisition and IoT
connectivity; (B) the IoT sensing layer; (C) the edge-computing and inference layer; and (D)
the cloud analytics and notification layer.
Component A continuously acquires visual data from the monitored agricultural
area using an installed CCTV or Internet Protocol (IP) camera. The camera stream is
transmitted to an IoT-connected processing device, which serves as the interface between
the sensing infrastructure and the subsequent inference pipeline. Component B collects
the camera data and, where available, complementary measurements from sensors such as
PIR or ultrasonic devices. Component C performs local preprocessing, executes the trained
AYOLO-26 model, filters repeated events, and determines whether an intrusion alert should
be generated. Component D receives confirmed detection events and associated metadata
for remote notification, event storage, visualization, and long-term analysis.
This distributed architecture assigns time-critical detection and decision-making oper-
ations to the edge layer while reserving computationally less urgent tasks, including data
archiving, event-history analysis, and model management, for the cloud layer. As a result,
the system can reduce its dependence on continuous high-bandwidth video transmission
and maintain basic intrusion-detection functionality when network connectivity is limited.
However, the practical latency and bandwidth advantages of this architecture should be
confirmed through deployment measurements on the selected edge hardware.
Figure 1.Overview of the proposed animal-intrusion detection framework: (A) CCTV-based image
acquisition, (B) edge-device preprocessing and local storage, (C) AYOLO-26 inference for animal
detection, and (D) confidence-based decision making, alert notification, and cloud event logging.
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 7 of 37
2.1.1. IoT Sensing Layer (B)
The sensing layer is designed to acquire complementary visual, motion, and range
information from the monitored agricultural area. High-resolution Internet Protocol (IP)
cameras with a nominal resolution of at least 1920 × 1080 pixels provide the primary visual
input. Camera placement should be determined according to the field geometry, expected
animal-entry routes, camera field of view, installation height, and the presence of possible
visual obstructions. Overlapping camera coverage may be used in high-risk areas to reduce
blind spots and improve observation reliability.
In addition to the camera system, PIR and ultrasonic sensors can be incorporated as
complementary sensing modalities. PIR sensors provide low-power motion-triggering
signals, whereas ultrasonic sensors provide approximate range measurements. These
sensors do not independently provide reliable species identification; instead, they support
event triggering and help reduce unnecessary continuous processing. Their measurements
are combined with visual observations at the edge-computing layer, where the AYOLO-26
model performs animal localization and classification.
The use of multiple sensing modalities is motivated by the fact that each sensor has
distinct operational limitations. Cameras can be affected by illumination changes, occlusion,
adverse weather, and background clutter. PIR sensors may be influenced by ambient
temperature and slowly moving targets, while ultrasonic measurements may be affected by
surface orientation, vegetation, and acoustic interference. Combining these complementary
signals can potentially improve system-level reliability, although the contribution of each
sensing modality should be evaluated experimentally.
2.1.2. Edge-Computing Layer (C)
Edge computing is relevant to the proposed architecture because the AYOLO-26
detector is intended to perform image inference near the camera and generate local event
decisions. In this study, the implemented evaluation was limited to model inference on a
CPU using 416×416 images. The reported latency, therefore, represents detector-pipeline
latency and does not include camera acquisition, network transmission, temporal event
verification, notification delivery, or alarm activation.
The edge–cloud architecture proposed in this work includes local preprocessing,
AYOLO-26 inference, confidence filtering, temporal event verification, remote notification,
and cloud event logging. These components describe the intended system functionality;
however, a complete embedded deployment was not implemented or experimentally
evaluated. Similarly, quantization, pruning, knowledge distillation, power consumption,
memory usage, and communication bandwidth were not measured. Such optimization and
deployment analyses require validation on the intended hardware, such as a Raspberry Pi
or NVIDIA Jetson platform, and are, therefore, left for future work.
The complete edge-processing delay is defined as
Tedge =T acq +T prep +T inf +T post +T decision, (1)
where Tacq denotes frame-acquisition time, Tprep represents preprocessing time, Tinf is
model-inference time, Tpost denotes prediction post-processing time, andTdecision represents
temporal verification and alert-decision time. End-to-end alert latency additionally includes
message-transmission and notification-delivery delays.
2.1.3. Cloud Analytics Layer (D)
The cloud layer supports centralized event storage, remote monitoring, visualization,
and long-term analysis. Rather than continuously uploading complete video streams, the
edge device transmits confirmed intrusion events and associated metadata. Depending
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 8 of 37
on the configured data-retention policy, the uploaded record may include a time stamp,
camera identifier, detected species, confidence score, bounding-box coordinates, relevant
sensor measurements, and a compressed image or short event clip.
The accumulated event history can be used to analyze temporal and spatial intrusion
patterns, including frequently detected species, recurring entry locations, and periods of
elevated activity. Such information may support evidence-based camera repositioning,
adjustment of alert thresholds, and selection of appropriate non-harmful deterrence strate-
gies. The cloud service can also provide authorized users with dashboards for reviewing
detections and managing distributed monitoring locations.
Communication between edge nodes and the cloud infrastructure is protected using
authenticated and encrypted protocols, such as HTTPS over Transport Layer Security (TLS).
Access control, credential management, audit logging, and secure software-update proce-
dures should be incorporated to reduce unauthorized access and protect operational data.
Selective event transmission is expected to consume less network bandwidth than
continuous raw-video streaming. Nevertheless, the resulting bandwidth reduction depends
on the video bitrate, intrusion frequency, event-image or clip size, metadata volume, and
retention policy. It should, therefore, be calculated from deployment measurements rather
than assumed as a fixed percentage. The relative reduction in transmitted data can be
expressed as
Rbandwidth =
(︃
1− Devent
Dstream
)︃
×100%, (2)
where Devent is the volume of event-related data transmitted during the evaluation period
and Dstream is the volume that would have been transmitted through continuous video
streaming over the same period.
2.2. YOLO26 Baseline Configuration and Reproducibility
The baseline detector was the nano-scale YOLO26 configuration, implemented using
Ultralytics version 8.4.37 and PyTorch version 2.11.0. The local baseline configuration
follows the YOLO26 architecture family, with C3k2 blocks, SPPF, C2PSA, and a three-scale
detection head. The configuration was adapted to the 101-class dataset by setting the num-
ber of classes to 101 at training time. The baseline was trained for 100 epochs with an input
resolution of 416× 416 pixels, batch size 8, random seed 0, and the training settings reported
below. The baseline result reported in the ablation study corresponds to the checkpoint
selected by the highest pseudo-validation mAP@0.5:0.95 ( baseline/weights/best.pt).
AYOLO-26 uses the same base configuration with CBAM and the proposed depth-proxy
module inserted after the deepest backbone feature block.
2.3. Data Processing and Normalization
Images acquired in agricultural environments may exhibit substantial variation in
illumination, viewpoint, background composition, object scale, and image quality. A
consistent preprocessing pipeline is, therefore, applied before model training and inference.
Each input image is resized to the fixed spatial resolution required by AYOLO-26. When
the original aspect ratio differs from that of the model input, letterbox resizing is used
to prevent geometric distortion. Padding is added to the remaining image area, and the
bounding-box coordinates are transformed accordingly.
Let an input image be represented as
I∈R H×W×3 , (3)
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 9 of 37
where H and W denote the original image height and width. The letterbox scaling factor is
calculated as
s=min
(︃ Ht
H , WtW )︃, (4)
where Ht and Wt denote the target input dimensions. The resized image dimensions are
consequently given by
Hr =⌊sH⌋,W r =⌊sW⌋. (5)
The resized image is padded to obtain the final input tensor of size Ht ×W t. Pixel
intensities are subsequently converted to floating-point representation and normalized to
the interval[0, 1]as
In = Ip255, (6)
whereI p represents the resized and padded image. The same resizing, padding, color-
channel ordering, and normalization procedures are applied during training, validation,
testing, and deployment.
During training, data augmentation is applied to increase image diversity and reduce
sensitivity to environmental variation. The augmentation pipeline may include horizontal
flipping, moderate geometric transformation, brightness and contrast adjustment, color
perturbation, image scaling, partial occlusion, and noise injection. Transformations that may
create unrealistic animal appearances or invalid bounding boxes are restricted. All spatial
transformations are applied consistently to the images and their corresponding annotations.
Optional motion-based preprocessing can be used as an event-triggering mechanism
when continuous video is available. Frame differencing or Gaussian mixture model (GMM)-
based background estimation can identify candidate regions containing temporal change.
However, the resulting foreground mask is not treated as a replacement for the object
detector because background subtraction can be affected by camera motion, vegetation
movement, shadows, and illumination transitions. Unless motion masks are explicitly used
as model inputs during both training and inference, they should only determine when the
detector is executed rather than alter the detector’s RGB input. This separation prevents
inconsistency between the training and deployment pipelines.
2.4. Architecture of the Attention-Augmented Detection Model
The proposed detection model, referred to as AYOLO-26, extends the selected
YOLO26 baseline by incorporating a multidimensional attention mechanism into its feature-
extraction and feature-fusion pipeline. The attention mechanism is intended to strengthen
animal-related feature responses while suppressing activations associated with irrelevant
agricultural backgrounds.
AYOLO-26 combines three complementary attention operations: channel attention,
spatial attention, and depth-proxy attention. Channel attention determines which feature
channels contain the most discriminative information, whereas spatial attention identifies
where salient animal-related regions are located within the feature maps. depth-proxy
attention introduces geometric information associated with the relative distance and spatial
arrangement of candidate objects. The refined representations are subsequently passed
through the multi-scale feature-fusion network and detection head to predict animal classes
and bounding-box coordinates.
Given an intermediate feature tensor
F∈R C×H×W , (7)
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 10 of 37
the integrated attention transformation can be expressed generally as
Fatt =M θ(As(Ac(F) ),V ), (8)
where Ac and As denote channel and spatial attention, respectively. The matrix V encodes
vertical position on the feature grid, and Mθ denotes the learned depth-proxy modulation
described below.
2.4.1. Baseline Detection Architecture
YOLO26 is adopted as the baseline detector because of its favorable balance between
detection accuracy, computational efficiency, and model compactness. These characteristics
make it a suitable candidate for real-time inference on resource-constrained edge platforms.
The baseline architecture consists of a backbone for hierarchical feature extraction, a multi-
scale feature-fusion network, and a detection head for object localization and classification.
Let the input RGB image be denoted by
I∈R H0×W0×3, (9)
where H0 and W0 represent the height and width of the preprocessed input image, respec-
tively, and the final dimension corresponds to the three RGB channels.
The backbone progressively extracts hierarchical feature representations from the
input image. The transformation performed at thelth layer can be expressed as
F(l) =f (l)
(︂
F(l−1)
)︂
,l=1, 2, . . . ,L, (10)
with
F(0) =I, (11)
wheref (l) (·)denotes the transformation implemented by thelth network block and
F(l) ∈R Hl ×Wl ×Cl (12)
is the corresponding intermediate feature tensor. Here, Hl, Wl, and Cl denote the spatial
height, spatial width, and number of channels at layer l, respectively. Earlier layers
generally preserve fine-grained spatial information, whereas deeper layers encode higher-
level semantic features.
Feature maps produced at different backbone stages are subsequently processed by
the feature-fusion network. This operation combines high-resolution spatial information
with semantically rich low-resolution representations, thereby supporting the detection of
animals at different scales. The fused feature maps can be written as
{P1,P 2, . . . ,PS} =N
(︂
F(1),F (2), . . . ,F(L)
)︂
, (13)
where N(·) represents the feature-fusion network,P s denotes the fused feature map at
scales, andSis the number of detection scales.
The detection head processes these multi-scale feature maps and generates a set of
candidate detections:
ˆ︁Y= {ˆ︁yi}Ni=1, (14)
where N denotes the number of candidate detections and each prediction is represented as
ˆ︁yi =
(︂
ˆ︁xi, ˆ︁yi, ˆ︁wi, ˆ︁hi, ˆ︁ci, ˆ︁pi
)︂
. (15)
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 11 of 37
In Equation (15), (ˆ︁xi, ˆ︁yi) denotes the predicted bounding-box center, ˆ︁wi and ˆ︁hi repre-
sent its width and height, ˆ︁ci is the detection confidence score, and
ˆ︁pi = [ ˆ︁pi,1, ˆ︁pi,2, . . . ,ˆ︁pi,K ] ∈[0, 1] K (16)
is the predicted probability vector over K animal classes. The final predicted class is
obtained as
ˆ︁ki =arg maxk∈{1,...,K} ˆ︁pi,k. (17)
Predictions that do not satisfy the selected confidence and localization criteria are
removed during post-processing.
2.4.2. Channel-Attention Module
The channel-attention module models inter-channel dependencies and adaptively
determines the relative importance of individual feature channels. Given an intermediate
feature tensor
Fc ∈R H×W×C , (18)
where H, W, and C denote the feature-map height, width, and number of channels, respec-
tively, the module performs three operations: global-context encoding, channel-weight
estimation, and feature recalibration.
Global-Context Encoding
First, global average pooling (GAP) is applied independently to each feature channel.
This operation compresses the spatial dimensions ofF c and produces a channel descriptor
z=GAP (Fc) ∈R C. (19)
Thekth element of the channel descriptor is calculated as
zk = 1HW H∑i=1 W∑j=1 Fc(i,j,k),k=1, 2, . . . ,C. (20)
Global average pooling summarizes the overall activation of each channel using a
single scalar. Consequently,zprovides a compact global representation of the channel-wise
feature responses while discarding their explicit spatial locations.
Channel-Weight Estimation
The channel descriptor is passed through a two-layer bottleneck transformation to
learn nonlinear dependencies between feature channels:
ac =σ [W2 δ(W1z+b 1) +b 2], (21)
where
W1 ∈R
C
r ×C,W 2 ∈R C× Cr , (22)
and
b1 ∈R
C
r ,b 2 ∈R C. (23)
Here, r is the channel-reduction ratio, δ(·) denotes the rectified linear unit (ReLU)
activation function, and σ(·) denotes the sigmoid function. In the present implementation,
the reduction ratio is set tor=16. The resulting attention vector
ac = [ac,1,a c,2, . . . ,ac,C] ∈[0, 1] C (24)
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 12 of 37
assigns a normalized importance coefficient to each feature channel.
Feature Recalibration
The original feature tensor is recalibrated by multiplying each channel by its corre-
sponding attention coefficient:
˜︁Fc =F c ⊙a c, (25)
or, element-wise,
˜︁Fc(i,j,k) =F c(i,j,k)a c,k, (26)
where ⊙ denotes channel-wise multiplication with broadcasting over the spatial dimensions.
This operation strengthens channels encoding discriminative animal characteristics,
such as body shape, texture, boundaries, and other class-relevant patterns. At the same
time, channels dominated by background vegetation, shadows, illumination changes, or
other irrelevant responses can be suppressed. The recalibrated tensor ˜︁Fc retains the same
dimensions as the input tensor and is subsequently passed to the spatial-attention module.
2.4.3. Spatial-Attention Module
Whereas channel attention determines which feature channels are important, spatial
attention identifies the locations containing the most informative responses. The spatial-
attention module receives the channel-refined feature tensor
˜︁Fc ∈R H×W×C (27)
produced by Equation (25). Average-pooling and max-pooling operations are applied along
the channel dimension to generate two spatial descriptors:
Fsavg =AvgPool c
(︂
˜︁Fc
)︂
,F smax =MaxPool c
(︂
˜︁Fc
)︂
, (28)
where
Fsavg,F smax ∈R H×W×1 . (29)
The value of the average-pooled spatial descriptor at location(i,j)is given by
Fsavg(i,j) = 1C C∑k=1 ˜︁Fc(i,j,k), (30)
whereas the max-pooled spatial descriptor is calculated as
Fsmax(i,j) =maxk∈{1,...,C} ˜︁Fc(i,j,k). (31)
Average pooling summarizes the overall channel response at each spatial location,
while max pooling retains the strongest channel activation. The two spatial descriptors are
concatenated along the channel dimension:
Fspool = [︂Fsavg;F smax]︂ ∈R H×W×2 , (32)
where[·;·]denotes channel-wise concatenation.
The concatenated descriptor is processed by a convolutional layer followed by a
sigmoid activation function to generate the spatial-attention map:
As =σ
(︂
f 7×7
(︂
Fspool
)︂)︂
, (33)
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 13 of 37
where f 7×7(·) denotes a convolutional operation with a kernel size of 7 × 7, one output
channel, a stride of one, and appropriate padding to preserve the spatial dimensions.
Consequently,
As ∈[0, 1] H×W×1 . (34)
Each value inA s represents the relative importance of the corresponding spatial
location. Regions producing stronger task-relevant responses receive greater attention
weights, whereas less informative background regions receive smaller weights.
The spatially refined feature tensor is obtained by element-wise multiplication:
˜︁Fs = ˜︁Fc ⊙A s, (35)
or equivalently,
˜︁Fs(i,j,k) = ˜︁Fc(i,j,k)A s(i,j), (36)
where the spatial-attention map is broadcast across all C channels. The resulting tensor
satisfies
˜︁Fs ∈R H×W×C . (37)
Through this operation, feature responses at potentially informative animal locations
are strengthened, while responses associated with irrelevant background regions may be
suppressed. The spatially refined tensor is subsequently supplied to the next network block
or to the depth-proxy attention component.
2.4.4. Depth-Proxy Feature Modulation
The module takes the spatially refined RGB feature tensor ˜︁Fs ∈R H×W×C and a fixed
vertical-coordinate prior V∈R H×W . For a feature location at row i and column j, the prior
is defined by
Vij =v i, (38)
where vi is the coordinate value assigned to rowi and is constant across columns. The same
coordinate rule is used during training, validation, and inference.
The module derives a spatial gate from ˜︁Fs, combines the gate with V, and uses the
result to modulate the feature responses. The learned gate depends on image content,
whereas the vertical prior depends only on feature-grid position.
The term depth proxy describes the assumption that, for a fixed camera viewing
approximately level ground, image height may provide a weak cue to relative distance.
This assumption depends on camera viewpoint and scene geometry. The module does
not estimate animal distance. It uses no RGB-D sensor, stereo input, or monocular depth
estimator. Consequently, no external depth map is generated, resized, normalized, or
aligned with the RGB input. The reported latency includes the integrated module; its
individual latency was not measured separately.
3. Experimental Results and Analysis
3.1. Evaluation Metrics
The performance of AYOLO-26 was evaluated using standard object-detection met-
rics for multi-class recognition and localization agreement with the available pseudo-
annotations. In addition, a software-level alert simulation was performed to illustrate how
model predictions could be converted into intrusion notifications. Because no labeled video
sequences or ground-truth intrusion events were available, the alert simulation was not
treated as a formal event-level evaluation.Definitions of the principal evaluation outcomes
are presented in Table 1.
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 14 of 37
Table 1.Definitions of the evaluation outcomes used in this study.
Outcome Definition
True Positive (TP)
A ground-truth animal instance correctly detected and assigned to the
appropriate class at the selected intersection-over-union and confidence
thresholds. In the event-level evaluation, a true positive represents an
intrusion event that correctly triggers an alert.
False Positive (FP)
A predicted animal detection that cannot be matched to a corresponding
ground-truth instance, is assigned to an incorrect class, or represents a
duplicate detection. In the event-level evaluation, a false positive
represents an alert generated when no target intrusion is present.
False Negative (FN)
A ground-truth animal instance that is not correctly detected at the
selected thresholds. In the event-level evaluation, a false negative
represents an actual intrusion that does not trigger an alert.
True Negative (TN)
A non-intrusion sample correctly identified as not containing a target
intrusion. True negatives are used only in the binary event-level
evaluation and are not included in the standard object-detection AP or
mAP calculations.
For object-detection evaluation, a predicted bounding box is matched to a ground-
truth box when the predicted class is correct and their intersection over union exceeds
the selected IoU threshold. Each ground-truth instance can be matched to at most one
prediction. Unmatched or duplicate predictions are treated as false positives, whereas
unmatched ground-truth instances are treated as false negatives.
Precision, recall, F1-score, average precision (AP), and mean average precision (mAP)
were used to quantify multi-class animal-detection performance. Intersection over Union
(IoU) was employed to measure spatial agreement between predicted and ground-truth
bounding boxes. Collectively, these metrics characterize prediction reliability, detection
sensitivity, localization quality, and performance across the animal categories included in
the dataset.
3.1.1. Intersection over Union
The spatial overlap between a predicted bounding box Bp and its corresponding
ground-truth bounding boxB gt is measured using IoU:
IoU
(︁
Bp,B gt
)︁

⃓⃓Bp ∩B gt⃓⃓⃓⃓Bp ∪B gt⃓⃓ , (39)
where
⃓⃓Bp ∩B gt⃓⃓ is the intersection area and ⃓⃓Bp ∪B gt⃓⃓ is the union area. IoU ranges from
0 to 1, with larger values indicating greater spatial agreement between the predicted and
annotated animal regions.
3.1.2. Precision and Recall
Precision measures the proportion of animal detections produced by the model that
are correct:
Precision= TPTP+FP . (40)
High precision indicates that the model generates relatively few incorrect or duplicate
animal detections. This property is operationally important because false detections may
produce unnecessary notifications or deterrence actions.
Recall measures the proportion of ground-truth animal instances successfully detected
by the model:
Recall= TPTP+FN . (41)
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 15 of 37
High recall indicates that relatively few animal instances are missed. Recall is partic-
ularly important in agricultural surveillance because an undetected intrusion may delay
intervention and increase the risk of crop damage or livestock disturbance.
3.1.3. F1-Score
The F1-score is the harmonic mean of precision and recall:
F1 =2 Precision×RecallPrecision+Recall . (42)
The F1-score provides a single measure of the balance between false-positive and
false-negative detections. Because its value depends on the selected confidence threshold,
the threshold used for reporting the final F1-score must be stated.
3.1.4. Average Precision
For each animal class c, predictions are ranked according to their confidence scores.
Class-specific precision and recall are then calculated across confidence thresholds to
construct a precision–recall curve. Average precision is defined as the area under the
interpolated precision–recall curve:
APc(τ) =
∫︂ 1
0
Pc,τ (R)dR, (43)
where Pc,τ (R) denotes interpolated precision as a function of recall for class c at the IoU
threshold τ. Class-wise AP values can be reported to identify animal categories for which
the model exhibits comparatively strong or weak detection performance.
3.1.5. Mean Average Precision
Mean average precision is calculated by averaging AP across the C evaluated ani-
mal classes:
mAPτ = 1C C∑c=1 APc(τ), (44)
where C denotes the number of animal classes included in the evaluation and τ is the
IoU threshold.
Two mAP measures were used in this study. The first,mAP50, calculates AP at an IoU
threshold of 0.50:
mAP50 = 1C C∑c=1 APc(0.50). (45)
The second, mAP50:95, averages mAP over ten IoU thresholds ranging from 0.50 to
0.95 in increments of 0.05:
mAP50:95 = 110 ∑τ∈T mAPτ, (46)
where
T= {0.50, 0.55, 0.60, . . . , 0.95}. (47)
While mAP50 evaluates detection performance using a moderate localization criterion,
mAP50:95 provides a more stringent assessment by incorporating progressively stricter
bounding-box overlap requirements.
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 16 of 37
3.1.6. Computational Performance
The suitability of the proposed model for edge deployment should additionally be
evaluated using model size, parameter count, computational complexity, inference latency,
and throughput. Mean inference latency is calculated as
Tinf = 1N N∑i=1 ti, (48)
where ti denotes the inference time for the ith input and N is the total number of evaluated
inputs. Throughput in frames per second is calculated as
FPS= N
∑Ni=1 ti . (49)
All computational measurements should be reported with the corresponding hard-
ware, input resolution, batch size, numerical precision, software version, and inclusion or
exclusion of pre-processing and post-processing time (Table 2).
Table 2.Matched computational comparison of the YOLO26 baseline and AYOLO-26 under the local
CPU inference benchmark.
Model Params. (M) Size (MB) GFLOPs Mean (ms) Median (ms) P95 (ms) Min. (ms) Max. (ms) FPS
YOLO26 baseline 2.53 5.13 2.65 14.55 12.04 29.28 8.25 59.42 68.75
AYOLO-26 (CBAM + depth proxy) 2.60 5.26 2.68 16.93 14.36 29.85 10.76 59.58 59.07
Notes:Both models were evaluated using CPU inference on an Intel Core i7-14700K, Ultralytics 8.4.37,
and PyTorch 2.11.0. The benchmark used 46 auxiliary unlabeled images, 416×416 input resolution,
batch size 1, confidence threshold 0.25, IoU threshold 0.70, five warm-up inferences, and three timed
passes over the same image set. Timing includes image loading, preprocessing, model inference,
and post-processing, but excludes camera acquisition, temporal event verification, communication,
notification delivery, and alarm activation.
3.2. Dataset
Two publicly available image collections were used to develop and evaluate AYOLO-
26: the Animals-10 dataset [ 37] and the ScienceDB animal dataset [ 38]. The raw source
collections contained 69,917 images in total, including 29,917 images from Animals-10
and 40,000 images from the ScienceDB collection. These sources provide variation in
animal species, appearance, pose, object scale, viewpoint, illumination, and background
composition. Representative examples are shown in Figure 2.
The Animals-10 collection primarily contains image-level class labels and was origi-
nally designed for image classification. The ScienceDB collection provides a broader range
of animal categories. Because the source images did not contain consistently verified
object-level bounding boxes, the final dataset was converted into a YOLO-compatible
pseudo-labeled detection dataset. Each image inherited the class identifier associated with
its source folder and the class mapping defined in the dataset configuration file.
For each image, one automatically generated pseudo-bounding box was assigned
using the normalized YOLO coordinates
(xc,y c,w,h) = (0.50, 0.50, 0.86, 0.86),
where xc and yc denote the box center coordinates and w and h denote the normalized
box width and height. These boxes were not manually verified and do not necessarily
correspond to the true animal boundaries. Accordingly, the resulting dataset should be
regarded as a classification-to-detection pseudo-label benchmark rather than a manually
annotated object-detection dataset.
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 17 of 37
After dataset preparation, the final dataset contained 61,062 images from 101 animal
classes, indexed from 0 to 100. The images were divided into 48,845 training images and
12,217 validation images using an approximately 80/20 stratified split. The corresponding
annotation directories contained 48,705 training label files and 12,208 validation label files.
The difference between the numbers of images and label files resulted from repeated image
stems with different file extensions, for which multiple images shared a single YOLO label
filename. Therefore, label-file counts should not be interpreted as image counts.
All label files were checked for YOLO-format validity, class-index consistency, and
normalized coordinate ranges. No malformed label rows or invalid class identifiers were
found. Nevertheless, because the boxes were automatically generated rather than manually
verified, the reported validation metrics quantify agreement with the pseudo-annotations
and do not establish accurate localization relative to true object boundaries.
The training split was used for model optimization. The validation split was used
for convergence monitoring, model selection, calculation of precision, recall, F1-score,
mAP@0.5, and mAP@0.5:0.95, and selection of the validation-based confidence operating
point. No independent manually annotated test split was available.
An additional folder, datasets/test, contained 46 unlabeled images. These images
were not used to calculate test precision, recall, F1-score, mAP , or confusion matrices. They
were used only for qualitative prediction visualization, confidence-threshold behavior,
robustness proxy analysis, alert simulation, and latency measurement. Because these
images lacked ground-truth annotations, their results are reported only as qualitative or
proxy analyses.
During training, image augmentation was performed using the Ultralytics YOLO
pipeline. Mosaic augmentation was enabled with probability 1.0, horizontal flipping was
applied with probability 0.5, and HSV hue, saturation, and value variations were set to
0.015, 0.7, and 0.4, respectively. Translation was limited to 0.1 and image scaling was set to
0.5. Rotation, shear, perspective transformation, vertical flipping, BGR channel exchange,
mixup, cutmix, and copy–paste augmentation were disabled. Mosaic augmentation was
disabled during the final 10 training epochs. All spatial transformations were applied
consistently to the image and its associated pseudo-box (Table 3).
Table 3.Summary of the final pseudo-labeled YOLO animal-detection dataset.
Dataset Property Value
Raw source images 69,917
Final images after dataset preparation 61,062
Dataset format YOLO object-detection format
Source organization Image-level class folders
Number of animal classes 101
Class index range 0–100
Annotation type Automatically generated pseudo-bounding boxes
Training images 48,845
Validation images 12,217
Training label files 48,705
Validation label files 12,208
Total label files 60,913
Bounding boxes per image One pseudo-box
Pseudo-box format(x c,y c,w,h) = (0.50, 0.50, 0.86, 0.86)
Train/validation split Approximately 80/20 stratified split
Image file types PNG, JPEG, JPG
Dataset limitation Pseudo-labels were not manually verified
The animal dataset used in this study was prepared in YOLO object-detection format
from an image-level class-folder dataset. The dataset contains diverse animal categories
with variations in species, appearance, pose, scale, viewpoint, image quality, illumination,
and background composition. Representative examples are shown in Figure 2.
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 18 of 37
Figure 2.Representative images from the two publicly available datasets used in this study [37,38].
For each image, one pseudo-bounding box was generated using the normalized
YOLO format
(xc,y c,w,h) = (0.50, 0.50, 0.86, 0.86),
where xc and yc denote the box center coordinates and w and h denote the normalized
width and height. The class identifier was assigned according to the source-folder name
and the class mapping defined in the dataset configuration file.
The partitioning procedure was performed at the source-image level to reduce the risk
of data leakage. Near-duplicate images and augmented versions derived from the same
source image were retained within the same subset. Where possible, stratified partitioning
was applied to preserve the class distribution across the training, validation, and test sets.
Representative training images and their corresponding bounding-box annotations are
presented in Figure 3.
Figure 3.Representative images and corresponding bounding-box annotations from the combined
animal-detection dataset.
Table 4 distinguishes the two image resources used in the present study and clarifies
their respective roles. The main dataset contains 61,062 images from 101 animal classes
and was divided into training and pseudo-validation partitions. Each image received one
automatically generated fixed pseudo-bounding box; consequently, the resulting precision,
recall, F1-score, and mAP values quantify agreement with the pseudo-label protocol rather
than manually verified animal-boundary localization.
The auxiliary set contains 46 external unlabeled images and was not included in
training or pseudo-validation. It was used only for qualitative detection visualization,
simulated-degradation robustness-proxy analysis, and local CPU latency benchmarking.
No manually verified bounding-box subset was used in the present evaluation. Therefore,
the study does not report independently annotated test-set performance, and the auxiliary
images were not used to calculate precision, recall, F1-score, mAP , or confusion matrices.
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 19 of 37
Table 4.Image resources and their roles in the present study.
Image Resource Images Role Annotation Status and Use
Main pseudo-labeled dataset 61,062 Training and pseudo-validation
One fixed automatically gener-
ated pseudo-box per image; used
for model training and pseudo-
validation metrics.
Auxiliary image set 46
Qualitative visual-
ization, robustness
proxy, and latency
benchmark
Unlabeled external images; not used
to calculate precision, recall, F1-score,
mAP , or confusion matrices.
Table 5 summarizes the two source datasets used to construct the final animal-detection
dataset. Animals-10 contributed image-level animal category data, while the ScienceDB
dataset provided a broader set of animal categories. Both datasets were processed through
annotation preparation, label verification, class harmonization, and duplicate screening
before being combined for model training and evaluation.
Table 5.Summary of the datasets used to construct the animal-detection dataset.
Dataset OriginalImages OriginalClasses OriginalAnnotation Type Processing Applied
Animals-10
[37] 29,917 10 Image-level classlabels Bounding-box annotation, label verification,class harmonization, and duplicate screening.
ScienceDB [38] 40,000 100 - Annotation conversion, label verification, classharmonization, and duplicate screening.
Combined
dataset 69,917 - Bounding-boxannotations Final quality control and train–validation–testpartitioning.
3.3. Model Training and Reproducibility
The primary AYOLO-26 detector was trained for 100 epochs using an input resolution
of 416 × 416 pixels and a batch size of 8. Training was performed using the Ultralytics
YOLO implementation on the available CUDA device with two data-loading workers. The
model was initialized using the pretrained YOLO26 weights. The optimizer was configured
as auto in Ultralytics version 8.4.37. The initial learning rate was set to 0.01, the final
learning-rate fraction was set to 0.01, and cosine learning-rate scheduling was disabled.
Thus, the configured learning-rate schedule used the default non-cosine decay from the
initial learning rate toward the final learning-rate fraction.
The warm-up period was 3 epochs, with a warm-up momentum of 0.8. Momentum
was set to 0.937 and weight decay to 5 × 10−4. Automatic mixed precision was enabled
for the primary detector run. The random seed was set to 0 and deterministic execution
was enabled. Mosaic augmentation was closed during the final 10 epochs. The model
checkpoint with the best validation mAP@0.5:0.95 was selected for reporting.
The controlled ablation experiments used the same data split, input resolution, batch
size, number of epochs, optimizer configuration, learning-rate settings, warm-up settings,
random seed, and checkpoint selection criterion. The baseline and the four ablation variants
were trained using the following model definitions:
• YOLO26 baseline;
• YOLO26 with channel attention;
• YOLO26 with spatial attention;
• YOLO26 with CBAM;
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 20 of 37
• YOLO26 with CBAM and depth-proxy attention.
For the controlled ablation runs, automatic mixed precision was disabled so that all
variants were trained under identical numerical settings. The architectural configuration
was the only intended difference among the ablation variants (Table 6).
Table 6.Training configuration used for the primary detector and controlled ablation experiments.
Setting Value
Training epochs 100
Input resolution 416×416 pixels
Batch size 8
Optimizer Ultralyticsauto
Initial learning rate 0.01
Final learning-rate fraction 0.01
Learning-rate schedule Non-cosine decay
Warm-up epochs 3
Warm-up momentum 0.8
Momentum 0.937
Weight decay 5×10 −4
Pretrained initialization Yes
Random seed 0
Deterministic execution Enabled
Data-loading workers 2
Mosaic closing Final 10 epochs
Primary-run AMP Enabled
Ablation-run AMP Disabled
Checkpoint selection Best validation mAP@0.5:0.95
Figure 4 presents the evolution of the principal training and validation loss components:
bounding-box regression loss (box_loss), classification loss (cls_loss), and distribution
focal loss (dfl_loss). The bounding-box regression loss measures disagreement between
the predicted and ground-truth object locations, whereas the classification loss evaluates the
accuracy of the predicted animal categories. Distribution focal loss models bounding-box
coordinates as probability distributions and supports more precise boundary estimation.
Figure 4.Evolution of the training and validation losses over 100 epochs: bounding-box regression
loss (box_loss), classification loss (cls_loss), and distribution focal loss (dfl_loss).
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 21 of 37
The convergence behavior should be assessed by examining the training and valida-
tion curves jointly. A simultaneous reduction in both sets of losses indicates improved
optimization and generalization, whereas a continued reduction in training loss accom-
panied by stable or increasing validation loss may indicate overfitting. Consequently, the
checkpoint achieving the highest validation mAP50:95 was selected for final evaluation
rather than automatically using the weights from the last training epoch.
As shown in Figure 4, all three loss components decrease substantially during the
initial training epochs, followed by a more gradual reduction as training progresses. This be-
havior indicates that the model rapidly learns the principal visual and spatial characteristics
of the animal categories before entering a slower refinement stage.
The classification loss (cls_loss) exhibits an overall downward trend, suggesting pro-
gressively improved discrimination among the animal classes. Similarly, the bounding-box
regression loss (box_loss) decreases throughout training, indicating improved agreement
between predicted and ground-truth object locations. The reduction in distribution focal
loss (dfl_loss) further suggests improved estimation of bounding-box boundaries.
A more noticeable reduction in classification loss is observed during the later training
epochs. This behavior may be associated with the learning-rate schedule, which allows
smaller parameter updates and more refined class-boundary optimization during the final
training stage. However, the cause of this late-stage reduction cannot be attributed to the
learning-rate schedule without examining the corresponding learning-rate curve.
The overall loss behavior indicates stable numerical optimization and convergence
over the 100-epoch training period. Nevertheless, decreasing training losses alone do not
demonstrate generalization or establish the contribution of the attention mechanism. These
conclusions must be supported by validation losses, independent test-set results, and a
comparison with an equivalently trained baseline YOLO26 model.
Figure 5 presents the evolution of the principal validation metrics over the 100 training
epochs, including precision, recall, mAP50, and mAP50:95. These curves complement the
loss analysis by showing how improvements in the optimization objective correspond to
changes in the model’s detection and localization performance.
Figure 5.Evolution of the validation precision, recall, mAP50, and mAP50:95 over 100 training epochs
for the proposed AYOLO-26 model.
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 22 of 37
During the initial training epochs, the validation precision exhibits noticeable fluc-
tuations and an overall decrease from its early value. Such behavior is common during
early optimization because the model parameters and confidence calibration have not yet
stabilized. After approximately 10–15 epochs, precision becomes more stable, suggesting
that the proportion of incorrect positive detections changes less substantially during the
remaining training period. This interpretation should be based on the overall trend rather
than individual early-epoch values, which can be highly variable.
Validation recall increases progressively across the training epochs, indicating that
the model detects a larger proportion of the annotated animal instances and consequently
produces fewer false-negative detections. The improvements in both recall and precision
stability are also reflected in the mAP curves. Both mAP50 and mAP50:95 increase substan-
tially during the initial training phase and subsequently approach a plateau during the
later epochs. The difference between these metrics provides information about localization
performance under increasingly strict IoU requirements. A relatively small difference
suggests that many correct detections retain satisfactory bounding-box agreement at higher
IoU thresholds.
3.4. Distribution of Predicted Animal Classes
Figure 6 presents the frequency distribution of the animal classes predicted in the
test set. Among the 101 evaluated categories, panda, elephant, coyote, dog, lion, and deer
produced the largest numbers of detections. This distribution describes how frequently
the model predicted each category; it does not independently measure class-specific detec-
tion accuracy.
A high prediction frequency may result from a greater number of ground-truth in-
stances for a class, multiple animals appearing in individual images, duplicate or false-
positive detections, or differences in class-specific detectability. Therefore, the predicted
frequencies should be interpreted together with the ground-truth class distribution and
class-wise precision, recall, and AP values. Comparing predicted and annotated instance
counts can reveal whether the model systematically overpredicts or underdetects particular
animal categories.
Figure 6.The figure summarizes retained predicted classes, frequency distribution of animal classes
predicted by AYOLO-26 on the auxiliary unlabeled image set.
The predicted class distribution shows that AYOLO-26 generates detections across a
broad range of animal categories. However, differences in detection frequency should not
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 23 of 37
be interpreted directly as differences in recognition performance. More frequent predictions
may reflect the underlying number of test instances, the number of animals per image, class
imbalance, or class-specific false-positive behavior. Therefore, class-wise AP , precision,
recall, and ground-truth instance counts are required to assess whether the model performs
consistently across the animal categories.
Figure 7 presents the distribution of confidence scores associated with the detections
retained on the independent test set. The distribution is concentrated predominantly
in the higher-confidence range, indicating that the model assigns strong confidence to
many of its animal predictions. Nevertheless, a high confidence score does not necessarily
imply that a detection is correct. Confidence should, therefore, be analyzed separately for
true-positive and false-positive detections and interpreted together with calibration and
precision–recall results.
Figure 7.Distribution of confidence scores for animal detections generated by AYOLO-26 on the
auxiliary image set.
Most retained detections have confidence scores between 0.90 and 1.00, with the high-
est frequencies occurring approximately between 0.93 and 0.98. Only a small proportion
of predictions have confidence scores below 0.80. This negatively skewed distribution
indicates that AYOLO-26 assigns high confidence to many of the detections produced on
the test set.
However, prediction confidence should not be interpreted as direct evidence of correct-
ness, reliability, or generalization. A model may assign high confidence to both correct and
incorrect predictions. Therefore, the confidence-score distribution should be interpreted to-
gether with ground-truth matching results, class-wise precision and recall, precision–recall
curves, and calibration analysis. In particular, reporting the confidence distributions of
true-positive and false-positive detections separately would provide a more informative
assessment of prediction reliability.
3.5. Inference-Latency Analysis
Figure 8 presents the inference-latency distribution of AYOLO-26 measured on
46 benchmark images. The evaluation was performed on an Intel Core i7-14700K processor
using CPU inference, Ultralytics 8.4.37, PyTorch 2.11.0, an input resolution of 416× 416 pix-
els, and a batch size of one. The confidence and IoU thresholds were set to 0.25 and 0.70,
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 24 of 37
respectively. Five warm-up inferences were performed before timing, followed by three
complete passes over the 46 images (Table 7).
Table 7.Reproducible inference-latency benchmark configuration and results for AYOLO-26.
Setting Value
Evaluation device Intel Core i7-14700K CPU
PyTorch version 2.11.0
Ultralytics version 8.4.37
Model AYOLO-26 (CBAM + depth-proxy)
Input resolution 416×416 pixels
Inference batch size 1
Confidence threshold 0.25
IoU threshold 0.70
Benchmark images 46
Warm-up inferences 5
Timed repetitions 3 complete passes
Timing scope Image loading, preprocessing, inference, and post-processing
Mean latency 16.93 ms/image
Median latency 14.36 ms/image
95th-percentile latency 29.85 ms/image
Minimum latency 10.76 ms/image
Maximum latency 59.58 ms/image
Estimated throughput 59.07 FPS
The measured latency included image loading, preprocessing, model inference, and
post-processing through the Ultralytics prediction pipeline. It did not include camera
acquisition, network transmission, temporal event verification, notification delivery, or
alarm activation. The mean latency of AYOLO-26 was 16.93 ms/image, with a median
latency of 14.36 ms/image, a minimum latency of 10.76 ms/image, a maximum latency of
59.58 ms/image, and a 95th-percentile latency of 29.85 ms/image.
Figure 8.Per-image latency of AYOLO-26 measured over 46 benchmark images using CPU inference
at an input resolution of 416 × 416 pixels. Five warm-up inferences and three complete passes over
the benchmark set were used for timing.
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 25 of 37
The corresponding sequential throughput was calculated as
FPS= 1000Tlat , (50)
where Tlat is the mean per-image latency expressed in milliseconds. For AYOLO-26, the
resulting throughput was approximately 59.07 FPS. This value represents the measured
local image-processing pipeline and should not be interpreted as complete end-to-end
system throughput.
Although the measured latency is below the 33.3 ms threshold corresponding to
30 FPS image-level processing, it does not establish complete local CPU image-level infer-
ence benchmark performance. End-to-end evaluation would additionally require camera
acquisition, continuous video processing, temporal event verification, communication,
notification delivery, and alarm activation measurements on the intended edge hardware.
3.6. Precision–Recall and F1–Confidence Analysis
Figure 9 presents the precision–recall and F1–confidence curves of the trained animal
detection model.
Figure 9.Performance curves of AYOLO-26 on the pseudo-labeled validation partition: (a) class-wise
and aggregate precision–recall curves at an IoU threshold of 0.50 and (b) class-wise and aggregate
F1-score curves across confidence thresholds. These metrics quantify agreement with automatically
generated pseudo-bounding boxes.
3.6.1. Precision–Recall Analysis
Figure 9a presents the relationship between precision and recall. Precision repre-
sents the proportion of retained detections that are correct, whereas recall represents the
proportion of ground-truth animal instances successfully detected. The area under each
class-specific PR curve corresponds to the average precision at the selected intersection-over-
union threshold. The overall mAP50 is calculated by averaging AP50 across all evaluated
animal classes.
AYOLO-26 achieved an overall mAP50 of 0.940. The aggregate PR curve maintains
a precision of approximately 0.95 for recall values up to approximately 0.85 and remains
above approximately 0.90 until recall approaches 0.90. These results indicate a favorable
balance between detecting animal instances and limiting false-positive predictions over a
substantial portion of the operating range.
When recall exceeds approximately 0.90, precision decreases more rapidly. This
behavior indicates that recovering the remaining difficult instances requires accepting a
greater number of false-positive detections. These difficult cases may include small, distant,
partially occluded, visually ambiguous, or low-quality animal instances. Therefore, the
operational threshold should be selected according to the relative costs of missed intrusions
and unnecessary alerts.
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 26 of 37
The gray curves represent individual animal classes and reveal differences in class-
specific performance. Such variation may be associated with class imbalance, object size,
visual similarity, intra-class appearance variation, annotation quality, or background com-
plexity. Consequently, the aggregate mAP should be supplemented with class-wise AP
values and the number of test instances per class.
Although the highmAP50 demonstrates strong detection performance at an IoU thresh-
old of 0.50, it does not independently establish accurate localization under stricter overlap
requirements or robustness under challenging agricultural conditions. Localization qual-
ity should additionally be evaluated using mAP50:95, whereas environmental robustness
should be assessed through dedicated experiments involving low illumination, blur, noise,
occlusion, adverse weather, and cross-location data.
3.6.2. F1–Confidence Analysis
Figure 9b illustrates the relationship between the F1-score and the prediction-
confidence threshold. Because the F1-score is the harmonic mean of precision and recall,
this curve can be used to identify an operating threshold that balances false-positive and
false-negative detections.
The aggregate curve reaches a maximum F1-score of approximately 0.90 at a confidence
threshold of 0.393. The optimal threshold is defined as
τ∗c =arg maxτc F1(τc), (51)
whereτ ∗c =0.393 for the aggregate curve.
The F1-score remains comparatively stable across a broad intermediate threshold range
and remains approximately 0.85 at a confidence threshold of 0.80. At very low thresholds,
the model retains numerous low-confidence predictions, increasing the number of false
positives and reducing precision. Conversely, excessively high thresholds remove uncertain
but potentially correct detections, thereby increasing false negatives and reducing recall.
For practical deployment, the confidence threshold should be selected using the valida-
tion set rather than the test set. A lower threshold may be appropriate when missed intrusions
are considered more costly , whereas a higher threshold may be preferred when minimizing
false alarms is the primary objective. The class-specific curves also indicate that the optimal
threshold may differ among animal categories. However, class-specific thresholds should
only be adopted when supported by sufficient validation data to avoid overfitting.
3.6.3. Confusion-Matrix Analysis
Figure 10 presents the normalized confusion matrix for the evaluated animal categories.
The concentration of values along the main diagonal indicates that many detections are
assigned to their corresponding ground-truth classes. Off-diagonal elements represent
class-confusion errors, while the background row and column, if included, represent missed
ground-truth objects and unmatched predictions.
For a confusion matrix normalized according to the number of ground-truth instances
in each class, the diagonal element for classcis calculated as
Mcc = ncc
∑Cj=1 ncj , (52)
where ncc is the number of instances of class c correctly predicted as class c, and ∑Cj=1 ncj
is the total number of matched predictions associated with ground-truth class c. Under
this normalization, larger diagonal values indicate higher class-specific recall among the
evaluated matches.
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 27 of 37
The confusion matrix exhibits a generally dominant diagonal pattern, suggesting that
the model learns discriminative representations for many animal categories. Nevertheless,
the diagonal values are not uniformly equal to 0.90, and the weakest-performing categories
should be explicitly identified. Particular attention should be given to visually related
species, such as members of the felid family, and to classes with limited training data,
substantial appearance variation, or small object sizes.
Figure 10.Normalized confusion matrix of AYOLO-26 on the independent test set. Diagonal
elements represent correct class assignments, off-diagonal elements represent inter-class confusion,
and background entries, where applicable, indicate unmatched predictions or missed objects.
Low off-diagonal values indicate limited confusion for particular class pairs, but
they do not directly represent specificity in the binary-classification sense. Moreover,
a normalized confusion matrix can visually conceal class imbalance because rare and
common classes may receive equal visual weight. The normalized matrix should, therefore,
be accompanied by an unnormalized matrix or a class-wise table containing ground-truth
instance counts and the principal error pairs.
3.7. Qualitative Detection and Attention Analysis
Figure 11 presents a qualitative example of the detection and attention responses
produced by the proposed AYOLO-26 model for a zebra image. The visualization consists
of the final detection output and two complementary representations of the attention
response.
In Figure 11a, the model correctly identifies the zebra and produces a bounding box
with a confidence score of 0.94. This example demonstrates successful classification and
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 28 of 37
localization for the selected image. However, a single qualitative detection should be
regarded as an illustrative example rather than evidence of overall detection accuracy.
Figure 11b presents the attention response generated by the CBAM component.
Stronger activation is observed over visually distinctive regions of the zebra, particu-
larly the central body area and striped texture. In contrast, the attention intensity grad-
ually decreases toward several background regions, suggesting that the module assigns
comparatively greater importance to animal-related features than to some surrounding
visual content.
Figure 11c provides an alternative representation of the attention response. Increased
activation is visible around parts of the animal boundary and adjacent contextual regions.
These responses may support object localization by preserving information related to the
zebra’s shape, texture, and separation from the background.
(a) (b) (c)
Figure 11.Qualitative detection and attention visualization for a zebra: (a) final AYOLO-26 detection
with a confidence score of 0.94; (b) attention response emphasizing the animal’s body and striped
texture; and (c) alternative attention visualization showing responses around the animal boundary
and contextual regions.
The visualization suggests that the attention mechanism emphasizes features that
are relevant to the selected detection. Nevertheless, attention maps do not independently
demonstrate improved accuracy, robustness, or causal use of the highlighted regions. The
contribution of CBAM should, therefore, be established quantitatively through comparison
with an equivalently trained baseline and through ablation experiments in which the
channel- and spatial-attention components are individually removed.
4. Discussion
The comparison in Table 8 is a literature-level comparison. The reported values for
DETR, Faster R-CNN, RT-DETR, CF-DETR, YOLOv8, and YOLOv12s were taken from
their respective published studies. These models were not retrained on the pseudo-labeled
dataset used in this work. Therefore, the table provides contextual comparison only and
should not be interpreted as a controlled benchmark.
Table 8.Literature-level comparison with related object detectors.
Study/Model Task Precision Recall mAP@0.5 mAP@0.5:0.95
DETR [39] Chicken face detection 0.929 0.855 0.886 0.436
Faster R-CNN [39] Chicken face detection 0.942 0.871 0.934 0.546
RT-DETR [39] Chicken face detection 0.938 0.921 0.954 0.602
CF-DETR [39] Chicken face detection 0.9550.9460.969 0.628
YOLOv8 [40] Farm-animal threat detection 0.930 0.852 0.931 0.709
RT-DETR [41] Livestock detection in UAV imagery 0.950 0.9400.9700.650
YOLOv12s [41] Livestock detection in UAV imagery0.9600.9300.9700.630
Proposed model 101-class pseudo-labeled animal detection 0.923 0.880 0.9400.939
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 29 of 37
Table 9 separates performance measured on the pseudo-labeled validation set from
performance that will be measured on manually verified test images. The current pseudo-
validation results are precision 0.923, recall 0.880, F1-score 0.901, mAP@0.5 0.940, and
mAP@0.5:0.95 0.939. These values reflect agreement with automatically generated pseudo-
boxes and should not be interpreted as verified localization accuracy. The manual-test
columns must be completed only after human correction and independent evaluation of
the annotated subset.
Table 9.Normalized confusion matrix of AYOLO-26 on the pseudo-labeled validation partition. The
matrix represents agreement with automatically generated pseudo-labels.
Metric Pseudo-Validation
Precision 0.923
Recall 0.880
F1-score 0.901
mAP@0.5 0.940
mAP@0.5:0.95 0.939
4.1. Latency Comparison with Related Object Detectors
Table 10 provides a literature-level latency comparison with representative object
detectors. The reported values for DETR, Faster R-CNN, RT-DETR, CF-DETR, and YOLO-
family models are taken from their respective studies. When a study reported FPS rather
than latency, the approximate latency was computed as 1000 /FPS. This comparison is
contextual only, because the models were evaluated on different datasets, image resolutions,
hardware platforms, and software frameworks.
Table 10.Literature-level latency comparison with related object detectors.
Study/Model Task Reported Speed Approx. Latency Source
DETR Chicken face detection 31.4 FPS 31.85 ms [39]
Faster R-CNN Chicken face detection 34.0 FPS 29.41 ms [39]
RT-DETR Chicken face detection 74.1 FPS 13.50 ms [39]
CF-DETR Chicken face detection 81.4 FPS 12.29 ms [39]
Faster R-CNN UAV livestock detection – 28.06 ms [41]
RT-DETR UAV livestock detection – 3.20 ms [41]
YOLOv12s UAV livestock detection – 8.10 ms [41]
AYOLO 101-class pseudo-labeled 59.07 16.93 ms Ours
Although the proposed model achieves real-time inference with a mean latency of
16.93 ms/image, some related models in Table 10, such as RT-DETR and YOLOv12s in
UAV livestock detection, report lower latency values. This difference can be explained by
several factors. Initially, the latency values are not obtained under identical experimental
conditions. The proposed model was benchmarked locally on CPU, whereas many related
studies report results obtained using GPU-accelerated environments or optimized inference
settings. Since object-detection latency is strongly affected by the hardware platform, direct
comparison across studies should be interpreted cautiously.
Moreover, the proposed model addresses a broader 101-class animal detection problem,
while several compared studies focus on narrower detection tasks. For example, chicken face
detection and UA V livestock detection involve fewer object categories and more task-specific
visual distributions. A larger class space increases the complexity of the classification head
and may introduce additional computational overhead during inference. Additionally , input
resolution, preprocessing, postprocessing, and implementation framework differ among stud-
ies. Some reported latency values may measure only network forward-pass time, while others
may include image loading, preprocessing, non-maximum suppression, and result formatting.
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 30 of 37
In this study , latency was measured using the implemented prediction pipeline, which may
include more practical inference overhead. Models such as RT-DETR and YOLOv12s are
specifically optimized for real-time detection. RT-DETR reduces postprocessing overhead
through an end-to-end transformer-based detection design, while recent YOLO variants often
include architecture-level optimizations for efficient feature extraction and fast inference.
In contrast, the current implementation prioritizes lightweight deployment and multi-class
animal coverage over task-specific latency optimization.
Despite being slower than some reported GPU-optimized or highly specialized
models, the proposed detector still satisfies real-time requirements. Its mean latency
of 16.93 ms/image corresponds to approximately 59.07 FPS, which is above the 30 FPS
threshold commonly used for real-time video processing. Therefore, the model remains
suitable for real-time agricultural monitoring, especially when deployed in scenarios where
moderate latency is acceptable and broad animal-class coverage is required.
For future improvement, latency can be reduced through model export and opti-
mization techniques such as ONNX or TensorRT conversion, half-precision inference,
post-training quantization, pruning, batch-size optimization, and deployment on dedicated
edge accelerators such as NVIDIA Jetson devices. A fair latency comparison should also
be conducted by running all baseline models on the same hardware, using the same input
size, dataset, inference framework, and timing protocol.
The proposed model is faster than the DETR and Faster R-CNN results reported for
chicken face detection, and it is close to the real-time range reported by RT-DETR and CF-
DETR in that study. Compared with the UAV livestock-detection study, the proposed model
is slower than the reported RT-DETR and YOLOv12s results but faster than Faster R-CNN.
These differences should not be interpreted as a direct ranking, because the experimental
conditions are not identical. In particular, latency depends on hardware, input image size,
batch size, preprocessing, postprocessing, and whether GPU acceleration is used.
For agricultural monitoring, the measured latency of 16.93 ms/image is suitable for
real-time image-level inference because it exceeds the common 30 FPS threshold. For
a complete edge–cloud intrusion-detection system, the total response time should addi-
tionally include camera capture delay, frame transfer, preprocessing, alert decision logic,
communication latency, and alarm activation time.
Table 11 below shows that the proposed AYOLO-26 configuration consistently im-
proves upon the YOLO26 baseline across all evaluation metrics. Although the absolute
gains are moderate, the improvement in precision, recall, F1-score, and mAP values indi-
cates that the attention-enhanced design provides more reliable detection performance for
the 101-class animal detection task.
Table 11.Performance improvement of the proposed AYOLO-26 configuration over the YOLO26
baseline.
Model Precision Recall F1 mAP@0.5 mAP@0.5:0.95
YOLO26 baseline 0.912 0.854 0.882 0.928 0.927
Proposed AYOLO-260.920 0.865 0.892 0.932 0.932
Absolute improvement +0.008 +0.011 +0.010 +0.0048 +0.0049
Table 12 presents a same-dataset comparison between AYOLO-26 and three represen-
tative lightweight YOLO detectors: YOLOv8n, YOLOv10n, and YOLO11n. All models
were trained and evaluated using the same pseudo-labeled dataset split, 30 training epochs,
an input resolution of 416 × 416 pixels, batch size 32, random seed 0, AMP , disk caching,
and the same validation procedure. Thus, the experiment provides a direct comparison of
the models under a common dataset and training schedule.
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 31 of 37
Table 12.Comparison of representative lightweight YOLO detectors and AYOLO-26 on the same
pseudo-labeled dataset. All models used 30 epochs, 416 × 416 input resolution, batch size 32, and
random seed 0.
Model Parameters Precision Recall F1 mAP@0.5 mAP@0.5:0.95
YOLOv8n 3.35 M 0.912 0.864 0.888 0.931 0.930
YOLOv10n 2.84 M0.9170.864 0.890 0.933 0.933
YOLO11n 2.66 M 0.9160.867 0.891 0.933 0.933
AYOLO-262.60 M0.841 0.754 0.795 0.850 0.849
Among the reference models, YOLO11n achieved the best observed accuracy–
efficiency balance, obtaining the highest recall (0.867), F1-score (0.891), mAP@0.5 (0.933),
and mAP@0.5:0.95 (0.933), while using only 2.66 million parameters. YOLOv10n achieved
the highest observed precision (0.917). AYOLO-26 had the lowest parameter count (2.60 mil-
lion), but its 30-epoch pseudo-validation performance was lower than that of the refer-
ence models.
The AYOLO-26 result should be interpreted together with the ablation results in
Table 13. In the 100-epoch ablation experiment, the CBAM + depth-proxy AYOLO-26
configuration improved upon the corresponding YOLO26 baseline in all reported metrics.
However, the 30-epoch cross-model comparison does not establish that AYOLO-26 is intrin-
sically inferior to the reference models, because the reference YOLO models were initialized
from official pretrained checkpoints whereas the custom AYOLO-26 YAML configuration
was initialized without transferred pretrained weights. Therefore, Table 12 is reported as
a controlled same-dataset and same-schedule comparison, with initialization differences
explicitly acknowledged. A fully matched comparison requires compatible pretrained
weight transfer to AYOLO-26 or training all compared models from random initialization.
Table 13.Ablation analysis of attention components in the YOLO26 detector.
Variant Epochs Precision Recall F1 mAP@0.5 mAP@0.5:0.95
Baseline 100 0.912 0.854 0.882 0.928 0.927
Channel attention 100 0.916 0.853 0.883 0.929 0.929
Spatial attention 100 0.913 0.859 0.885 0.928 0.927
CBAM 100 0.916 0.854 0.884 0.927 0.927
Depth-proxy only 100 0.9170.8670.892 0.931 0.931
CBAM + depth proxy 1000.9200.8650.892 0.932 0.932
The ablation results in Table 13 represent that the incorporation of attention modules
generally improves the detection performance of the YOLO26 baseline. The baseline
model achieved an mAP@0.5 of 0.928, an mAP@0.5:0.95 of 0.927, and an F1-score of 0.882,
indicating that the lightweight YOLO26 architecture already provides strong detection
capability on the combined animal dataset.
To isolate the contribution of the depth-proxy module, we added a depth-proxy-
only control that excludes CBAM. This configuration obtained an F1-score of 0.892 and
mAP@0.5:0.95 of 0.931, compared with 0.882 and 0.927 for the baseline, respectively. The
results indicate a positive observed contribution from the depth-proxy module. The
combined CBAM + depth-proxy configuration achieved the highest observed mAP@0.5:0.95
(0.932). Since each variant was trained once, these results are descriptive; repeated runs
with independent random seeds are required to assess statistical significance.
Figure 12 presents the final mAP comparison among the YOLO26 ablation variants
after 100 training epochs. The proposed CBAM + depth-proxy configuration achieved
the highest detection accuracy, with an mAP@0.5 of 0.932 and an mAP@0.5:0.95 of 0.932.
Compared with the baseline model, this represents an improvement of approximately
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 32 of 37
0.5 percentage points for both mAP metrics, indicating that the combined attention and
depth-proxy modulation improves localization consistency.
Figure 12.Final mAP comparison of YOLO26 ablation variants after 100 training epochs.
Figure 13 shows the final precision, recall, and F1-score comparison across the ablation
variants. The proposed CBAM + depth-proxy model obtained the best overall balance
between precision and recall, achieving a precision of 0.920, recall of 0.865, and F1-score of
0.892. The improvement in recall is particularly important for animal detection in monitor-
ing applications, where missed detections may reduce the reliability of alert generation.
Figure 13.Final precision, recall, and F1-score comparison across YOLO26 ablation variants.
Figure 14 illustrates the training evolution of precision, recall, mAP@0.5, and
mAP@0.5:0.95 for all ablation variants. The curves show that all models converge to-
ward stable performance by the later training epochs, while the CBAM + depth-proxy
variant maintains the strongest final performance. This trend suggests that the proposed
attention-enhanced configuration improves feature representation without destabilizing
the training process.
The ablation results demonstrate that each attention component contributes differently
to detection performance. The spatial-attention variant mainly improved recall and F1-
score. Recall increased from 0.854 to 0.859, while the F1-score increased from 0.882 to 0.885.
This indicates that spatial attention helps the detector focus on relevant object regions,
particularly when animals appear under varying scales, viewpoints, and background
conditions. The CBAM variant, which combines channel and spatial attention, achieved
higher precision than the baseline but produced only a modest improvement in overall
mAP . This suggests that the combined attention mechanism improves feature selectivity;
however, its isolated contribution is limited because the baseline detector already performs
strongly on the pseudo-annotated dataset. The best performance was obtained by the
CBAM + depth-proxy variant, which achieved a precision of 0.920, recall of 0.865, F1-score
of 0.892, mAP@0.5 of 0.932, and mAP@0.5:0.95 of 0.932. Compared with the baseline,
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 33 of 37
this corresponds to improvements of approximately 0.8 percentage points in precision,
1.1 percentage points in recall, 1.0 percentage point in F1-score, 0.5 percentage points in
mAP@0.5, and 0.5 percentage points in mAP@0.5:0.95. These gains indicate that combining
channel–spatial attention with depth-proxy feature modulation improves both classification
confidence and localization consistency.
Figure 14.Training evolution of precision, recall, mAP@0.5, and mAP@0.5:0.95 for YOLO26 ablation
variants.
The computational results also illustrate the trade-off between feature refinement
and inference cost. AYOLO-26 increased the parameter count by approximately 2.6% and
GFLOPs by approximately 0.85% relative to the baseline, while mean CPU latency increased
from 14.55 to 16.93 ms per image. Thus, the attention modules improved validation
agreement with the pseudo-annotations but introduced a measurable latency penalty.
This trade-off is consistent with the broader literature, which emphasizes that model size,
computational complexity, latency, memory, and hardware conditions must be considered
together when evaluating edge-oriented detectors [27,31].
4.2. Limitations and Implications for Interpretation
The present findings must be interpreted as evidence of agreement with the study-
specific pseudo-label protocol rather than as independently verified animal-detection
performance. Each image in the main dataset was assigned a fixed automatically generated
pseudo-bounding box. These boxes do not necessarily correspond to the true extent,
position, or number of animals in an image. Consequently, the reported precision, recall, F1-
score, and mAP values quantify consistency with the generated labels and cannot establish
accurate animal-boundary localization or reliable performance in real agricultural scenes.
The ablation findings also require cautious interpretation. Each configuration was
trained once using a fixed random seed. The modest differences between the baseline,
individual attention modules, and the CBAM + depth-proxy configuration are descriptive
single-run observations. Without repeated training across independent seeds, the study
cannot determine whether the observed differences are reproducible architectural effects or
reflect training variability.
Finally, the operational scope of the study is restricted to local image-level inference.
The latency benchmark did not include camera acquisition, sensor triggering, temporal
https://doi.org/10.3390/agriculture16222544

Agriculture2026,16, 2544 34 of 37
event verification, network transmission, cloud processing, notification delivery, alarm
activation, energy consumption, or testing on agricultural edge hardware. Likewise, the
simulated degradation analysis does not substitute for real field validation. Accordingly,
the present results do not establish event-level detection performance, complete edge–cloud
deployment capability, or robustness under actual agricultural monitoring conditions.
5. Conclusions
In this study, we developed and evaluated AYOLO-26, an attention-enhanced YOLO26
detector for multi-class animal-image detection. The proposed model combines channel at-
tention, spatial attention, and a depth-proxy feature modulation module. The depth-proxy
module does not use RGB-D sensors, stereo cameras, or monocular depth-estimation mod-
els; instead, it combines a learned spatial gate with a fixed vertical image-coordinate prior.
The final dataset contained 61,062 images from 101 animal classes and was constructed
using automatically generated pseudo-bounding boxes. The primary detector achieved a
precision of 0.923, recall of 0.880, F1-score of 0.901, mAP@0.5 of 0.940, and mAP@0.5:0.95
of 0.939 on the pseudo-labeled validation split. These values quantify agreement with
the pseudo-annotations and should not be interpreted as definitive evidence of accurate
localization relative to manually verified animal boundaries. The confidence threshold
corresponding to the highest validation F1-score was approximately 0.393 and should be
regarded as a validation-derived operating point.
In the controlled ablation experiment, the YOLO26 baseline achieved an F1-score
of 0.882 and mAP@0.5:0.95 of 0.927. The CBAM + depth-proxy configuration achieved
an F1-score of 0.892 and mAP@0.5:0.95 of 0.932. These improvements were modest and
were obtained from a single training run

论文原文与出版信息

Agriculture
查看论文原文

继续探索