Skip to Content
AgricultureAgriculture
  • Article
  • Open Access

18 September 2026

28 Pages

BarnSeg-ECA-Lite: A Lightweight Instance Segmentation Model for Feed, Buffalo Heads, and Mineral Lick Blocks in Buffalo Barn Environments

,
,
,
and
1
Department of Precision Agriculture and Agricultural Robots, Faculty of Science and Letters, Burdur Mehmet Akif Ersoy University, 15200 Burdur, Türkiye
2
Department of Biotechnical Systems, Faculty of Biotechnical Systems Engineering, National University of Science and Technology Politehnica Bucharest, 060042 Bucharest, Romania
*
Author to whom correspondence should be addressed.

Abstract

Reliable and computationally efficient visual perception is essential for autonomous systems operating in complex livestock barns, where animals and operational objects must be accurately identified under variable illumination and occlusion conditions. This study developed BarnSeg-ECA-Lite, a lightweight instance segmentation model for the simultaneous segmentation of Buffalo Heads, Feed, and Mineral Lick Blocks (MLBs) in real buffalo barn environments. The model was developed based on YOLOv8n-seg by incorporating P2-to-P3 feature assistance, Efficient Channel Attention (ECA), a lightweight neck with GhostConv operations, targeted resampling of challenging instances, and higher-resolution mask supervision. An original dataset of 1703 NoIR images was used for training, validation, and independent testing. BarnSeg-ECA-Lite achieved an mAP@0.50 of 0.9313, mAP@0.50:0.95 of 0.7988, and an F1-score of 0.9300, with 2.7276 million parameters, 10.1108 GFLOPs, 10.3 ms inference time, and 74 FPS. It also achieved mAP@0.50 values of 0.9177, 0.9299, and 0.9464 for Buffalo Head, Feed, and MLB, respectively. These results demonstrate a favorable balance between segmentation accuracy and computational efficiency, providing a practical computer-vision foundation for future livestock and barn-resource monitoring applications, including autonomous feed-pushing robots and intelligent livestock management systems.

1. Introduction

Precision Livestock Farming (PLF) has emerged as one of the most significant technological paradigms for improving the efficiency, sustainability, and welfare of modern livestock production through the integration of sensing technologies, artificial intelligence (AI), Internet of Things (IoT), robotics, and data-driven decision support systems [1,2]. Unlike conventional livestock management practices that rely heavily on manual observation and experience, PLF continuously acquires and analyzes real-time information from individual animals and their surrounding environment, enabling early detection of health disorders, optimization of feeding strategies, improved reproductive management, and enhanced animal welfare [3,4]. The rapid expansion of commercial dairy and buffalo farms, together with increasing labor shortages and rising production costs, has further accelerated the adoption of intelligent robotic systems capable of performing repetitive and labor-intensive tasks with minimal human intervention [5]. Autonomous service robots have become increasingly attractive for applications such as feed pushing, feed delivery, barn inspection, cleaning, and animal monitoring, where continuous operation and reliable environmental perception are essential for improving productivity and operational efficiency. Emerging studies have emphasized that future livestock production will increasingly rely on the seamless integration of robotics, artificial intelligence, and advanced perception technologies to achieve fully autonomous and data-driven farm management [6,7]. Nevertheless, the practical deployment of intelligent robotic systems in commercial barns remains challenging because these robots must accurately perceive dynamic environments, interact safely with animals, and make reliable decisions under highly variable operating conditions. Therefore, robust environmental perception has become one of the fundamental requirements for next-generation autonomous livestock robots and represents a key enabling technology for intelligent barn automation.
Computer vision has become one of the most widely adopted sensing technologies in Precision Livestock Farming due to its ability to provide continuous, non-invasive, and automated monitoring of animals and barn environments. Recent advances in deep learning have enabled vision-based systems to support a wide range of livestock management applications, including individual animal identification, feeding behavior analysis, body condition scoring, lameness detection, weight estimation, estrus detection, and health assessment. These systems have demonstrated considerable potential for improving production efficiency while simultaneously reducing labor requirements and minimizing animal stress through continuous visual monitoring [8,9]. In dairy farming, computer vision has been successfully employed to quantify feeding and rumination behavior, monitor body posture and locomotion, estimate body condition scores, and detect diseases such as mastitis and lameness at an early stage [10,11]. Similarly, vision-based approaches have been developed for swine, sheep, and poultry production to automatically detect individuals, analyze social interactions, recognize abnormal behaviors, and estimate growth performance under commercial farming conditions [12,13,14]. Recent reviews further indicate that deep learning has shifted livestock monitoring from simple image classification and object detection toward comprehensive scene understanding, enabling more reliable and automated decision support in commercial farms [15,16]. Despite these advances, most existing studies primarily focus on animal-centered monitoring, whereas relatively limited attention has been devoted to the simultaneous perception of animals and operational barn objects required for autonomous robotic applications, such as feed piles, mineral lick blocks, and feeding infrastructure. Consequently, vision systems capable of accurately interpreting both livestock and surrounding environmental objects are becoming increasingly important for the next generation of intelligent service robots operating in complex barn environments.
The rapid evolution of deep learning has significantly advanced image understanding capabilities, leading to the widespread adoption of instance segmentation in agricultural computer vision. Unlike conventional object detection methods that localize objects using rectangular bounding boxes, instance segmentation simultaneously predicts object classes and pixel-level masks, enabling precise delineation of individual objects even in highly cluttered and overlapping scenes. This fine-grained representation is particularly advantageous for agricultural and livestock applications, where irregular object shapes, partial occlusions, and complex backgrounds frequently reduce the effectiveness of bounding-box-based detectors [17,18].
Early instance segmentation frameworks were dominated by two-stage architectures such as Mask R-CNN, which achieved high segmentation accuracy by extending the Faster R-CNN framework with an additional mask prediction branch [19]. Subsequently, several one-stage approaches, including YOLACT, SOLO, CondInst, and BlendMask, were introduced to improve inference speed while maintaining competitive segmentation performance. More recently, the integration of segmentation capabilities into the YOLO family has attracted considerable attention because these models offer an effective balance between accuracy and computational efficiency, making them suitable for real-time applications on resource-constrained platforms [20,21,22]. YOLOv8-seg has become one of the most widely adopted one-stage instance segmentation frameworks owing to its anchor-free detection strategy, decoupled prediction head, and efficient feature aggregation architecture.
Instance segmentation has been successfully applied to numerous agricultural problems, including fruit counting and harvesting, weed identification, crop disease analysis, plant phenotyping, and agricultural robotic perception. However, its application in livestock production remains comparatively limited. Existing studies have primarily focused on the segmentation of animals for behavior recognition, body measurement, or welfare assessment, whereas relatively few investigations have addressed simultaneous segmentation of animals and surrounding operational objects within barn environments. Furthermore, many published studies emphasize segmentation accuracy while providing limited analysis of computational complexity, model efficiency, or deployment feasibility on embedded robotic platforms [23,24].
Another emerging trend is the incorporation of attention mechanisms and feature enhancement strategies to improve segmentation performance for small and partially occluded objects. Several studies have demonstrated that attention modules can effectively strengthen informative feature channels while suppressing background noise, thereby improving localization accuracy in visually complex environments [25]. Similarly, multiscale feature fusion strategies have been shown to enhance the detection of small targets that are often overlooked by conventional feature pyramid structures. Despite these advances, existing segmentation architectures are generally developed and evaluated using public benchmark datasets that differ substantially from practical barn environments, where severe illumination variations, heterogeneous object appearances, feed deformation, and frequent animal occlusions remain significant challenges [26]. Current instance segmentation methods have established a solid foundation for intelligent agricultural perception. Nevertheless, there remains a clear need for lightweight and robust segmentation architectures specifically optimized for livestock environments, capable of simultaneously recognizing animals and operational barn objects while maintaining high inference speed and low computational cost on embedded robotic systems [27]. These requirements provide the technological motivation for the lightweight attention-enhanced architecture proposed in this study.
The increasing adoption of autonomous robots in livestock production has created a growing demand for vision models capable of delivering accurate perception while operating under the limited computational resources of embedded hardware. Unlike desktop GPU platforms, edge computing devices commonly used in agricultural robots provide restricted processing power, memory capacity, and energy availability, making the direct deployment of large deep neural networks impractical for real-time applications [28,29]. Consequently, recent research has increasingly focused on the development of lightweight deep learning architectures that achieve an effective balance between prediction accuracy, inference speed, and computational efficiency. To meet these requirements, numerous studies have explored network optimization strategies, including efficient convolutional operations, lightweight backbone networks, feature aggregation methods, model compression, pruning, quantization, and attention mechanisms. These approaches aim to reduce the computational burden while preserving discriminative feature representations, particularly for small or partially occluded objects that frequently appear in agricultural environments [30,31,32]. Recent reviews have further emphasized that lightweight architectures are becoming increasingly important for agricultural robotic systems because real-time environmental perception is essential for autonomous navigation, object interaction, and task execution under continuously changing field and barn conditions [33].
Despite these advances, the deployment of lightweight instance segmentation models in livestock environments remains relatively limited. Most existing studies have evaluated computationally efficient architectures using public benchmark datasets or crop-related applications, whereas comparatively few have investigated their performance under the challenging visual conditions encountered in commercial barns [34]. Furthermore, the simultaneous segmentation of animals and operational barn objects has received little attention, despite its importance for autonomous service robots that must safely interact with both livestock and their surroundings [35]. These observations indicate that further research is required to develop lightweight perception frameworks that simultaneously provide high segmentation accuracy, computational efficiency, and robust real-time performance on embedded robotic platforms, thereby motivating the architectural design proposed in this study.
Therefore, this study aims to develop and experimentally evaluate BarnSeg-ECA-Lite, a lightweight instance segmentation model for the simultaneous segmentation of buffalo heads, feed, and mineral lick blocks (MLBs) in real buffalo barn environments. The model is designed to improve segmentation accuracy while maintaining low computational complexity and real-time inference capability for future intelligent livestock monitoring and autonomous robotic applications. The study hypothesizes that integrating lightweight attention, enhanced multi-scale feature representation, targeted resampling, and higher-resolution mask supervision into a compact segmentation architecture can improve segmentation performance while preserving computational efficiency compared with existing lightweight instance segmentation models. This hypothesis is evaluated through quantitative comparisons with established YOLO-based segmentation models and ablation experiments. Accordingly, the main scientific contribution of this study is the development and experimental analysis of a task-oriented lightweight neck design that jointly addresses the heterogeneous scale and boundary characteristics of animal and barn-resource classes within a single instance segmentation framework.

