Abstract
In modern intelligent food processing, the unpredictable variability in pomelo orientation on high-speed conveyors poses a significant challenge to automated grading and precision peeling operations. To address this, a deep learning-based method is proposed for the real-time detection of pomelo posture. Firstly, a pomelo posture dataset was constructed to support model training and validation. Secondly, to balance the extraction of posture features from uniform fruits with the low-power constraints of edge deployment, a domain-specific architectural optimization is presented. Building on the YOLOv8n framework, the proposed model synergistically integrates specialized modules. A lightweight GhostHGNetV2 foundation is utilized to significantly reduce computational redundancy while maintaining the resolution required to detect key anatomical landmarks. To overcome spatial confusion and capture multi-scale global appearance information, a multi-path coordinate attention (MPCA) module is introduced. Furthermore, the SlimNeck architecture and VoVGSCSP module streamline multi-scale feature fusion via one-time aggregation, effectively preventing computational bottlenecks. This design optimizes the computational efficiency of the model while maintaining detection accuracy. Experimental results demonstrate that compared with the baseline YOLOv8n model, the proposed method increased the mAP50 accuracy by 3.67% while reducing parameter count and computational load by 17.5% and 23.3%, respectively. Additionally, it achieved a processing speed of 19.3 FPS on the Jetson Orin Nano 6G edge platform. This research provides a critical technical foundation for the recognition of pomelo posture, enabling subsequent orientation rectification and fostering the development of streamlined, automated pomelo processing lines.
1. Introduction
The Pomelo (Citrus maxima Merr.) is a commercially significant fruit widely cultivated in China, with a planting area exceeding 105,640 hectares and an annual output of 4.8 million metric tons [1]. Fruit processing methods are instrumental in tapping into the potential value of pomelos and increasing the economic value of the pomelo industry. In operations such as automatic grading and precision peeling, maintaining a consistent feeding posture is critical to ensure quality uniformity and minimize fruit loss. Currently, fruit adjustment and positioning for these purposes rely heavily on manual labor, leading to discontinuous processes and high costs [2]. During transportation on conveyor belts, pomelos typically exhibit high posture variability. These inconsistent orientations present significant barriers to the efficiency of industrial-scale pomelo grading and processing lines [3,4,5]. To automate the orientation adjustment of individual pomelos, a crucial preliminary step is to accurately identify their spatial postures and key anatomical landmarks. Specifically, posture recognition provides support for targeted orientation adjustment, while the identification of key anatomical landmarks complements the entire processing workflow [6,7]. Furthermore, AI-guided collaborative mechanical operations and precision control further ensure the accuracy and stability of the system [8,9,10]. Therefore, the development of a high-performance pomelo posture detection model is a prerequisite for advancing intelligent food processing equipment and standardizing postharvest quality control.
Distinct from smaller and more symmetrical fruits such as apples and tomatoes, the pomelo presents unique morphological challenges that complicate automated posture detection. As one of the largest citrus species, its significant mass and eccentric center of gravity lead to highly unstable and varied orientations during high-speed conveyor transfer [11]. In this study, spatial posture is categorized into the “Seated” posture where the axis is vertical, the “Lying” posture where the axis is horizontal, and the “Inverted” posture. The inverted state typically occurs in complex industrial scenarios where pomelos are subject to overlap and mutual compression. Furthermore, the identification of key landmarks is hindered by the fact that the calyx often appears as a minute structure that is visually indistinguishable from common peel blemishes.
Existing research has explored various vision-based approaches to address fruit localization and orientation challenges. While 3D point cloud-based methods [12,13] provide rich geometric information and high spatial accuracy, they are often computationally prohibitive. The irregular and sparse nature of point cloud data necessitates complex preprocessing, which results in inference latencies that typically exceed 200 ms. Such delays are too slow for real-time edge deployment [14]. Conversely, 2D vision systems offer higher frames-per-second (FPS) rates at lower hardware costs. Early 2D methods relied on hand-crafted features such as moment bar symmetry [15] and geometric centers [16]. However, these traditional algorithms struggle with the morphological variability in pomelos and are highly sensitive to environmental lighting and occlusion in industrial settings.
In recent years, the focus of agricultural object detection has shifted significantly toward lightweight deep convolutional neural networks (DCNNs) specifically designed for edge devices. Researchers have increasingly integrated attention mechanisms and optimized backbone architectures to achieve a balance between accuracy and speed [17,18]. For instance, recent advancements in lightweight frameworks including the YOLO-tiny series and MobileNet-based architectures have demonstrated potential for real-time applications in harvesting robots and sorting lines. However, most existing models are optimized for small- or medium-sized spherical fruits including apples and oleifera fruit [19,20]. These models often exhibit a performance trade-off where they either sacrifice the granularity required for precise keypoint localization or necessitate high-end GPUs that are not cost-effective for localized edge deployment in pomelo processing facilities [21].
Despite these advancements, a critical research gap remains regarding the development of specialized frameworks capable of robust pomelo posture detection under constrained edge-computing budgets. Current lightweight models often treat object detection and keypoint localization as isolated tasks, failing to capture the complex relationship between a fruit’s global orientation and its local anatomical features. To fully satisfy the requirements of subsequent automated processing, this study introduces a dataset and a corresponding model that incorporate both overall spatial postures and local anatomical features as concurrent detection targets. Specifically, the model is designed to simultaneously identify the “Seated”, “Lying”, and “Inverted” orientations while precisely locating the “Stem” and “Calyx” regions. This integrated approach ensures that the spatial orientation and the key anatomical landmarks are recognized within a single inference cycle, thereby providing the necessary data for high-precision orientation adjustment in industrial sorters.
In summary, the main contributions presented in this paper are as follows:
- (1)
- A deep-learning-based strategy for pomelo posture detection is proposed to meet the requirements of posture identification in post-harvest processing lines, thereby addressing a critical gap in efficient orientation identification.
- (2)
- To tackle challenges related to target scale variation and edge deployment, the YOLOv8n baseline is enhanced through a synergistic integration of advanced modules. Specifically, a lightweight GhostHGNetV2 module is utilized as the foundation, and a multi-path coordinate attention (MPCA) module is integrated to optimize feature fusion and overcome spatial confusion in the neck region.
- (3)
- The neck of the model adopts the SlimNeck architecture, and VoVGSCSP modules are utilized to construct the neck region via a one-time aggregation method. This synergistic architecture significantly optimizes computational efficiency while maintaining detection accuracy, making the model highly suitable for edge deployment.
2. Materials and Methods
2.1. Image Acquisition
The pomelo posture dataset utilized in this study was collected from the Citrus Industry Technology Research and Development Center of South China Agricultural University in Guangzhou at coordinates 113.36° E and 23.16° N and a pomelo processing facility in Meizhou at coordinates 116.09° E and 24.44° N, Guangdong Province, China. Data collection was conducted during July, August, and October of 2024. Image acquisition was performed using a smartphone (iPhone 13, Apple Inc., Cupertino, CA, USA) and a camera (RealSense D435i, Intel Corporation, Santa Clara, CA, USA). To ensure dataset diversity, images were captured under varying lighting conditions and from multiple shooting angles at a distance ranging from 0.4 to 1.0 m. The overall research methodology of this study is illustrated in Figure 1, which delineates the three primary stages: image acquisition, model optimization, and system integration.
Figure 1.
Overall research approach.
2.2. Image Preprocessing and Dataset Construction
A total of 1428 original images were collected and partitioned into training, validation, and testing subsets utilizing an 8:1:1 split ratio. This allocation was executed at the parent-image level based on independent fruit batches to ensure data independence. Through a subsequent image augmentation pipeline involving variations in illumination, rotation, and overlap, the dataset was expanded fourfold, increasing the total number of images from 1428 to 5712. All performance metrics reported in this study were evaluated on a completely independent testing set comprising 142 unseen original images and their respective augmented variations. A strict isolation protocol was enforced to guarantee that all augmented versions of a specific original image remained in the same subset as their parent image.
To ensure the reliability and structural consistency of the ground truth labels, a rigorous multi-stage annotation quality control protocol was established. All original images were annotated using the open-source software Labelme V6.0.2 with standard horizontal bounding boxes. First, a standardized operational manual was provided to all annotators prior to the task. This manual explicitly defined the morphological criteria required to accurately locate the calyx and stem of the fruit against the highly uniform external appearance of the pomelo. This ensures a consistent standard for distinguishing the five mutually exclusive visual states, namely Lying, Seated, Inverted, Stem, and Calyx, as illustrated in Figure 2. Second, to ensure high inter-rater consistency, a mandatory validation step was enforced. Every annotated image was subjected to a secondary review conducted by a senior agricultural researcher. During this phase, ambiguous annotations, typically caused by severe target occlusion or dynamic blur, were systematically cross-verified and corrected, while samples with irrecoverable visual degradation were excluded. The detailed distribution of annotated instances across the five classes, is summarized in Table 1. This process yielded text files containing image coordinates and category information, with each text file corresponding to a JPG image file.
Figure 2.
Category examples.
Table 1.
Data category.
2.3. Network Structure
The overall architecture of the proposed GSM-YOLO algorithm is illustrated in Figure 3. Rather than a simple assembly of isolated components, the framework represents a unified and synergistic lightweight detection strategy. It is specifically engineered to address the trade-off between the extraction of fine-grained orientation features and the requirements of resource-constrained edge deployment, thereby providing a robust perception foundation for subsequent directional adjustment in automated production lines.
Figure 3.
Structure of the GSM-YOLO Model.
Built upon the YOLOv8n baseline, the model consists of three integrated components: a backbone network, a neck network, and a detection head. As the primary feature extractor, the backbone adopts an improved HGNetV2 structure composed of Ghost HGBlocks enhanced by Ghost Convolutions. This configuration significantly reduces cross-channel computational redundancy. However, because highly compact backbones risk losing spatial details, a multi-path coordinate attention (MPCA) module is introduced immediately after the Ghost Convolution operations. The MPCA module dynamically adjusts the importance of feature map channels and encodes precise positional coordinates. This mechanism is vital for overcoming the visual confusion caused by the uniform external appearance of the pomelo and for accurately distinguishing the stem from the calyx.
Finally, to prevent high-dimensional spatial information from causing computational bottlenecks during multi-scale feature fusion, a lightweight SlimNeck module is incorporated. By reducing feature channels, this module acts as a computational buffer, optimizing the overall efficiency of the model without compromising detection accuracy. Together, these interacting components form a cohesive architecture that ensures both high posture estimation accuracy and real-time industrial deployment capabilities.
2.4. GhostHGNetV2 Module
GhostHGNetV2 is formed by the integration of Ghost modules into the HGNetV2 architecture. The HGNetV2 network captures rich multi-level information within a graph structure by extracting features and aggregating information across different scales. It effectively models the relationships between nodes through graph convolution operations and adaptively adjusts its information aggregation strategy, thereby enhancing the accuracy of feature representation and the robustness of the model [22].
As illustrated in Figure 4b, the HGStem module replaces traditional coarse-grained single convolutions with multi-branch parallel small-kernel convolutions and pooling layers. This design efficiently preserves rich details and contextual information during the initial downsampling stage, providing high-quality feature maps for subsequent processing. Furthermore, compared to the original HGNetV2, GhostHGNetV2 replaces standard convolutions with Ghost Convolutions (Figure 4c). Specifically, the GhostConv module decomposes a traditional convolution into two sequential steps to reduce the computational weight of the model. First, a limited number of intrinsic feature maps are generated via standard convolution to lower the initial computational complexity. Second, additional feature maps are produced through cheap depth-wise linear operations to expand the channel count. Finally, feature maps from these two distinct groups are concatenated to yield a comprehensive set of output features.
Figure 4.
Structure of the GhostHGnetV2 Module.
The selection of GhostHGNetV2 is explicitly driven by the macro-scale volume and micro-feature visual characteristics of the pomelo. Although the fruit body is massive, the critical orientation landmarks—specifically the stem and calyx—are localized and minute. The efficient operations inherent to GhostHGNetV2 enable the network to sustain high-resolution feature maps without imposing a significant computational burden. This capability is indispensable for preserving the fine textural details required to accurately pinpoint these anatomical poles.
2.5. MPCA (Multi-Path Coordinate Attention) Module
In the task of pomelo posture detection, fruit stalks present significant challenges due to their small size and complex backgrounds, which often hinder traditional algorithms from achieving satisfactory performance. To address this issue, this study integrates a multi-path coordinate attention (MPCA) module after the SPPF component in the backbone network. As an enhanced version of the coordinate attention (CA) model [23], the MPCA module simultaneously captures cross-channel, direction-aware, and position-aware information. This design facilitates more accurate localization and recognition of the targets of interest.
In the original CA mechanism, the dual-channel convolution often exhibits insufficient feature extraction capabilities for minute anatomical features. To overcome this limitation, an additional channel branch is introduced to expand the number of convolutional paths, thereby implementing a multi-branch coordinated attention mechanism. By modeling the interrelationships among different channels, this mechanism enables the generated weights to effectively capture the subtle features and structural details of pomelo fruit stalks, improving both the detection performance and the generalization ability of the model. The architecture of the MPCA module is illustrated in Figure 5.
Figure 5.
Structure of the MPCA Module.
A primary challenge in pomelo posture detection is the uniform external appearance of the fruit, which often causes standard convolutions to confuse the stem and the calyx during random physical rotations. The MPCA module addresses this specific morphological challenge by encoding precise positional coordinates into the channel dimension. This empowers the network to capture long-range spatial dependencies between the macroscopic contour and specific anatomical extremities, successfully overcoming the feature confusion induced by the uniform exterior of the fruit.
With its unique multi-path design, the MPCA mechanism extracts detailed information across feature map channels from multiple perspectives and levels. As illustrated in Figure 6, the two inputs of the MPCA module are derived from the current encoder and the subsequent encoder; the output feature maps of these two encoders are denoted as and respectively.
Figure 6.
MPCA Mechanism.
Firstly, the two feature maps undergo dimension reduction and feature extraction via two independent global average pooling (GAP) layers and 1 × 1 convolutions. Subsequently, the processed feature maps are concatenated and further refined through an additional 1 × 1 convolution, resulting in multi-scale attention maps. This process is formulated as follows:
Here, denotes a 1 × 1 convolution layer, and represents the concatenation operation along the channel dimension. This design integrates channel features from two adjacent scales, thereby facilitating cross-scale information exchange.
2.6. SlimNeck Module
Traditional convolutional neural networks (CNNs) are often plagued by excessive parameter redundancy and high computational overhead. These constraints frequently hinder their deployment in resource-limited environments, such as edge computing platforms and mobile devices. To address this, the SlimNeck architecture is utilized to reduce computational costs and network complexity for pomelo posture detection while maintaining high precision [24].
As illustrated in Figure 7, SlimNeck is a lightweight architecture primarily composed of grouped spatial convolution (GSConv) and VoVGSCSP modules. In this study, the GSConv module is integrated into the neck region of the YOLOv8n baseline. This integration allows the GSConv module to permeate information derived from standard convolutions into the data generated by depthwise separable convolutions (DSC) [23]. The hybrid approach of the GSConv module—combining standard convolutions with DSC, concatenation, and channel shuffling—strikes an optimal balance between local feature extraction and cross-channel information exchange. While standard convolutions preserve rich spatial features, DSC ensures lightweight computation. The concluding shuffle operation facilitates information exchange between disparate feature maps, which promotes smoother gradient flow and the learning of robust, multifaceted features. This mechanism is particularly effective for accurately resolving the precise boundaries and orientations of pomelos against complex backgrounds.
Figure 7.
Structure of GSConv Module.
In practical industrial applications, the continuous conveying of heavy pomelos inevitably introduces motion blur and complex background noise that degrade visual feature quality. The SlimNeck architecture is explicitly designed to counter this degradation. It substantially reduces computational redundancy for edge deployment while guaranteeing that the multi-scale feature fusion process remains highly resilient to the dynamic noise specific to industrial conveyor environments.
Figure 8 details the architectural flowcharts for the GSbottleneck-P and VoVGSCSP-P modules. Within the GSConv module, input data first undergo a standard convolution to extract spatial features. Subsequently, each channel is processed independently via depthwise convolution. These two feature sets are then concatenated to enhance the multi-dimensional representation of the network. Finally, a channel shuffle operation rearranges the feature maps to enable global interaction, which helps mitigate gradient vanishing and accelerates model convergence.
Figure 8.
Structure of SlimNeck Module.
Furthermore, this study introduces the VoVGSCSP module, which builds upon the GSConv foundation. Utilizing a one-time aggregation method, this cross-stage module reduces structural complexity without sacrificing accuracy. In the VoVGSCSP module, the input feature map is convolved and split into two branches: one serves as a residual identity mapping, while the other passes through a GSbottleneck. These branches are subsequently convolved and concatenated to form the final output. This design deepens the network and enhances representation while avoiding information loss. Consequently, it directly addresses the stringent requirements for low latency and a minimal memory footprint on edge devices.
3. Results
3.1. Experimental Settings and Hyperparameters
Consistent experimental platforms and identical hyperparameter settings were adopted in this study to ensure fairness in the performance evaluation of the algorithms. The deep learning framework was executed on the Ubuntu 22.04.4 operating system, equipped with an NVIDIA GeForce RTX 3080 Ti GPU (12 GB VRAM), an Intel Core i7-10700 CPU (2.9 GHz, 16 cores), and 32 GB of RAM. The software environment included Python 3.8, PyTorch 1.11.0, and CUDA 11.3. Detailed training parameters are provided in Table 2.
Table 2.
Training parameter setting.
3.2. Evaluation Indicators
The following performance evaluation metrics are adopted in this study: Precision (P), Recall (R), mean Average Precision (mAP@0.5), model parameter count (Params), Giga Floating-Point Operations Per Second (GFLOPs), inference time, and model size [25]. The calculation formulas for these metrics are shown in Equations (3)–(7) respectively.
Among these evaluation metrics, True Positives (TP) and False Positives (FP) refer to the number of positive samples correctly predicted as positive and the number of negative samples incorrectly predicted as positive, respectively. False Negatives (FN) denote the number of positive samples incorrectly predicted as negative. Specifically, C represents the number of category labels in the dataset, and K represents the size of the convolution kernel. Meanwhile, and denote the number of input feature channels and output feature channels, respectively.
3.3. Ablation Study
To evaluate the contribution of each module within the proposed GSM-YOLO framework, a series of ablation experiments were conducted. The framework treats different posture attributes as independent classes within a multi-class detection paradigm. This design enables the model to effectively process overlapping features, allowing it to simultaneously generate a primary bounding box for the overall orientation and smaller boxes for precise landmark localization. Starting from the YOLOv8n baseline, optimized modules were gradually integrated to observe their impact on performance. The experimental results are presented in Table 3. The baseline YOLOv8n model achieved an mAP50 of 95.4% with 3,011,827 parameters and a computational load of 8.2 GFLOPs.
Table 3.
Ablation Study Results.
In group G1, the GhostHGNetV2 module was integrated to extract initial features and perform downsampling. Beyond capturing multi-scale feature variations in key pomelo components, this module serves as the primary driver for efficiency. By utilizing Ghost operations to replace standard convolutions, it significantly diminishes the feature redundancy inherent in high-resolution fruit imagery. This resulted in substantial reductions in both GFLOPs and parameter counts while enhancing the feature representation capabilities of the model.
In group G2, the SlimNeck architecture was implemented to effectively fuse multi-scale features. This fusion improves the detection of pomelo components across diverse scales and environmental conditions. Consequently, SlimNeck increased the mAP50 by 2.5% while simultaneously reducing the parameter count by 23.1% and lowering the computational load to 6.2 GFLOPs.
For group G3, the multi-path coordinate attention (MPCA) module was introduced to capture cross-channel, direction-aware, and position-aware information. In this isolated configuration, the integration of the attention mechanism introduced a marginal parameter overhead. However, this trade-off is highly justified. Given the uniform external appearance of pomelos, the precise positional encoding provided by this module is indispensable for capturing the long-range spatial dependencies required to accurately distinguish the stem from the calyx. The integration of this mechanism optimizes posture perception capabilities that purely lightweight backbones often lack all while incurring only a minor computational cost. Consequently, the addition of this module raised the mAP50 by 2.8%, boosting Precision and Recall to 97.6% and 96.1%, respectively.
Subsequently, in groups G4 through G6, pairwise combinations of these modules were evaluated. The results demonstrate that GhostHGNetV2 provided the most significant gains in model accuracy, followed by the MPCA module and SlimNeck. Regarding model compression, GhostHGNetV2 contributed the most to lightweighting, followed closely by SlimNeck.
Finally, group G7 integrated all three enhancement modules. In this configuration, GhostHGNetV2 trims redundancy while the MPCA module precisely localizes anatomical extremities. To balance the system, SlimNeck acts as a computational buffer. By streamlining the fusion flow, it ensures that high-dimensional spatial features are effectively integrated without triggering a proportional surge in computational complexity. This comprehensive configuration achieved a peak mAP50 of 99.1%, with 98.2% Precision and 98.7% Recall. Notably, despite these performance gains, the final parameter count was reduced by 17.5% and the computational load by 23.2% compared to the baseline. This optimized synergy achieves the highest accuracy while maintaining a lightweight profile exceptionally well-suited for edge deployment.
3.4. Comparative Experiment with Mainstream Models
To conduct a comprehensive performance evaluation of the GSM-YOLO model for pomelo posture detection, this study compared the improved framework with several mainstream lightweight object detection models. The comparative results are summarized in Table 4.
Table 4.
Comparative Test Results of Different Models.
As illustrated in Table 4, the proposed model significantly reduced both the parameter count and computational load while simultaneously improving detection accuracy relative to the baseline and competing architectures. The experimental results indicate that, compared with YOLOv5s, YOLOv6n, YOLOv8n, and YOLOv10n, the parameter count of the proposed GSM-YOLO was reduced by 0.993%, 41.4%, 17.5%, and 8.29%, respectively.
Among the compared models, YOLOv5s and YOLOv6n exhibited similar performance; however, YOLOv5s demonstrated a clear advantage in terms of parameter count and computational overhead. For YOLOv8n, the Precision was notably higher than the Recall, suggesting a higher rate of missed detections. Conversely, the higher Recall relative to Precision observed in YOLOv10n implies an increased probability of false detections in pomelo posture detection.
To rigorously validate the statistical significance of the proposed framework and to ensure that the reported metrics were not anomalies resulting from a specific, favorable dataset partition, a five-fold cross-validation strategy was conducted. The original images were divided into five distinct subsets. During each iteration, four subsets were utilized for training and validation, while the remaining unseen subset was strictly reserved for testing. This process was repeated five times to ensure a comprehensive evaluation across the entire data distribution.
Figure 9 illustrates the detection performance of various models across a range of testing scenarios. Specifically, Figure 9a,c,d represent a top-down perspective, while Figure 9b captures a lateral viewing angle. Figure 9a showcases various pomelo postures within a single variety, whereas Figure 9b highlights these postures under occlusion conditions. The results indicate that all evaluated models perform effectively in posture recognition, underscoring the robust capabilities of deep learning in this domain.
Figure 9.
Comparison of Different Models. (a) Case representing a top-down view; (b) Case representing a side view with occlusion; (c) Case involving different varieties; (d) Case involving dense individuals.
Nevertheless, target occlusion and scale variations continue to pose challenges. Certain models still exhibit false positives or missed detections, particularly regarding pomelo fruit stalks. For instance, Figure 10c,d depicts detection scenarios involving diverse varieties and clusters of multiple pomelos. In these instances, yellow circles indicate regions of missed detections, and red circles further highlight these specific failures.
An analysis of the YOLOv8n architecture reveals that features often become weakened, lost, or confounded during backbone extraction and feature fusion. This results in the transmission of insufficient spatial information to the detection head, which prevents the model from making accurate inferences. This bottleneck leads to suboptimal performance when detecting small targets or navigating complex backgrounds, thereby increasing the likelihood of missed detections. In contrast, the complex fusion mechanism of the YOLOv10n model may introduce additional noise or feature conflicts. When feature maps across different levels exhibit significant semantic discrepancies or inaccurate alignment, the authentic features of the target can be overshadowed by redundant fused data. For dense targets subjected to severe occlusion, this often results in both false and missed detections.
To overcome these limitations, this study proposes an enhanced model based on the YOLOv8n baseline. First, the GhostHGNetV2 module was integrated into the backbone to capture multi-scale variations in key pomelo features, thereby strengthening the representational power of the model. Simultaneously, the multi-path coordinate attention (MPCA) module was incorporated. By progressively fusing feature maps from adjacent scales, this module effectively captures the nuanced spatial information required for posture estimation. Finally, the integration of the SlimNeck architecture significantly optimizes computational efficiency while maintaining high detection accuracy.
3.5. Comparative Experiments of Different Attention Mechanism Models
To evaluate the impact of different attention mechanisms on the model’s detection performance, Dattention [26], SegNext_attention [27], TripletAttention [28], and LocalWindowAttention [29] were respectively integrated into the same position of the improved YOLOv8n model. The results are presented in Table 5.
Table 5.
Comparative Experiments of Different Attention Mechanisms.
To evaluate the impact of various attention mechanisms on the detection performance of the model, D-attention [26], SegNext-attention [27], TripletAttention [28], and LocalWindowAttention [29] were respectively integrated into the same position within the improved YOLOv8n framework. The results are summarized in Table 4. The experimental data indicate that D-attention increases the parameter count of the model by 8.85%, while SegNext-attention and LocalWindowAttention contribute increases of 3.2% and 3.1%, respectively. In comparison, the MPCA module introduces a 10.9% increase in parameters. Despite this larger footprint, the MPCA mechanism yields the most substantial improvements in both Precision and Recall. Specifically, it elevates detection accuracy to 98.2%, representing a 1.7% improvement over the TripletAttention module.
Furthermore, MPCA was the only mechanism capable of enhancing the mAP50 of the model. In contrast, the other four attention mechanisms demonstrated negligible gains; in fact, models integrated with D-attention and LocalWindowAttention experienced a slight decrease in mAP50. Overall, the inclusion of the MPCA module significantly bolsters the F1 score and mAP50 while maintaining the increase in parameter count and computational overhead within an acceptable margin.
Consequently, the MPCA mechanism was integrated into the backbone network. This integration has a profound positive impact on the robustness and stability of the model, particularly in challenging pomelo posture detection scenarios. By enabling more precise identification of key anatomical components and their orientations, the MPCA module proves to be the most effective solution for the requirements of this study.
3.6. Performance Analysis of Different Detection Models
Since deep learning models typically operate as “black boxes” by providing only prediction outputs, their internal decision-making processes often lack interpretability [30]. To address this limitation, Gradient-Weighted Class Activation Mapping++ (Grad-CAM++) was applied to the proposed model. By generating heatmaps for pomelo images within the test set, a visual representation of the attentional focus of the model was achieved, offering deeper insights into its diagnostic behavior.
As an advanced extension of the original Grad-CAM technique, Grad-CAM++ leverages gradient information to highlight the specific image regions the model prioritizes when identifying target classes. The visualization results are presented in Figure 10. In these heatmaps, the intensity of the red regions correlates with the degree of influence those areas exert on the predictions. Specifically, a deeper red indicates a higher level of attentional weight.
As illustrated in Figure 10, the Grad-CAM++ masks generated by the proposed GSM-YOLO cover the pomelo regions more comprehensively than those of the baseline YOLOv8n. Conversely, the background in these heatmaps remains blue, which indicates that the model assigns minimal attention to non-target regions. This demonstrates the superior ability of the proposed model to extract pertinent information from fruit regions, effectively aggregate features, and intensify its focus on pomelo-specific characteristics. Ultimately, this heightened selectivity enables the model to maintain high detection accuracy even within complex industrial backgrounds.
Figure 10.
Heatmaps of Different Models. (a) Cases with dense instances; (b) cases with sequentially arranged instances; (c) cases with low light intensity; (d) cases with a single fruit.
3.7. Edge Deployment of the Algorithm
To evaluate the real-world applicability of the proposed model on a manufacturing production line, the framework was deployed on an NVIDIA Jetson Orin Nano (Santa Clara, CA, USA). The NVIDIA Jetson Orin Nano Developer Kit is an ultra-compact yet powerful computer designed for generative AI on edge devices, delivering up to 67 TOPS of AI performance, which represents a 1.7-fold improvement over the previous generation. Table 6 summarizes the performance comparison of the proposed model across various heterogeneous computing environments. The results demonstrate that the algorithm achieves significant inference efficiency on both desktop and embedded platforms. Specifically, the model reaches 165.6 FPS on a desktop workstation and 19.3 FPS on the Jetson Orin Nano (6 GB) platform.
Table 6.
Comparison of model performance before and after deployment.
This processing speed, approximately 52 ms per frame, is significantly faster than the typical physical execution cycle of downstream mechanical orienting devices, which generally operates on a scale of seconds. Such efficiency provides a robust temporal margin that fully satisfies the real-time feedback requirements for continuous automated processing on conveyors. These findings validate that the architectural optimizations, most notably the GhostHGNetV2 backbone and SlimNeck modules, not only streamline the parameter footprint but also significantly enhance throughput at the edge. Consequently, the system successfully meets the stringent low-latency requirements necessary for real-time monitoring. By delivering high-precision detection within a minimized hardware power budget, this model is exceptionally well-suited for large-scale deployment on edge devices, offering promising prospects for the digital transformation of the food processing industry.
4. Advantages and Limitations
The most critical stage in pomelo processing is the standardization of fruit orientation. Traditional mechanical devices often rely on fixed structures or simple photoelectric sensors to orient pomelos of various sizes; however, these systems struggle to adapt to the complex, variable shapes and natural irregularities of the fruit. Previous research suggested a detection method for green citrus based on color features and absolute transformation differences, utilizing a support vector machine (SVM) for classification [31]. Traditional machine vision methodologies typically necessitate the design of complex image processing algorithms, such as edge detection, contour analysis, and Hough transforms, which must be tailored specifically to each potential orientation (e.g., vertical or horizontal). Furthermore, factors such as surface texture, color variations, fluctuating lighting, and background interference often render traditional algorithms ineffective for robust pomelo recognition. Handcrafted feature-based algorithms frequently fail when subjected to even minor environmental changes.
In contrast, the YOLOv8-based deep learning model employed in this study captures more robust, high-level features of key pomelo postures. This approach is well-suited for environments characterized by varying shadows, reflections, surface contamination, or partial occlusion. A fully trained YOLO model exhibits superior fault tolerance and adaptability, reducing the dependence of the system on ideal imaging conditions and providing a reliable decision-making foundation for intelligent orientation systems.
While the proposed GSM-YOLO method demonstrates significant advantages over classical machine vision methods, several limitations of the present study must be acknowledged. First, regarding the dataset and geographic scope, the current training images were acquired from a specific geographic region and a limited number of orchard batches. Consequently, the potential lack of large-scale external validation may limit the immediate generalizability of the model across highly diverse agricultural environments. Second, the proposed model is currently optimized for specific pomelo varieties. Given the high morphological variability among different pomelo cultivars, extreme geometric and textural differences may impact detection performance, necessitating broader varietal coverage in future training datasets. Additionally, the current algorithmic validation was performed on a controlled, laboratory-simulated conveyor system rather than through long-term, multi-site industrial trials. Finally, the primary focus of this study resides strictly within the visual perception layer. A full industrial closed-loop verification, encompassing downstream physical actuation and real-time mechanical orientation, has not yet been integrated. Future work will focus on expanding the dataset across diverse geographic regions and varieties, as well as deploying this perception core into a fully integrated mechanical processing line to evaluate end-to-end industrial efficiency.
5. Conclusions
A novel lightweight pomelo posture recognition model, GSM-YOLO, was proposed in this study. Developed from the YOLOv8n baseline, this model specifically addresses the challenges of target scale variations and the stringent requirements of edge deployment. A core innovation of the framework is the adoption of the GhostHGNetV2 lightweight backbone, which significantly enhances the detection accuracy of key anatomical components and fruit postures.
To further improve spatial awareness, the multi-path coordinate attention (MPCA) module was integrated, enabling the network to effectively capture multi-scale information regarding pomelo posture. Furthermore, the implementation of the SlimNeck architecture in the neck region substantially reduces computational complexity while maintaining high detection precision. Compared to the baseline, the proposed model improved mAP50 by 3.7% and mAP50–95 by 12.9% while reducing the parameter count by 17.5% and the computational load by 23.3%. As a domain-specific architectural optimization, this work provides an effective solution to balance the simultaneous detection of macroscopic postures and localized anatomical parts within the stringent computational limits of practical edge deployment.
Author Contributions
Conceptualization, Q.J. and R.Y.; methodology, R.Y.; software, J.F.; validation, Q.J., Y.D. and J.F.; formal analysis, J.H.; investigation, J.C.; resources, R.Y.; data curation, J.H.; writing—original draft preparation, Q.J.; writing—review and editing, Q.J. and Z.L.; visualization, Q.J.; supervision, S.L.; project administration, Z.L. and S.L.; funding acquisition, Z.L. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by the China Agriculture Research System of MOF and MARA, grant number CARS-26.
Institutional Review Board Statement
Not applicable.
Data Availability Statement
The dataset, annotation protocols, and relevant model configuration files supporting the findings of this study will be made publicly available in an open-access repository (e.g., GitHub/Zenodo) upon the acceptance and publication of this manuscript. During the peer-review process, these materials remain available from the corresponding author upon reasonable request.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Tocmo, R.; Pena-Fronteras, J.; Calumba, K.F.; Mendoza, M.; Johnson, J.J. Valorization of pomelo (Citrus grandis Osbeck) peel: A review of current utilization, phytochemistry, bioactivities, and mechanisms of action. Compr. Rev. Food. Sci. Food Saf. 2020, 19, 1969–2012. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Sawant, K.; Shenoy K B, A.; Pai, S.; Shirwaikar, R.D. Comprehensive Analysis of Fruit Variety Classification: Techniques, Challenges, and Application. Procedia Comput. Sci. 2025, 258, 223–232. [Google Scholar] [CrossRef] [Scilit]
- Leiva-Valenzuela, G.A.; Aguilera, J.M. Automatic detection of orientation and diseases in blueberries using image analysis to improve their postharvest storage quality. Food Control 2013, 33, 166–173. [Google Scholar] [CrossRef] [Scilit]
- Zhang, Y.; Li, N.; Zhang, L.; Lin, J.; Gao, X.; Chen, G. A review on the recent developments in vision-based apple-harvesting robots for recognizing fruit and picking pose. Comput. Electron. Agric. 2025, 231, 109968. [Google Scholar] [CrossRef] [Scilit]
- Song, J.Y.; Qin, Z.S.; Xue, C.W.; Bian, L.F.; Yang, C. Fruit grading system by reconstructed 3D hyperspectral full-surface images. Postharvest Biol. Technol. 2024, 212, 112898. [Google Scholar] [CrossRef] [Scilit]
- Mao, W.; He, L.; Xia, M.; Jiang, H.; Li, R.; Sahni, R.; Majeed, Y.; Zhu, Z.; Fu, L. A novel method to detect stem and fruit dynamically for apricot posture estimation and adjustment. Inf. Process. Agric. 2025, 12, 358–369. [Google Scholar] [CrossRef] [Scilit]
- Kaizu, Y.; Miyanishi, Y.; Todoriki, Y.; Furuhashi, K.; Imou, K. Detection of Persimmon Posture by a Convolutional Neural Network for Fully Automating the Peeling Process. J. ASABE 2022, 65, 1375–1386. [Google Scholar] [CrossRef] [Scilit]
- Pradhan, N.C.; Sahoo, P.K.; Kushwaha, D.K.; Makwana, Y.; Mani, I.; Kumar, M. A finite element modeling-based approach to predict vibrations transmitted through different body segments of the operator within the workspace of a small tractor. J. Field Robot. 2023, 40, 1543–1561. [Google Scholar] [CrossRef] [Scilit]
- Pradhan, N.C. ANN-PID based automatic braking control system for small agricultural tractors. J. Field Robot. 2024, 41, 2805–2831. [Google Scholar] [CrossRef] [Scilit]
- Pradhan, N.C.; Sahoo, P.K.; Kushwaha, D.K.; Mani, I.; Kumar, M. Actuating force for transmission controls in small farm tractor considering driver’s comfort. Indian J. Agric. Sci. 2022, 92, 105–112. [Google Scholar] [CrossRef] [Scilit]
- Han, Y.; Xu, S.; Zhang, Q.; Lu, H.; Liang, X.; Fan, C. Non-destructive detection method and experiment of pomelo volume and flesh content based on image fusion. Postharvest Biol. Technol. 2024, 213, 112953. [Google Scholar] [CrossRef] [Scilit]
- Gao, R.; Zhou, Q.; Cao, S.; Jiang, Q. An algorithm for calculating apple picking direction based on 3D vision. Agriculture 2022, 12, 1170. [Google Scholar] [CrossRef] [Scilit]
- Son, G.; Lee, S.; Choi, Y. FRESH: Fusion-Based 3D Apple Recognition via Estimating Stem Direction Heading. Agriculture 2024, 14, 2161. [Google Scholar] [CrossRef] [Scilit]
- Xuan, G.; Gao, C.; Shao, Y.; Zhang, M.; Wang, Y.; Zhong, J.; Li, Q.; Peng, H. Apple detection in natural environment using deep learning algorithms. IEEE Access 2020, 8, 216772–216780. [Google Scholar] [CrossRef] [Scilit]
- Wang, W.; Zhu, L.; Zhao, B.; Gao, J.; Cui, X.; Han, Z.; Zhao, S. LPNet: A lightweight progressive network for calyx-aware apple pose estimation in orchard environments. Artif. Intell. Agric. 2026, 16, 672–694. [Google Scholar] [CrossRef] [Scilit]
- Mizushima, A.; Lu, R. A low-cost color vision system for automatic estimation of apple fruit posture and maximum equatorial diameter. Trans. ASABE 2013, 56, 813–827. [Google Scholar] [CrossRef] [Scilit]
- Gu, Z.; Ma, X.; Guan, H.; Jiang, Q.; Deng, H.; Wen, B.; Zhu, T.; Wu, X. Tomato fruit detection and phenotype calculation method based on the improved RTDETR model. Comput. Electron. Agric. 2024, 227, 109524. [Google Scholar] [CrossRef] [Scilit]
- Kok, E.; Chen, C. Occluded apples orientation estimator based on deep learning model for robotic harvesting. Comput. Electron. Agric. 2024, 219, 108781. [Google Scholar] [CrossRef] [Scilit]
- Ma, B.; Sun, L.; Mu, J.; Ren, Z.; Kang, G.; Liu, R.; Liu, S.; Hu, X.; Zhang, H.; Wang, J. MH-YOLO: Multiple heterogeneous YOLO for apple orchard pest detection. Inf. Process. Agric. 2026, 13, 47–71. [Google Scholar] [CrossRef] [Scilit]
- Jin, S.; Zhou, L.; Zhou, H. CO-YOLO: A lightweight and efficient model for Camellia oleifera fruit object detection and posture determination. Comput. Electron. Agric. 2025, 235, 110394. [Google Scholar] [CrossRef] [Scilit]
- Li, B.; Lu, H.; Wei, X.; Guan, S.; Zhang, Z.; Zhou, X.; Luo, Y. An Improved Rotating Box Detection Model for Litchi Detection in Natural Dense Orchards. Agronomy 2023, 14, 95. [Google Scholar] [CrossRef] [Scilit]
- Xu, W.; Yu, J.; Xiao, Y.; Wang, G.; Li, X.; Li, D. A new quantitative analysis method for the fish behavior under ammonia nitrogen stress based on pruning strategy. Aquaculture 2025, 600, 742192. [Google Scholar] [CrossRef] [Scilit]
- Ma, S.; Zhao, X.; Wan, L.; Zhang, Y.; Gao, H. A lightweight algorithm for steel surface defect detection using improved YOLOv8. Sci. Rep. 2025, 15, 8966. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Li, H.; Chen, J.; Gu, Z.; Dong, T.; Chen, J.; Huang, J.; Gai, J.; Gong, H.; Lu, Z.; He, D. Optimizing edge-enabled system for detecting green passion fruits in complex natural orchards using lightweight deep learning model. Comput. Electron. Agric. 2025, 234, 110269. [Google Scholar] [CrossRef] [Scilit]
- Liu, B.; Zhang, Y.; Wang, J.; Luo, L.; Lu, Q.; Wei, H.; Zhu, W. An improved lightweight network based on deep learning for grape recognition in unstructured environments. Inf. Process. Agric. 2024, 11, 202–216. [Google Scholar] [CrossRef] [Scilit]
- Han, Y.; Su, D.; Xu, H.; Meng, X.; Wang, B.; Wang, D.; Xia, L.; Sun, X.; Guo, Y. Enhancing Rubus idaeus L. Maturity detection and classification: A YOLO-CG-CPCA network model for efficient feature extraction and precise analysis. Postharvest Biol. Technol. 2025, 230, 113800. [Google Scholar] [CrossRef] [Scilit]
- Guo, Y.; Zhou, W.; Fu, Y.H.; Hao, F.; Zhang, X.; Xu, L.; Liu, J.; He, Y. SegNeXt-RCMSCA: An improved SegNeXt network for detecting winter wheat lodging from UAS RGB images. Smart Agric. Technol. 2025, 12, 101230. [Google Scholar] [CrossRef] [Scilit]
- Zhang, Y.; Hu, Z.; Liu, J.; Li, Y.; Lin, J.; Wang, Y.; Yu, H. PUFFER-DETR: Tiger puffer similar abnormal behavior recognition based on transformer. Aquacult. Eng. 2025, 111, 102552. [Google Scholar] [CrossRef] [Scilit]
- Jamali, A.; Roy, S.K.; Bhattacharya, A.; Ghamisi, P. Local window attention transformer for polarimetric SAR image classification. IEEE Geosci. Remote Sens. Lett. 2023, 20, 1–5. [Google Scholar] [CrossRef] [Scilit]
- Shen, Q.; Zhang, J. AI-enhanced disaster risk prediction with explainable SHAP analysis: A multi-class classification approach using XGBoost. ISCAIT 2026, 692–698. [Google Scholar] [CrossRef] [Scilit]
- Zhao, C.; Lee, W.; He, D. Immature green citrus detection based on colour feature and sum of absolute transformed difference (SATD) using colour images in the citrus grove. Comput. Electron. Agric. 2016, 124, 243–253. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.