2. Materials and Methods

2.1. Barn Image Dataset Development

In this study, an original image dataset was developed for the instance segmentation of the Feed, Buffalo Head, and Mineral Lick Block (MLB) classes under real barn conditions. The dataset development process consisted of image acquisition during different feeding periods, polygon-based annotation using the SAM 3-assisted Smart Polygon tool (Roboflow, Inc., San Francisco, CA, USA), image preprocessing, the creation of training, validation, and test subsets, and the examination of object-scale and illumination variability within the dataset. The overall workflow of the dataset development process is presented in Figure 1.
Figure 1. The development process of the barn image dataset.

2.1.1. Study Site and Acquisition Conditions

The images were acquired on 8 and 12 July 2026 in the buffalo barn operated by the Burdur Mehmet Akif Ersoy University Agricultural, Livestock, and Food Research Application and Research Center. A total of 42 buffaloes were present in the barn during the image acquisition studies. According to information provided by the farm personnel, feed was distributed once a day at approximately 10:00. Therefore, the images were recorded at 10:00, 13:00, and 16:00 to represent different conditions before and after feeding. This ensured the inclusion of variable scenes in the dataset in terms of feed quantity, feed distribution within the feeding area, the animals’ approach to the feed barrier, and ambient illumination. The feed was distributed along the feeding alley at a distance of approximately 50 cm from the feed barrier. No automated or mechanized feeding system was used in the experimental barn. Feed distribution was performed manually by farm personnel along the feeding alley. Therefore, the image acquisition process represented the existing manual feeding conditions of the farm. Although the data were collected under manual feeding conditions, the developed segmentation framework is intended to support future automated or semi-automated feed-management systems operating along the feeding alley. Three target classes were defined in the dataset: Feed (Figure 2a), Buffalo Head (Figure 2b), and MLB (Figure 2c).
Figure 2. Sample images of the classes defined in the dataset: (a) Feed. (b) Buffalo Head. (c) MLB.

2.1.2. Image Acquisition Device and Procedure

A Raspberry Pi 5-based dual-camera data acquisition device was developed to enable portable and controlled image collection in the barn environment. A Raspberry Pi 5 single-board computer equipped with 16 GB of LPDDR4X memory (Raspberry Pi Ltd., Cambridge, UK) was used as the main processing unit of the device. Image acquisition was performed using a standard Camera Module 3 and a Camera Module 3 NoIR (Raspberry Pi Ltd., Cambridge, UK). Both cameras are equipped with an 11.9 MP Sony IMX708 image sensor (Sony Semiconductor Solutions Corporation, Atsugi, Japan). The standard camera was connected to the CAM/DISP1 port of the Raspberry Pi 5, whereas the NoIR camera was connected to the CAM/DISP0 port via MIPI CSI-2 ribbon cables. A 1.5-inch RGB OLED display module with a resolution of 128 × 128 pixels and support for 65K RGB colors (1.5 inch RGB OLED Module, Waveshare Electronics, Shenzhen, China) was used to monitor the device status and the image captured by the active camera. The display, equipped with an SSD1351 driver chip, was connected to the Raspberry Pi 5 through a four-wire SPI interface. A Raspberry Pi Active Cooler (Raspberry Pi Ltd., Cambridge, UK) was used to maintain a stable processor temperature during operation. The system was powered by a portable power supply with a capacity of 10,000 mAh and a 33 W USB-C output (Baseus, Shenzhen, China). A GPIO-connected momentary push button was used to control photo and video recording, and all electronic components were housed in a custom-designed enclosure manufactured using a three-dimensional printer.
The front and rear views of the developed device, together with its field use in the barn environment, are shown in Figure 3. When the system was powered on, the image captured by the active camera was displayed in real time on the RGB OLED screen. A single short press of the control button captured a photograph, two consecutive short presses switched between the RGB and NoIR cameras, and a long press started or stopped video recording. Photographs and videos were stored in separate folders according to the active camera type and were assigned time-stamped file names. The operational workflow of the device is summarized in Algorithm 1. Owing to the low and spatially non-uniform illumination conditions inside the barn, images recorded using the NoIR camera were used to construct the final dataset. RGB images were recorded for field monitoring and comparative imaging purposes; however, they were not included in the training, validation, or test subsets.
Algorithm 1. Operational workflow of the dual-camera data acquisition device
1. Initialize Raspberry Pi 5, RGB/NoIR cameras, SPI display, and GPIO.
2. Set ActiveCamera ← RGB and Recording ← false.
3. while the device is active do
4. Display the live stream from ActiveCamera.
5. if a short press is detected then capture and save an image.
6. else if a double press is detected then switch ActiveCamera.
7. else if a long press is detected then toggle video recording.
8. end if
9. end while
Figure 3. The developed dual-camera data acquisition device: (A) Front view. (B) Rear view. (C) Field use in the buffalo barn.

2.1.3. SAM 3-Assisted Smart Polygon Annotation and Dataset Preparation

The NoIR images included in the dataset were uploaded to the Roboflow Annotate online annotation platform (Roboflow, Inc., San Francisco, CA, USA) and annotated in instance segmentation format. The annotation process was performed using the Smart Select (Smart Polygon) tool supported by Segment Anything Model 3 (SAM 3). In this tool, the target objects were selected using point-based prompts, and initial segmentation masks representing the object boundaries were generated automatically. The Roboflow Smart Select tool generates SAM 3-based segmentation masks from point prompts provided on the image. All automatically generated masks were visually inspected. Regions extending beyond the target object were removed, incompletely segmented areas were expanded, and polygon vertices were manually corrected when necessary. Each spatially separated feed region, each visible buffalo head, and each MLB were annotated as separate instances. Thus, the SAM 3-assisted semi-automatic annotation process was combined with manual quality control to create the final reference masks. Representative NoIR images and their corresponding final segmentation masks are presented in Figure 4.
Figure 4. Representative NoIR images and their corresponding reference segmentation masks: (A) Original images. (B) Final masks obtained after SAM 3-assisted Smart Polygon annotation.
The original images were recorded at a resolution of 1280 × 1280 pixels and resized to 640 × 640 pixels to ensure compatibility with the model input size. No data augmentation was applied to the dataset. The final dataset consisted of a total of 1703 images, of which 1193 were allocated to the training subset, 340 to the validation subset, and 170 to the test subset. This distribution corresponded to 70%, 20%, and 10%, respectively. As a result of the annotation process, a total of 1539 Feed, 2231 Buffalo Head, and 1132 MLB instances were obtained. The numbers of images and instances, image resolutions, and annotation characteristics of the dataset are summarized in Table 1.
Table 1. Dataset characteristics.

2.1.4. Dataset Characteristics and Variability Analysis

Prior to model training, object-scale and illumination variability within the dataset were quantitatively examined. To determine object scale, the polygon area of each annotated instance was divided by the total pixel area of the corresponding image. The normalized area ratio was calculated as: A n o r m = A p o l y g o n A i m a g e . The area distributions of the classes were evaluated using box plots with a logarithmic vertical axis to enable the pronounced size differences among the classes to be compared within the same graph.
As shown in Figure 5A, Feed instances occupied the largest areas within the images, whereas MLB instances generally represented the smallest targets. The normalized areas of the Buffalo Head instances were distributed between those of the other two classes. This difference among the classes indicates that the dataset contains substantial scale variability, with both small and large objects occurring together. To evaluate illumination variability, each image was converted to grayscale, and the mean grayscale intensity of all pixels in the image was calculated. The distribution of the resulting values was examined using a histogram. As shown in Figure 5B, most images were concentrated within the approximate range of 118–133, whereas images with higher brightness values occurred less frequently. This distribution demonstrates that the images exhibited variable brightness levels because of the different acquisition times and the spatially non-uniform natural illumination conditions within the barn.
Figure 5. Dataset variability analysis: (A) Distribution of normalized polygon areas by class. (B) Distribution of the mean grayscale intensity of the images.

2.2. Improved Instance Segmentation Model

2.2.1. YOLOv8n-Seg Model

YOLOv8 [36], introduced by Ultralytics in January 2023, provides a unified framework for image classification, object detection, pose estimation, and instance segmentation. Although its general design evolved from the YOLOv5 family, YOLOv8 incorporates architectural concepts associated with more recent detectors, including YOLOX, YOLOv6, and YOLOv7, while introducing substantial revisions to its layer and block structures [37]. For instance segmentation, YOLOv8-seg supplements the detection head with mask-coefficient prediction and employs a fully convolutional Proto branch to generate prototype masks for pixel-level instance delineation [38]. The architecture is offered at multiple scales, from the lightweight nano variant to larger configurations. While increasing model size may improve predictive performance, it also raises parameter count, computational demand, and inference latency, which can limit deployment on edge platforms [39]. Accordingly, the nano variants of all benchmark models were trained under identical conditions to ensure a consistent comparison of lightweight instance segmentation performance. YOLO11n-seg and YOLO26n-seg were included as more recent nano-scale models from the Ultralytics YOLO family [40,41], allowing the proposed model to be compared with different generations of lightweight YOLO-based segmentation architectures. Since YOLOv8n-seg produced the strongest overall baseline segmentation results, it was selected as the foundation for the proposed architectural and training modifications. The resulting BarnSeg-ECA-Lite model is presented in the following section.

2.2.2. Proposed BarnSeg-ECA-Lite Model

The proposed BarnSeg-ECA-Lite model was developed based on YOLOv8n-seg to improve the instance segmentation of objects exhibiting substantial variations in scale, appearance, illumination, and boundary structure represented in the collected buffalo-barn dataset. The original YOLOv8n backbone and segmentation-head formulation were retained, whereas the neck was redesigned by incorporating a P2-to-P3 feature-assistance branch, Efficient Channel Attention (ECA) modules, GhostConv-based downsampling operations, and a reduced neck-channel configuration. The overall architecture of the proposed model is presented in Figure 6. The architectural modifications were motivated by the heterogeneous visual characteristics of the three target classes. In the collected dataset, Feed generally forms large and irregular regions, Buffalo Heads represent medium-scale and frequently partially visible or moving targets, whereas MLBs are typically small objects occupying a limited image area. Although the standard YOLOv8n-seg architecture provided a strong baseline, its conventional P3–P5 feature aggregation structure was not specifically designed to jointly address these markedly different scale and boundary characteristics. Therefore, the proposed design introduces high-resolution P2 information into the P3 pathway to strengthen fine-detail representation, applies ECA selectively at the P3 and P4 levels to recalibrate informative channel responses after multiscale fusion, and employs GhostConv-based downsampling together with reduced neck-channel widths to limit the additional computational burden. Thus, the proposed architecture was designed as a task-oriented modification of YOLOv8n-seg rather than as a replacement of its backbone or segmentation head.
Figure 6. Overall architecture of the proposed BarnSeg-ECA-Lite model: (a) retained YOLOv8n backbone; (b) modified neck incorporating the top-down pathway, P2-to-P3 feature assistance, ECA modules at the P3 and P4 levels, GhostConv-based bottom-up downsampling, and reduced neck-channel configuration; and (c) retained YOLOv8 segmentation head receiving the final P3, P4, and P5 feature maps. Gray blocks represent components retained from YOLOv8n-seg, whereas the colored blocks and outlines highlight the architectural modifications introduced in BarnSeg-ECA-Lite. Tensor dimensions are reported as C × H × W.
In the top-down pathway, the SPPF-enhanced P5 feature map is first upsampled and concatenated with the corresponding P4 backbone feature. The resulting representation is processed by a C2f block with 448 nominal output channels. It is then upsampled again, concatenated with the P3 backbone feature, and processed by a C2f block with 192 nominal output channels. To preserve fine spatial information associated with small MLB instances and partially visible buffalo heads, an additional feature-assistance branch was introduced from P2 to P3. In this branch, the high-resolution P2 feature map is downsampled using a stride-2 GhostConv operation and concatenated with the top-down P3 representation. The fused feature map is subsequently processed by a C2f block and an ECA module with a fixed kernel size of k = 3, producing the final P3 output.
In the bottom-up pathway, the ECA-recalibrated P3 output is downsampled using a stride-2 GhostConv operation and concatenated with the earlier top-down P4 representation. Following C2f-based feature fusion, a second ECA module with k = 3 is applied to generate the final P4 output. The final P4 feature is then downsampled using another stride-2 GhostConv operation and concatenated with the SPPF-derived P5 feature. A final C2f block produces the P5 output without an additional ECA module. The nominal channel widths of the final P3, P4, and P5 outputs are 192, 448, and 768, respectively, corresponding to 48, 112, and 192 effective channels after YOLOv8n nano scaling.
The final P3, P4, and P5 feature maps, corresponding to layers 19, 23, and 26, respectively, are jointly supplied to the YOLOv8 Segment head (layer 27). Their effective tensor dimensions are 48 × 80 × 80, 112 × 40 × 40, and 192 × 20 × 20, respectively. The Segment head is configured for three target classes, 32 mask coefficients, and 256 prototype channels to generate class predictions, bounding boxes, and instance masks.
The principal components introduced into the modified neck, namely ECA and GhostConv, are described in detail below.
Efficient Channel Attention was originally introduced as a lightweight channel-recalibration mechanism capable of modeling local cross-channel dependencies without reducing channel dimensionality [42]. Unlike squeeze-and-excitation approaches that employ fully connected bottleneck layers, ECA calculates channel weights by combining global average pooling with a lightweight one-dimensional convolution. This structure preserves direct correspondence between input and output channels while introducing limited computational overhead. ECA has subsequently been incorporated into YOLO-based architectures to strengthen target-related features and suppress background interference in visually complex and low-contrast scenes [43,44].
For an input feature map X = X c c = 1 C , where X c ∈ R H × W , global average pooling aggregates the spatial response of each channel. The resulting channel descriptor is calculated according to Equation (1):
Z c = 1 H W ∑ i = 1 H ∑ j = 1 W X c i , j
Here, H , W , and C denote the height, width, and number of channels of the input feature map, respectively. As expressed in Equation (1), global average pooling converts the spatial feature representation into a 1 × 1 × C channel descriptor without reducing the number of channels. Local cross-channel interactions are subsequently modeled using a one-dimensional convolution followed by sigmoid activation. The channel attention weights are obtained using Equation (2):
α = σ C o n v 1 D k z
where α denotes the channel attention weights, σ(⋅) represents the sigmoid function, and k is the kernel size of the one-dimensional convolution. Although the original ECA formulation permits adaptive kernel-size selection according to the number of channels, a fixed kernel size of k = 3 was used in BarnSeg-ECA-Lite. The channel-recalibrated output is then obtained through element-wise multiplication, as given in Equation (3):
X ^ c = α c X c
where X ^ c represents the recalibrated output of channel c . Through Equation (3), channels containing discriminative information are strengthened, whereas less relevant responses are suppressed. This mechanism is particularly suitable for complex barn scenes in which feed regions, buffalo heads, mineral lick blocks, the barn floor, feeding barriers, and structural components may exhibit similar visual characteristics.
In BarnSeg-ECA-Lite, ECA modules with k = 3 were placed after the final C2f fusion blocks at the P3 and P4 levels. The first ECA module recalibrates the P3 feature obtained by combining the top-down P3 representation with the GhostConv-downsampled P2 feature. The second ECA module is applied after the recalibrated P3 feature is downsampled and fused with the corresponding top-down P4 representation. No ECA module is used in the P5 branch. The overall ECA process and the global average pooling operation are illustrated in Figure 7a and Figure 7b, respectively.
Figure 7. Efficient Channel Attention mechanism used in BarnSeg-ECA-Lite: (a) Overall ECA operation comprising global average pooling, one-dimensional convolution with k = 3 , sigmoid activation, and channel-wise multiplication. (b) Global average pooling used to transform an H × W × C feature map into a 1 × 1 × C channel descriptor.
To reduce the computational cost introduced by the additional multiscale fusion paths, GhostConv operations were selectively employed in the modified neck. GhostConv, originally introduced in GhostNet, generates output feature maps through a two-stage process [45]. First, a limited set of intrinsic feature maps is generated using conventional convolution. These intrinsic feature maps are subsequently expanded through inexpensive linear transformations to produce additional ghost feature maps [46]. The intrinsic and ghost feature maps are then concatenated to form the final output. Through this mechanism, GhostConv reduces the number of conventional convolution operations while preserving useful feature representations [47,48].
Replacing all conventional convolution layers in the backbone with GhostConv may weaken the representational capacity of the network because only a subset of the output features is directly generated through conventional convolution. Therefore, the original YOLOv8n backbone was retained in BarnSeg-ECA-Lite. GhostConv was employed only in the P2-to-P3 feature-assistance branch and in the P3-to-P4 and P4-to-P5 bottom-up downsampling paths. All three GhostConv operations use a stride of 2, allowing spatial resolution to be reduced while controlling the computational cost of multiscale feature aggregation. The working principles of conventional convolution and GhostConv are comparatively illustrated in Figure 8.
Figure 8. Schematic comparison of conventional convolution and GhostConv: (a) Feature generation using conventional convolution. (b) Generation of intrinsic and ghost feature maps through conventional convolution and inexpensive linear operations.

2.3. Experimental Environment and Parameters

Model development, training, and evaluation were performed on the Google Colab cloud platform (Google LLC, Mountain View, CA, USA) using Python 3.10 (Python Software Foundation, Beaverton, OR, USA) and the PyTorch 2.4.0 deep learning framework (PyTorch Foundation, Linux Foundation, Wilmington, DE, USA). The cloud environment was accessed through a 2014 Apple Mac Mini computer (Apple Inc., Cupertino, CA, USA) running the Ubuntu 22.04.5 operating system (Canonical Group Limited, London, UK). Model training was conducted on an NVIDIA Tesla A100 graphics processing unit with 40 GB of memory (NVIDIA Corporation, Santa Clara, CA, USA). The hardware and software components used in the experiments are presented in Table 2.
Table 2. Hardware and software configuration used in the experiments.
All baseline models and the developed BarnSeg-ECA-Lite model were trained using the same core hyperparameters to ensure a fair comparison. The input image size was set to 640 × 640 pixels, the maximum number of training epochs to 100, and the batch size to 8. The AdamW optimizer with an initial learning rate of 0.001 was used for optimization, and the learning rate was reduced using a cosine annealing schedule. Mixed-precision training was enabled, and the random seed was set to 42 to ensure the reproducibility of the experiments. The main hyperparameters used for model training are presented in Table 3.
Table 3. Main hyperparameters used for model training.

2.4. Model Evaluation Indicators

Model performance was evaluated on the independent test set using precision ( P ), recall ( R ), mean Average Precision at an Intersection over Union (IoU) threshold of 0.50 ( m A P @ 0.50 ), and mean Average Precision averaged over IoU thresholds ranging from 0.50 to 0.95 ( m A P @ 0.50 : 0.95 ). Since this study addressed instance segmentation, these metrics were calculated separately for bounding boxes and segmentation masks according to the COCO-style evaluation protocol. The Ultralytics 8.4.96 validation framework reports box- and mask-based precision, recall, m A P @ 0.5 0, and m A P @ 0.50 : 0.95 values. For each class, Average Precision (AP) represents the area under the precision–recall curve. The m A P @ 0.50 n value was calculated by averaging the class-specific AP values at an IoU threshold of 0.50, as expressed in Equation (4):
m A P @ 0.50 = 1 n c ∫ 0 1 P R d R
where n c denotes the number of classes, i represents the class index, and P i , 0.50 R is the precision–recall function of class i at an IoU threshold of 0.50.
The more stringent m A P @ 0.50 : 0.95 metric was calculated as the average of the mAP values obtained at ten IoU thresholds ranging from 0.50 to 0.95 in increments of 0.05, as given in Equation (5):
m A P @ 0.50 : 0.95 = a v g m A P i , i = 0.5 : 0.05 : 0.95
Precision and recall were calculated using Equations (6) and (7), respectively:
P = T P T P + F P
R = T P T P + F N
Here, T P denotes a prediction correctly matched to a ground-truth instance with the correct class and an IoU value equal to or greater than the specified threshold. F P represents an unmatched or incorrectly classified prediction, whereas F N represents a ground-truth instance that was not detected. For bounding-box evaluation, IoU was calculated between the predicted and reference boxes, whereas mask IoU was used for segmentation evaluation. Higher precision indicates fewer false-positive predictions, whereas higher recall indicates fewer missed instances. The m A P @ 0.50 : 0.95 metric provides a stricter assessment of localization and segmentation quality across multiple IoU thresholds.

2.5. Statistical Analysis

The statistical procedures were implemented in Python 3.10 using the NumPy 1.26.4, SciPy 1.11.4, scikit-learn 1.2.2, and statsmodels 0.14.1 libraries. To quantify the uncertainty associated with the performance differences between YOLOv8n-seg and BarnSeg-ECA-Lite, a paired non-parametric bootstrap analysis with 1000 resampling iterations was conducted on the independent test set. Resampling was performed at the image level with replacement, and identical resampled image indices were used for both models to preserve the paired structure of the comparison. For each bootstrap replicate, mask mAP@0.50 and mAP@0.50:0.95 were recalculated, and the paired performance difference was defined as BarnSeg-ECA-Lite minus YOLOv8n-seg. Percentile-based 95% confidence intervals (CIs) were obtained from the 2.5th and 97.5th percentiles of the bootstrap distributions. Empirical two-sided p-values were calculated by centering each bootstrap distribution at zero by subtracting the observed performance difference from each bootstrap replicate and determining the proportion of null-centered values with an absolute magnitude equal to or greater than the observed difference. A p-value < 0.05 was considered statistically significant.

3. Experimental Results

This section presents the experimental results of the baseline segmentation models and the models developed based on YOLOv8n-seg. The models were compared in terms of training convergence, overall and class-wise segmentation performance, the precision–recall balance, model complexity, and inference speed. In addition, the contributions of the architectural modules incorporated into the proposed BarnSeg-ECA-Lite model were evaluated through an ablation analysis, and the decision regions of the models were examined using the XGrad-CAM method.

3.1. Training Convergence and Stability

Figure 9 presents the training convergence and validation stability of the compared segmentation models using four different performance indicators. The validation mask mAP@0.50 curves shown in Figure 9A indicate that the models learned rapidly, particularly within the first 10–20 epochs and subsequently reached a stable performance level above approximately 0.90. When the final 20 epochs were examined, only limited fluctuations were observed in most models, while BarnSeg-ECA-Lite produced one of the highest and most stable mAP@0.50 values. In the mask mAP@0.50:0.95 curves presented in Figure 9B, convergence occurred more gradually because of the stricter IoU thresholds. Most models stabilized within the approximate range of 0.79–0.81 during the final epochs, whereas YOLO26n-seg and BarnSeg-ECA-Lite-Arch yielded lower results than the other models. The mask F1-score curves presented in Figure 9C show that the balance between precision and recall improved throughout training and that most models achieved stable F1-scores above 0.92 during the final epochs. In this panel, BarnSeg-ECA-Lite also exhibited high and balanced performance, whereas YOLO26n-seg remained at a lower level. The training segmentation loss curves shown in Figure 9D demonstrate that the loss values decreased consistently with increasing epoch number for all models and reached a stable level during the final stage of training. In particular, the limited fluctuations observed over the final 20 epochs indicate that no pronounced divergence or late-stage instability occurred in the models. Overall, when Figure 9A–D is evaluated collectively, the models can be seen to have converged successfully, their validation performance stabilized, and the training process was completed in a controlled manner.
Figure 9. Training convergence and validation stability of the compared segmentation models: (A) Validation mask mAP@0.50 curves. (B) Validation mask mAP@0.50:0.95 curves. (C) Validation mask F1-score curves. (D) Training segmentation loss curves. Insets show the last 20 epochs.

3.2. Overall Instance Segmentation Performance

The quantitative performance results of the evaluated instance segmentation models are presented in Table 4. The BarnSeg-ECA-Lite model achieved the best overall performance, with an mAP@0.50 of 0.9313, an mAP@0.50:0.95 of 0.7988, and an F1-score of 0.9300. The highest precision value, 0.9651, was obtained by the BarnSeg-P2Lite-ECA model, whereas the highest recall value, 0.9094, was recorded for the BarnSeg-P2Lite model. The precision and recall values of BarnSeg-ECA-Lite were 0.9625 and 0.8997, respectively, indicating a balanced performance between these two metrics. In addition, BarnSeg-ECA-Lite slightly outperformed YOLOv8n-seg in terms of F1-score and achieved higher results than all compared models for both mAP@0.50 and mAP@0.50:0.95. In contrast, the YOLO26n-seg model exhibited the lowest overall performance, with an mAP@0.50 of 0.9039, an mAP@0.50:0.95 of 0.7818, and an F1-score of 0.8892.
Table 4. Quantitative comparison of the overall instance segmentation performance of the evaluated models on the test set.
The paired bootstrap analysis showed that BarnSeg-ECA-Lite achieved positive performance differences relative to YOLOv8n-seg for both segmentation metrics. For mask mAP@0.50, the observed difference was 0.0055, while the mean bootstrap difference was 0.0058, with a 95% confidence interval of −0.0020 to 0.0135 and an empirical two-sided p-value of 0.154. For mask mAP@0.50:0.95, the observed difference was 0.0084 and the mean bootstrap difference was 0.0093, with a 95% confidence interval of −0.0008 to 0.0198 and a p-value of 0.123. BarnSeg-ECA-Lite yielded higher performance than YOLOv8n-seg in 93.0% and 96.5% of the bootstrap resamples for mAP@0.50 and mAP@0.50:0.95, respectively. Although the numerical differences consistently favored BarnSeg-ECA-Lite, neither comparison reached the predefined statistical significance threshold of p < 0.05.

3.3. Class-Wise Segmentation Performance

The class-wise mask segmentation results are presented in Table 5. The BarnSeg-ECA-Lite model achieved the highest result for the Buffalo Head class, with an mAP@0.50 of 0.9177, outperforming YOLOv8n-seg by 1.02 percentage points. For the Feed class, it also demonstrated the best performance among all compared models, with an mAP@0.50 of 0.9299 and an mAP@0.50:0.95 of 0.8778. For the MLB class, the highest mAP@0.50 value, 0.9464, was achieved by BarnSeg-ECA-Lite, whereas the highest mAP@0.50:0.95 value, 0.7859, was obtained by YOLO11n-seg. The mAP@0.50:0.95 value of BarnSeg-ECA-Lite for the MLB class was 0.7814, remaining very close to the best result. Overall, the results indicate that the proposed model provided stronger segmentation performance, particularly for the Buffalo Head and Feed classes, while maintaining competitive performance for the MLB class.
Table 5. Class-wise mask mAP performance of the evaluated instance segmentation models.

3.4. Computational Complexity and Inference Efficiency

The results related to the computational complexity and inference performance of the models are presented in Table 6. Although YOLO26n-seg had the lowest computational complexity among the compared models, with 2.6895 million parameters and 8.9615 GFLOPs, it exhibited the lowest operating speed, with an inference time of 14.1 ms and 60 FPS. YOLOv8n-seg achieved the highest inference speed under the NVIDIA A100 evaluation environment, with an inference time of 9.4 ms and 82 FPS. The proposed BarnSeg-ECA-Lite model provided a compact architecture with 2.7276 million parameters, 10.1108 GFLOPs, and a model size of 5.4871 MB, while achieving an inference time of 10.3 ms and 74 FPS. Compared with BarnSeg-ECA-Lite-Arch, it achieved a lower inference time and a higher FPS despite having the same number of parameters, GFLOPs, and model size. Relative to YOLOv8n-seg, BarnSeg-ECA-Lite reduced the parameter count by approximately 16.3%, GFLOPs by approximately 10.9%, and model size by approximately 15.3%, although this was accompanied by a decrease in inference speed. Thus, the lightweight designation reflects reduced model complexity rather than a speed advantage under the NVIDIA A100 evaluation environment.
Table 6. Computational complexity, model size, and inference performance of the evaluated instance segmentation models.

3.5. Ablation Study

An incremental ablation study was conducted to quantify the individual contributions of the architectural and training components. YOLOv8n-seg was used as the baseline configuration (A0), and all variants were evaluated under identical dataset splits, input resolution, training schedule, and hardware conditions. The corresponding results are presented in Table 7. Introducing the P2-to-P3 feature-assistance mechanism in A1 increased mask recall from 0.8993 to 0.9094, indicating improved sensitivity to difficult and small target instances. However, this modification slightly increased the parameter count from 3.2586 M to 3.3017 M. Precision and mask mAP values decreased marginally, with mask mAP@0.50:0.95 changing from 0.7904 to 0.7898. These results indicate that the additional high-resolution feature information primarily reduced missed detections without producing a corresponding improvement in overall mask localization accuracy.
Table 7. Incremental ablation results of the proposed BarnSeg variants in terms of segmentation accuracy and computational efficiency on the test set.
The addition of ECA at the P3 and P4 levels in A2 increased precision to 0.9651, the highest value among the evaluated configurations. Mask mAP@0.50:0.95 also improved to 0.7959, while the parameter count remained at 3.3017 M. Compared with A1, this corresponds to a 0.61 percentage-point improvement in mask mAP@0.50:0.95. Nevertheless, recall decreased to 0.8866, suggesting that the ECA mechanism produced more selective feature responses but also resulted in more conservative predictions. The balanced neck slimming introduced in A3 reduced the parameter count from 3.3017 M to 2.7276 M. Although mask mAP@0.50 increased slightly to 0.9241, mask mAP@0.50:0.95 decreased to 0.7861, while the inference speed declined to 73 FPS. Thus, the neck modification substantially reduced model complexity but did not independently improve segmentation accuracy.
Finally, targeted resampling of difficult Buffalo Head and MLB images, together with reducing the mask downsampling ratio from 4 to 2, was applied in A4. This configuration achieved the highest mask mAP@0.50 and mask mAP@0.50:0.95 values of 0.9313 and 0.7988, respectively. Relative to the YOLOv8n-seg baseline, these results represent improvements of 0.55 and 0.84 percentage points. Precision remained nearly unchanged at 0.9625, while recall was maintained at a comparable level of 0.8997. The final configuration also preserved the reduced parameter count of 2.7276 M and achieved 74 FPS. Overall, the ablation results show that P2-to-P3 feature assistance primarily improved recall, ECA strengthened feature selectivity and mask localization, and balanced neck slimming reduced model complexity. The combination of targeted resampling and higher-resolution mask supervision produced the most accurate configuration. Consequently, BarnSeg-ECA-Lite was selected as the final model because it achieved the highest overall mask mAP values while maintaining a Precision–Recall profile comparable to the baseline. Compared with YOLOv8n-seg, the final model reduced the parameter count by approximately 16.3%, although its inference speed decreased from 82 to 74 FPS.

3.6. Qualitative Segmentation Results and XGrad-CAM Analysis

Figure 10 presents, respectively, the input images, the ground-truth reference masks (GT), and the prediction results of the YOLO26n-seg, YOLOv8n-seg, and BarnSeg-ECA-Lite models. In the first two examples, the abilities of the models to segment the Feed area and the Buffalo Head class under different imaging conditions are compared. While some feed masks in the YOLO26n-seg and YOLOv8n-seg models were observed to extend beyond the true object boundaries or exhibit irregularities in edge regions, BarnSeg-ECA-Lite produced more coherent results that were closer to the ground-truth reference masks. Although the small MLB objects in the third example were detected by all models, BarnSeg-ECA-Lite separated their locations and boundaries more consistently.
Figure 10. Qualitative comparison of the ground-truth masks and segmentation outputs produced by YOLO26n-seg, YOLOv8n-seg, and BarnSeg-ECA-Lite on selected test images.
The XGrad-CAM analysis conducted to examine the decision regions of the models is presented in Figure 11. In some examples, YOLO26n-seg and YOLOv8n-seg also produced activations in non-target background regions and barn structures, whereas BarnSeg-ECA-Lite generated more target-focused regions, particularly for the Buffalo Head class and small MLB objects. According to the quantitative results presented in Table 8, BarnSeg-ECA-Lite achieved the highest values, with a mean CAM energy of 0.1446 within the GT mask and a pointing-game accuracy of 0.5333. These results indicate that the proposed model focused on the actual target regions more consistently than the other models.
Figure 11. XGrad-CAM visualizations of YOLO26n-seg, YOLOv8n-seg, and BarnSeg-ECA-Lite for representative Buffalo Head, Feed, and MLB test images.
Table 8. Quantitative comparison of the XGrad-CAM localization performance of the selected models.

4. Discussion

4.1. Algorithmic Performance and Class-Wise Segmentation Dynamics

The real-time and reliable identification of barn components and livestock is a fundamental prerequisite for ensuring operational autonomy and occupational safety in precision livestock farming (PLF) systems [6]. The experimental findings indicate that BarnSeg-ECA-Lite achieved effective instance segmentation of feed regions, buffalo heads, and mineral lick blocks across the object-scale and illumination variations represented in the evaluated buffalo-barn dataset. The developed model achieved an overall mAP@0.50 of 0.9313 and an mAP@0.50:0.95 of 0.7988, demonstrating the highest overall segmentation performance among the compared lightweight models, including YOLOv8n-seg and YOLO11n-seg.
The class-wise analyses reveal one of the most critical achievements of this study. In computer vision studies reported in the literature, the detection of morphologically variable and moving objects has consistently yielded lower accuracy rates than the detection of stationary objects [15]. Consistent with this observation, the Buffalo Head class emerged as the most challenging category for all models in the present study, exhibiting the lowest mAP values. Nevertheless, BarnSeg-ECA-Lite achieved an mAP@0.50 of 0.9177 for this difficult class, providing a clear advantage over YOLO26n-seg, which achieved 0.8503. For feed regions, which are of critical importance for route optimization in autonomous feed-pushing robots, a high boundary delineation accuracy of 0.8778 mAP@0.50:0.95 was obtained under the stricter IoU criterion. This finding indicates that the model not only detected the presence of the objects but also provided detailed boundary information that may support future area- or geometry-based analyses.
Wang et al. [49] reported that their improved YOLOv8n-seg model achieved an mAP@0.50 of 0.9208 for sheep segmentation in complex farming environments. Similarly, Liao et al. [50] achieved reliable segmentation and detection performance in top-view images using the YOLOv8A-SD model developed for pig barns. In another study, Zhang et al. [18] demonstrated the effectiveness of adaptive receptive field-based feature extraction in complex livestock environments by achieving high-accuracy instance segmentation under occlusion conditions with their RF-GoatDet model developed for dairy goats. In contrast, rather than focusing solely on the instance segmentation of animals, the BarnSeg-ECA-Lite model developed in this study was able to simultaneously segment the Buffalo Head, Feed, and Mineral Lick Block classes, all of which are critical for the environmental perception of autonomous feed-pushing robots, within a single model. These results indicate that BarnSeg-ECA-Lite can simultaneously segment the three target categories within the multiclass buffalo barn scenes represented in the present dataset.

4.2. Contribution of Architectural Components and the Accuracy–Efficiency Trade-Off

The ablation results indicate the individual contributions of the modifications in-corporated into the model and illustrate how these components affected segmentation performance. The P2-to-P3 feature support mechanism integrated into the network neck (A1) increased mask recall from 0.8993 to 0.9094, enabling more successful detection of small or distant targets that tend to be overlooked in barn images, particularly MLB objects located in the background. This finding is consistent with previous studies reporting that multiscale feature extraction and high-resolution feature maps improve the representation capability for small objects [23,24,26,30]. However, the use of high-resolution feature maps alone may lead to certain trade-offs in localization accuracy. This limitation observed in our study was largely mitigated by the ECA mechanism integrated at the P3 and P4 levels (A2). The ECA module increased precision to 0.9651 while also improving mAP performance under the stricter IoU criterion. This result is consistent with previous studies reporting that channel attention mechanisms strengthen discriminative feature representations by emphasizing relevant features and suppressing redundant channel information [42]. In the final stage, the targeted resampling strategy designed to address class imbalance in the dataset, together with the reduction in the mask downsampling ratio (A4), maximized segmentation quality while maintaining the precision–recall balance. The paired bootstrap analysis further showed that the performance differences between BarnSeg-ECA-Lite and YOLOv8n-seg favored the proposed model numerically, but did not reach the predefined statistical significance threshold. The mean bootstrap differences were 0.0058 for mask mAP@0.50 and 0.0093 for mask mAP@0.50:0.95, with 95% confi-dence intervals of −0.0020 to 0.0135 and −0.0008 to 0.0198, respectively. Accordingly, these gains should be interpreted as modest numerical improvements within the evaluated test set rather than statistically confirmed superiority.
The methodological contribution of BarnSeg-ECA-Lite does not arise from introducing new attention or convolution operators individually. Instead, it lies in the task-oriented restructuring of the YOLOv8n-seg neck through the coordinated use of P2-to-P3 feature assistance, selectively placed ECA modules, GhostConv-based downsampling, and reduced neck-channel widths. This configuration was specifically designed to improve the representation of objects with different spatial scales and boundary characteristics in the barn environment while maintaining a lightweight model structure. Taken together, the results provide a practical design insight for lightweight livestock instance segmentation: increasing feature resolution alone does not necessarily improve overall segmentation accuracy, as demonstrated by the A1 configuration. Instead, high-resolution feature assistance needs to be combined with selective feature recalibration and controlled computational simplification. In the present task, the coordinated use of P2-assisted multiscale fusion, selective ECA placement, and neck slimming provided a more favorable balance between fine-detail representation and model complexity than any of these modifications applied independently.
From a computational-efficiency perspective, BarnSeg-ECA-Lite retained a compact architecture with 2.73 million parameters and a model size of 5.48 MB. Under the NVIDIA A100 evaluation environment used in this study, the model achieved an inference time of 10.3 ms and a processing speed of 74 FPS. These results indicate a favorable accuracy–complexity trade-off under the evaluated hardware conditions; however, they should not be interpreted as direct evidence of real-time performance on embedded edge hardware. This interpretation is consistent with recent studies emphasizing that lightweight deep learning models for agricultural robotics should be evaluated not only in terms of predictive accuracy, but also with respect to latency and computational efficiency on resource-constrained platforms [28,29].
Although BarnSeg-ECA-Lite reduced the parameter count and GFLOPs relative to YOLOv8n-seg, its inference speed decreased from 82 to 74 FPS. This result can be explained by the fact that actual inference throughput is determined not only by arithmetic complexity, but also by architectural factors such as feature-fusion operations, memory-access patterns, operator structure, and hardware-specific execution efficiency. In BarnSeg-ECA-Lite, the additional P2-to-P3 feature-assistance pathway, feature concatenations, ECA-based recalibration, and GhostConv operations may introduce execution overhead despite the lower overall computational complexity. A similar trend was also observed for YOLO26n-seg in the present study, which exhibited the lowest parameter count and GFLOPs but the lowest inference speed among the compared models. Similar behavior has been reported in other lightweight YOLO-based architectures. Wang et al. [51] reduced the parameters and GFLOPs of a YOLOv8n-based agricultural model while improving mAP, although its inference speed decreased from 238.1 to 227.3 FPS. Likewise, Liu et al. [52] reported that EVA-YOLOv8, incorporating GhostConv and multiscale attention, reduced model complexity while its inference speed decreased by 24 FPS relative to the original YOLOv8. These findings indicate that architectural lightweightness does not necessarily translate directly into higher inference throughput. Therefore, the proposed model should be interpreted as providing an accuracy–complexity trade-off rather than an inference-speed advantage.

4.3. Explainable Artificial Intelligence (XGrad-CAM) and Perceptual Reliability

The limited interpretability of deep learning models is considered one of the major challenges to the reliable deployment of autonomous systems in precision livestock farming, particularly in safety-critical barn environments where perception errors may directly affect robot navigation and animal safety [53,54]. The qualitative mask evaluations and XGrad-CAM visualizations conducted in this study transparently revealed the decision-making mechanism of the proposed model. The conventional YOLOv8n-seg and YOLO26n-seg models were observed to produce undesired activations in background regions such as concrete floors, metal feed barriers, and other structural elements, resulting in mask leakage along feed boundaries. In contrast, the proposed BarnSeg-ECA-Lite model effectively suppressed these irrelevant background activations and consistently concentrated its attention on the target objects, thereby exhibiting a more reliable perception mechanism under complex barn conditions.
These qualitative observations were also supported by the quantitative XGrad-CAM analyses. The proposed model achieved the highest values among all evaluated models, with a mean CAM energy of 0.1446 within the ground-truth mask and a pointing-game accuracy of 0.5333. A higher CAM energy indicates that the model’s attention was more densely concentrated within the reference mask and that fewer activations occurred in non-target regions. In addition, the higher pointing-game accuracy demonstrates that the strongest activation point of the model was generally located on the actual target object. These findings indicate that lightweight architectural improvements strengthened the model’s focus on discriminative semantic features while effectively suppressing background interference. Previous studies have demonstrated that explainable artificial intelligence (XAI) approaches make important contributions to understanding the internal decision-making mechanisms of deep learning models and increase trust in artificial intelligence systems in real-world applications [55,56]. From an application perspective, this reliable attention behavior is of considerable importance for autonomous barn robots. Reducing false activations on non-target surfaces may contribute to improved environmental perception, enhanced operational safety, and more robust autonomous decision-making mechanisms in feed management and animal monitoring processes. Therefore, the proposed BarnSeg-ECA-Lite framework not only improves segmentation accuracy but also provides a more transparent, reliable, and explainable perception infrastructure for future autonomous feed-pushing robots and intelligent precision livestock farming applications. From an operational perspective, XGrad-CAM visualizations can be used as a post hoc diagnostic tool to support operator oversight and error analysis rather than as a direct input to the robot control loop. By showing whether model attention is concentrated on the relevant target regions, these visualizations may help identify predictions influenced by irrelevant background structures and support the identification of failure cases, dataset refinement, and subsequent model retraining. However, XGrad-CAM does not provide causal explanations of model decisions, and the resulting activation maps may vary depending on the selected network layer and image characteristics. Moreover, CAM energy and pointing-game accuracy should be interpreted as localization-oriented explainability indicators rather than direct measures of prediction reliability. Therefore, the practical integration of XGrad-CAM into operator interfaces and automated error-detection workflows requires further validation.

4.4. Limitations of the Study and Future Work

Although the proposed BarnSeg-ECA-Lite model achieved competitive segmentation performance and reduced architectural complexity under the evaluated experimental conditions, several limitations should be considered before practical deployment.
Dataset and Environmental Condition Limitations: The dataset size was also considered in relation to comparable livestock instance segmentation studies. Guzhva et al. [57] trained a dairy-cattle Mask R-CNN segmentation model using 567 manually annotated images, whereas Zhang et al. [18] constructed a dairy-goat instance segmentation dataset containing 2288 images collected under different illumination conditions, herd densities, and behavioral states. Liao et al. [50] used 2985 training, 1512 validation, and 278 test images for pig instance segmentation. Thus, the 1703-image dataset used in the present study falls within the dataset-size range reported in selected livestock segmentation studies. In addition, the present dataset contains 4902 annotated instances across the three target classes and was divided into independent training, validation, and test subsets at a 70:20:10 ratio. Data acquisition was intentionally conducted at three feeding-related time points on two separate days to incorporate variations in feed distribution, animal position, object scale, and illumination. These design choices were intended to increase the variability represented within the available dataset. Nevertheless, dataset size alone does not guarantee broad generalizability, and the restriction to a single buffalo barn and two collection days remains an important limitation of the present study. Different barn designs, extreme air-quality conditions such as high dust concentrations, and scenarios involving dense clustering of multiple animals may also affect segmentation stability. Although the visual tasks addressed in this study are also relevant to dairy and beef cattle barns, differences in animal morphology, feeding-barrier design, feed distribution practices, stocking density, and barn layout may affect segmentation performance. Therefore, transfer of the proposed model to these production systems would require additional validation and, if necessary, retraining using data collected under the corresponding conditions. In future studies, greater emphasis is expected to be placed on expanding the dataset through data acquisition from multiple farms, different barn configurations, seasons, and geographic locations, as well as on evaluating the model using other cattle populations and livestock species.
Hardware and Integration Limitations: The inference performance reported in this study was evaluated using an NVIDIA Tesla A100 GPU (NVIDIA Corp., Santa Clara, CA, USA) in the Google Colab environment. Therefore, the reported inference time and FPS values should not be interpreted as direct evidence of performance on embedded edge-computing hardware. In addition, the model has not yet been integrated into the control loop of a physical mobile robot or evaluated through long-term robotic field tests.
The limitations outlined above provide an important roadmap for the future stages of the project. In this context, as the next step following the successful segmentation and detection results obtained in this study, the developed BarnSeg-ECA-Lite model is planned to be directly integrated into the edge AI processing unit of an autonomous feed-pushing robot. In future research, this deep learning-based visual perception system will be integrated in real time with the robot’s onboard LiDAR-based SLAM navigation and autonomous charging architectures. The integration of image-based segmentation outputs with data obtained from LiDAR-based SLAM and other sensors is considered an important research area for enhancing environmental awareness and developing more reliable autonomous navigation strategies [33,58]. Similarly, positional information derived from Buffalo Head segmentation masks may enable the real-time tracking of animals relative to the robot, thereby providing a basis for the development of autonomous collision-avoidance algorithms that support safe animal–robot interaction [8,13]. Finally, the real-time operational stability, energy efficiency, and continuity of autonomous operation of the system will be comprehensively evaluated through long-term field tests conducted in commercial barn environments. Accordingly, the proposed model has the potential to serve not only as a standalone instance segmentation algorithm but also as one of the fundamental components of the environmental perception infrastructure of future fully autonomous precision livestock farming robots.

5. Conclusions

In this study, the YOLOv8n-seg-based BarnSeg-ECA-Lite model was developed for the simultaneous instance segmentation of Feed, Buffalo Head, and Mineral Lick Block objects under real barn conditions. In addition, an original dataset consisting of NoIR images acquired at different feeding times and under variable illumination conditions was prepared for model training and evaluation. In the proposed architecture, P2-to-P3 feature support, the ECA mechanism, a lightweight network structure, a targeted resampling strategy, and high-resolution mask supervision were jointly employed to achieve a balanced trade-off between segmentation accuracy and computational efficiency.
The experimental results demonstrated that the BarnSeg-ECA-Lite model achieved the highest overall performance among the compared lightweight segmentation models. The model attained an mAP@0.50 of 0.9313, an mAP@0.50:0.95 of 0.7988, and an F1-score of 0.9300, while achieving 74 FPS under the NVIDIA A100 evaluation environment with only 2.73 million parameters. The class-wise analyses showed that the model achieved high segmentation performance not only overall but also for the Buffalo Head, Feed, and MLB classes, which exhibit different geometric and scale characteristics. In particular, the mAP@0.50 value of 0.9177 obtained for the moving and difficult-to-detect Buffalo Head class and the mAP@0.50:0.95 value of 0.8778 achieved for feed regions demonstrate that the proposed architecture can operate reliably in complex barn environments. The ablation analyses revealed that each component incorporated into the proposed architecture made a distinct contribution to performance. While P2-to-P3 feature support improved the detection of small and distant targets, the ECA mechanism increased segmentation accuracy by generating more selective feature representations. Targeted resampling and high-resolution mask supervision provided an optimal balance between accuracy and precision–recall performance. Furthermore, the XGrad-CAM analyses showed that the BarnSeg-ECA-Lite model focused more accurately on the target objects and substantially reduced false activations caused by non-target regions such as concrete floors and metal feed barriers. Thus, the model was shown not only to achieve high accuracy but also to provide a more reliable decision-making process.
Overall, the findings demonstrate that the BarnSeg-ECA-Lite model achieves a favorable balance between segmentation accuracy and computational complexity under the evaluated hardware conditions. In addition, the NoIR-based instance segmentation dataset developed in this study provides a useful resource for future research on computer vision applications in intelligent livestock monitoring and barn environment perception. In conclusion, this study demonstrates that lightweight deep learning models can provide effective instance segmentation in complex barn environments, offering a promising visual perception framework for future autonomous feed-pushing robots and other smart livestock farming systems.

Author Contributions

Conceptualization, T.U., H.Y., M.Ç. and İ.Ü.; methodology, T.U. and İ.Ü.; software, T.U., H.Y. and M.Ç.; validation, H.Y., M.Ç. and İ.Ü.; formal analysis, H.Y., İ.Ü. and N.U.; investigation, H.Y., M.Ç. and İ.Ü.; resources, T.U. and İ.Ü.; data curation, M.Ç., N.U. and İ.Ü.; writing—original draft preparation, T.U., H.Y., M.Ç. and İ.Ü.; writing—review and editing, H.Y., M.Ç., İ.Ü. and N.U.; visualization, T.U. and N.U.; supervision, T.U. and İ.Ü.; project administration, T.U.; funding acquisition, T.U., H.Y., M.Ç., İ.Ü. and N.U. All authors have read and agreed to the published version of the manuscript.

Funding

This work is financially supported by Scientific Research Projects Coordination Unit of Burdur Mehmet Akif Ersoy University (project number: 2017K12-41003-41). The APC was partially funded by the National University of Science and Technology Politehnica Bucharest, Romania, within the PubArt Program.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The original contributions presented in the study are included in the article; further inquiries can be directed to the corresponding author.

Acknowledgments

The authors express their gratitude to the Department of Precision Agriculture and Agricultural Robots, Faculty of Science and Letters, Burdur Mehmet Akif Ersoy University, for providing the institutional and technical support necessary for conducting this research.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Jiang, B.; Tang, W.; Cui, L.; Deng, X. Precision Livestock Farming Research: A Global Scientometric Review. Animals 2023, 13, 2096. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  2. Kleen, J.L.; Guatteo, R. Precision Livestock Farming: What Does It Contain and What Are the Perspectives? Animals 2023, 13, 779. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  3. Bąkowska, M.; Pilarczyk, R.; Juszczak-Czasnojć, M.; Seremak, B.; Tomza-Marciniak, A.; Kwita, E.; Felska-Błaszczyk, L.; Pilarczyk, B. The Effect of Environment and Husbandry Practices on Sheep Welfare. Animals 2025, 15, 3314. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  4. Mata, F. The Impact of Precision Livestock Farming Technologies on Productivity, Animal Welfare, and Environmental Sustainability. J 2026, 9, 13. [Google Scholar] [CrossRef] [Scilit]
  5. Pérez Núñez, I.; Quiñones, J.; Sepúlveda Truan, G.; Cancino-Baier, D.; Agregán, R.; Lorenzo, J.M.; Sepúlveda, N.; Díaz, R. Strategies for Advanced Production: A Review of the Use of AI in the Dairy Industry. Animals 2026, 16, 1363. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  6. Wang, Y.; Mücher, S.; Wang, W.; Guo, L.; Kooistra, L. A Review of Three-Dimensional Computer Vision Used in Precision Livestock Farming for Cattle Growth Management. Comput. Electron. Agric. 2023, 206, 107687. [Google Scholar] [CrossRef] [Scilit]
  7. Liang, R.; Zhang, Y.; Liu, S.; Zhang, Y.; Xue, A.; Shen, W. From Individual Identification to Behavioral Sensing—Evolution and Challenges of RFID Technology in Precision Livestock Farming. Comput. Electron. Agric. 2026, 248, 111821. [Google Scholar] [CrossRef] [Scilit]
  8. Islam, M.N.; Edwards, J.L.; Burns, R.; Qi, H.; Gan, H. Computer Vision for Cattle Health and Welfare Monitoring: A Comprehensive Review of Methods, Applications, and Interdisciplinary Integration in Smart Agriculture. Sensors 2026, 26, 4271. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  9. Giannico, F.; Carbonara, C.; Caputi Jambrenghi, A.; Ragni, M.; Salem, A.Z.M.; Tarricone, S.; Selvaggi, M.; Colonna, M.A. Sensor-Based Precision Feeding Systems in Animal Production: Technologies and Applications. Animals 2026, 16, 1333. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  10. Bresolin, T.; Ferreira, R.; Reyes, F.; Van Os, J.; Dórea, J.R.R. Assessing Optimal Frequency for Image Acquisition in Computer Vision Systems Developed to Monitor Feeding Behavior of Group-Housed Holstein Heifers. J. Dairy Sci. 2023, 106, 664–675. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  11. Antognoli, V.; Presutti, L.; Bovo, M.; Torreggiani, D.; Tassinari, P. Computer Vision in Dairy Farm Management: A Literature Review of Current Applications and Future Perspectives. Animals 2025, 15, 2508. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  12. Tu, S.; Ou, H.; Mao, L.; Du, J.; Cao, Y.; Chen, W. Behavior Tracking and Analyses of Group-Housed Pigs Based on Improved ByteTrack. Animals 2024, 14, 3299. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  13. Hasan, M.K.; Mun, H.-S.; Mehtab, A.; Kang, J.-G.; Sharifuzzaman, M.; Lagua, E.B.; Kim, Y.-H.; Park, H.-R.; Yang, C.-J. Computer Vision-Based Detection of Agonistic Behaviors in Pigs: Advances and Applications for Precision Livestock Farming. Agriculture 2026, 16, 700. [Google Scholar] [CrossRef] [Scilit]
  14. Feng, X.; Li, J.; Yi, J.; Wang, Z. SheepTrack: Occlusion-Robust Detection and Tracking for Dense Sheep Monitoring. Electronics 2026, 15, 1679. [Google Scholar] [CrossRef] [Scilit]
  15. Bhujel, A.; Wang, Y.; Lu, Y.; Morris, D.; Dangol, M. A Systematic Survey of Public Computer Vision Datasets for Precision Livestock Farming. Comput. Electron. Agric. 2024, 229, 109718. [Google Scholar] [CrossRef] [Scilit]
  16. Adam, M.; Song, J.; Yu, W.; Li, Q. Deep Learning Approaches for Automatic Livestock Detection in UAV Imagery: State-of-the-Art and Future Directions. Future Internet 2025, 17, 431. [Google Scholar] [CrossRef] [Scilit]
  17. Minaee, S.; Boykov, Y.; Porikli, F.; Plaza, A.; Kehtarnavaz, N.; Terzopoulos, D. Image Segmentation Using Deep Learning: A Survey. IEEE Trans. Pattern Anal. Mach. Intell. 2022, 44, 3523–3542. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  18. Zhang, Y.; Yang, Y.; Guo, R.; Geng, N. RF-GoatDet: An Occlusion-Aware Instance Segmentation Framework for Dairy Goats with an Adaptive Receptive Field Encoder. Mathematics 2026, 14, 1786. [Google Scholar] [CrossRef] [Scilit]
  19. Chen, Z.; Xu, J.; Guan, D.; Zheng, X.; Li, Y. A Unified Multidimensional Benchmark and Multi-Dataset Evaluation of YOLO-Based Models for Remote Sensing Building Instance Segmentation. Sensors 2026, 26, 3686. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  20. Lee, D.H.; Park, H.Y.; Lee, J. A Review on Recent Deep Learning-Based Semantic Segmentation for Urban Greenness Measurement. Sensors 2024, 24, 2245. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  21. Shalash, O.; Khatab, E.; El-Agamy, A.; Elmokadem, L.; Abouelsaad, Y.; Zaki, J.; El-Sayed, M.; Said, H. Benchmarking YOLOv8–YOLOv12 for Real-Time Object Detection on Single-Board Computers. Mach. Learn. Knowl. Extr. 2026, 8, 204. [Google Scholar] [CrossRef] [Scilit]
  22. Zha, C.; Tang, S.; Cheng, J.; Cheng, T. Research on Bearing Surface Defect Detection Based on Improving YOLOV5S. U.P.B. Sci. Bull Series D 2025, 87, 73–88. [Google Scholar]
  23. Lei, L.; Yang, Q.; Yang, L.; Shen, T.; Wang, R.; Fu, C. Deep Learning Implementation of Image Segmentation in Agricultural Applications: A Comprehensive Review. Artif. Intell. Rev. 2024, 57, 149. [Google Scholar] [CrossRef] [Scilit]
  24. Charisis, C.; Argyropoulos, D. Deep Learning-Based Instance Segmentation Architectures in Agriculture: A Review of the Scopes and Challenges. Smart Agric. Technol. 2024, 8, 100448. [Google Scholar] [CrossRef] [Scilit]
  25. Zuo, D.; Qi, L.; Ni, H.; Song, S.; Li, H.; Wang, X. Ship Target Detection Method Based on Feature Fusion and Bi-Level Routing Attention. Symmetry 2026, 18, 729. [Google Scholar] [CrossRef] [Scilit]
  26. Zhu, J.; Song, L.; Fu, T.; Wang, Y.; Wang, M.; Wu, A. YOLO-ESO: A Lightweight YOLOv10-Based Model for Individual Pig Identification in Complex Farming Environments. Information 2026, 17, 421. [Google Scholar] [CrossRef] [Scilit]
  27. Ünal, İ.; Eceoğlu, O. A Lightweight Instance Segmentation Model for Simultaneous Detection of Citrus Fruit Ripeness and Red Scale (Aonidiella aurantii) Pest Damage. Appl. Sci. 2025, 15, 9742. [Google Scholar] [CrossRef] [Scilit]
  28. Cordova-Cardenas, R.; Amor, D.; Gutiérrez, Á. Edge AI in Practice: A Survey and Deployment Framework for Neural Networks on Embedded Systems. Electronics 2025, 14, 4877. [Google Scholar] [CrossRef] [Scilit]
  29. Lai, N.; Dewi, D.A.; Maidin, S.S.; Xiao, W.; Zhao, S.; Hu, Q. A Comprehensive Review of Lightweight Deep Learning Models for Edge Computing with Future Directions. Discov. Comput. 2026, 29, 110. [Google Scholar] [CrossRef] [Scilit]
  30. Li, S.; Sultonov, F.; Tursunboev, J.; Park, J.-H.; Yun, S.; Kang, J.-M. Ghostformer: A GhostNet-Based Two-Stage Transformer for Small Object Detection. Sensors 2022, 22, 6939. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  31. Hong, W.; Ling, S.; Zhu, P.; Wang, Z.; Zhao, R.; Liu, Y.; Dong, M. Lightweight Vision–Transformer Network for Early Insect Pest Identification in Greenhouse Agricultural Environments. Insects 2026, 17, 74. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  32. Huang, Q.; Yang, J.; Yang, M.; Jiang, D.; Wang, T. DMN-YOLO: A Lightweight Small-Object Detector for Multi-Species Animal Detection in UAV Grassland Imagery. Animals 2026, 16, 1643. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  33. Almtireen, N.; Ryalat, M. Robotics in Precision Agriculture: Task-, Platform-, and Evaluation-Oriented Review. Robotics 2026, 15, 81. [Google Scholar] [CrossRef] [Scilit]
  34. Paneru, B.; Dhungana, A.; Dahal, S.; Ritz, C.W.; Kim, W.; Liu, T.; Chai, L. Computer Vision Models for Precision Poultry Farming: A Narrative Review of Behavioral and Welfare Monitoring Studies. Poult. Sci. 2026, 105, 106887. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  35. Li, S.; Cao, S.; Wei, P.; Sun, W.; Kong, F. Dynamic Object Detection and Non-Contact Localization in Lightweight Cattle Farms Based on Binocular Vision and Improved YOLOv8s. Agriculture 2025, 15, 1766. [Google Scholar] [CrossRef] [Scilit]
  36. Jocher, G.; Chaurasia, A.; Qiu, J. Ultralytics YOLOv8, Version 8.0.0 [Computer Software]. 2023. Available online: https://github.com/ultralytics/ultralytics (accessed on 24 July 2026).
  37. Uygun, T.; Ozguven, M.M. Determination of Tomato Leafminer: Tuta absoluta (Meyrick) (Lepidoptera: Gelechiidae) Damage on Tomato Using Deep Learning Instance Segmentation Method. Eur. Food Res. Technol. 2024, 250, 1837–1852. [Google Scholar] [CrossRef] [Scilit]
  38. Zhao, X.; Ding, W.; An, Y.; Du, Y.; Yu, T.; Li, M.; Tang, M.; Wang, J. Fast Segment Anything. arXiv 2023, arXiv:2306.12156. [Google Scholar] [CrossRef] [Scilit]
  39. Wu, W.; He, Z.; Li, J.; Chen, T.; Luo, Q.; Luo, Y.; Wu, W.; Zhang, Z. Instance Segmentation of Tea Garden Roads Based on an Improved YOLOv8n-seg Model. Agriculture 2024, 14, 1163. [Google Scholar] [CrossRef] [Scilit]
  40. Jocher, G.; Qiu, J. Ultralytics YOLO11, Version 11.0.0 [Computer Software]. 2024. Available online: https://github.com/ultralytics/ultralytics (accessed on 28 August 2026).
  41. Jocher, G.; Qiu, J.; Liu, M.; Lyu, S.; Akyon, F.C.; Kalfaoglu, M.E. Ultralytics YOLO26: Unified Real-Time End-to-End Vision Models. arXiv 2026, arXiv:2606.03748. [Google Scholar] [CrossRef] [Scilit]
  42. Wang, Q.; Wu, B.; Zhu, P.; Li, P.; Zuo, W.; Hu, Q. ECA-Net: Efficient Channel Attention for Deep Convolutional Neural Networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 13–19 June 2020; pp. 11531–11539. [Google Scholar] [CrossRef] [Scilit]
  43. Zhang, J.; Wei, X.; Zhang, L.; Yu, L.; Chen, Y.; Tu, M. YOLO v7-ECA-PConv-NWD Detects Defective Insulators on Transmission Lines. Electronics 2023, 12, 3969. [Google Scholar] [CrossRef] [Scilit]
  44. Su, G.; Su, X.; Wang, Q.; Luo, W.; Lu, W. Research on X-Ray Weld Defect Detection of Steel Pipes by Integrating ECA and EMA Dual Attention Mechanisms. Appl. Sci. 2025, 15, 4519. [Google Scholar] [CrossRef] [Scilit]
  45. Han, K.; Wang, Y.; Tian, Q.; Guo, J.; Xu, C.; Xu, C. GhostNet: More Features from Cheap Operations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 13–19 June 2020; pp. 1580–1589. [Google Scholar] [CrossRef] [Scilit]
  46. Wang, T.; Zhang, S. DSC-Ghost-Conv: A Compact Convolution Module for Building Efficient Neural Network Architectures. Multimed. Tools Appl. 2024, 83, 36767–36795. [Google Scholar] [CrossRef] [Scilit]
  47. Qiu, Z.; Bai, H.; Chen, T. Special Vehicle Detection from UAV Perspective via YOLO-GNS Based Deep Learning Network. Drones 2023, 7, 117. [Google Scholar] [CrossRef] [Scilit]
  48. Yang, X.; Ji, W.; Zhang, S.; Song, Y.; He, L.; Xue, H. Lightweight Real-Time Lane Detection Algorithm Based on Ghost Convolution and Self Batch Normalization. J. Real-Time Image Process. 2023, 20, 69. [Google Scholar] [CrossRef] [Scilit]
  49. Wang, F.; Wang, W.; Sun, X.; Wang, C.; Yuan, W. Sheep Instance Segmentation Method Based on Improved YOLO v8n-seg. Trans. Chin. Soc. Agric. Mach. 2024, 55, 322–332. [Google Scholar] [CrossRef]
  50. Liao, Y.; Qiu, Y.; Liu, B.; Qin, Y.; Wang, Y.; Wu, Z.; Xu, L.; Feng, A. YOLOv8A-SD: A Segmentation-Detection Algorithm for Overlooking Scenes in Pig Farms. Animals 2025, 15, 1000. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  51. Wang, J.; Qi, Z.; Wang, Y.; Liu, Y. A Lightweight Weed Detection Model for Cotton Fields Based on an Improved YOLOv8n. Sci. Rep. 2025, 15, 457. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  52. Liu, Y.; Wang, F.; Song, R.; Wu, Y.; Shen, H.; Wu, H.; Zhang, C. EVA-YOLOv8: An Improved YOLOv8 Model Integrating Multi-Scale Attention Mechanism and Vision Transformer for Multi-Class Road Crack Detection. Sci. Rep. 2026, 16, 16504. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  53. Samek, W.; Montavon, G.; Lapuschkin, S.; Anders, C.J.; Müller, K.-R. Explaining Deep Neural Networks and Beyond: A Review of Methods and Applications. Proc. IEEE 2021, 109, 247–278. [Google Scholar] [CrossRef] [Scilit]
  54. Abou Samra, R.M.; Ali, R.R. Explainable Artificial Intelligence in Smart Agriculture: A Comprehensive Review of Interpretable Remote Sensing for Sustainable Decision-Making. AgriEngineering 2026, 8, 270. [Google Scholar] [CrossRef] [Scilit]
  55. Arrieta, A.B.; Díaz-Rodríguez, N.; Del Ser, J.; Bennetot, A.; Tabik, S.; Barbado, A.; García, S.; Gil-López, S.; Molina, D.; Benjamins, R.; et al. Explainable Artificial Intelligence (XAI): Concepts, Taxonomies, Opportunities, and Challenges toward Responsible AI. Inf. Fusion 2020, 58, 82–115. [Google Scholar] [CrossRef] [Scilit]
  56. Hamida, S.U.; Chowdhury, M.J.M.; Chakraborty, N.R.; Biswas, K.; Sami, S.K. Exploring the Landscape of Explainable Artificial Intelligence (XAI): A Systematic Review of Techniques and Applications. Big Data Cogn. Comput. 2024, 8, 149. [Google Scholar] [CrossRef] [Scilit]
  57. Guzhva, O.; Ternman, E.; Lindberg, M.; Telezhenko, E.; Kronqvist, C. PickAMoo: LIDAR-Enhanced Mask R-CNN Segmentation for Precision Weight Estimation in Dairy Cattle Using Smartphone Imaging. Sci. Rep. 2026, 16, 16020. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  58. Tedeschi, L.O.; Guarnido-Lopez, P.; Menendez, H.M., III; Seo, S. Advancing Precision Livestock Farming: Integrating Artificial Intelligence and Emerging Technologies for Sustainable Livestock Management. Anim. Biosci. 2026, 39, 250289. [Google Scholar] [CrossRef] [Scilit] [PubMed]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.