Instance Segmentation Method for ‘Yuluxiang’ Pear at the Fruit Thinning Stage Based on Improved YOLOv8n-seg Model
Abstract
1. Introduction
2. Materials and Methods
2.1. Dataset
2.1.1. Data Acquisition
2.1.2. Data Processing
2.2. Research Method
2.2.1. YOLOv8 Architecture
2.2.2. Improved YOLOv8n-Seg Network Architecture
2.2.3. C2f-Dual Module
2.2.4. SCSA Module
2.2.5. WIoU Loss Function
3. Experiments and Results
3.1. Experimental Setup
3.1.1. Implementation Environment and Training Parameters
3.1.2. Evaluation Metrics
3.2. Experiments
3.2.1. Impact of Integrating the C2f-Dual Module at Different Locations
3.2.2. Analysis of SCSA Module Integration Effects at Different Detection Layers
3.2.3. Comparative Experiments with Different Loss Functions
3.2.4. Ablation Experiment and Result Analysis
3.2.5. Heatmap Analysis
3.2.6. Comparative Analysis of Various Models
3.2.7. Visual System Design and Edge Deployment
4. Discussion
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Xue, L. Intensive Planting and High Yield Cultivation Techniques for Yuluxiang Pear in Hilly and Mountainous Regions. Plant Dis. Pests 2025, 16, 31–33. [Google Scholar]
- Zhang, E. Planting and Management Technology of Yulu Fragrant Pear in Yuanqu County. Agric. Technol. Equip. 2023, 188–190. (In Chinese) [Google Scholar]
- Ma, X.; Su, X.; Qiao, J.; Zhang, X.; Liu, X. Green and High-Efficiency Cultivation Techniques of ‘Yuluxiang’ Pear in Shenmu, Shaanxi Province. North. Fruits 2025, 28–31. (In Chinese) [Google Scholar]
- Long, Y.; Yang, Z.; He, M. Recognizing apple targets before thinning using improved YOLOv7. Trans. Chin. Soc. Agric. Eng. 2023, 39, 191–199. (In Chinese) [Google Scholar]
- Luo, X.; Liao, J.; Hu, L.; Zhou, Z.; Zhang, Z.; Zang, Y.; Wang, P.; He, J. Research progress of intelligent agricultural machinery and practice of unmanned farm in China. J. South China Agric. Univ. 2021, 42, 8–17. (In Chinese) [Google Scholar]
- Henila, M.; Chithra, P. Segmentation using fuzzy cluster-based thresholding method for apple fruit sorting. IET Image Process. 2020, 14, 4178–4187. [Google Scholar] [CrossRef]
- Marlinda, L.; Fatchan, M.; Widiyawati, W.; Aziz, F.; Indrarti, W. Segmentation of Mango Fruit Image Using Fuzzy C-Means. Sink. J. Dan Penelit. Tek. Inform. 2021, 5, 275–281. [Google Scholar] [CrossRef]
- Sreekanth, G.; Thangaraj, P.; Kirubakaran, S. Fruit detection using improved K-means algorithm. J. Crit. Rev. 2020, 7, 5–6. [Google Scholar] [CrossRef]
- Tang, Y.; Zhou, H.; Wang, H.; Zhang, Y. Fruit detection and positioning technology for a Camellia oleifera C. Abel orchard based on improved YOLOv4-tiny model and binocular stereo vision. Expert Syst. Appl. 2023, 211, 118573. [Google Scholar] [CrossRef]
- Venkateswarlu, A.; Veeralakshmi, P. Improved accuracy for finding fruit quality through ripening using convolution neural network, artificial neural networks in comparison with support vector machine. AIP Conf. Proc. 2025, 3267, 020071. [Google Scholar]
- Chen, J.; Ji, C.; Zhang, J.; Feng, Q.; Li, Y.; Ma, B. A method for multi-target segmentation of bud-stage apple trees based on improved YOLOv8. Comput. Electron. Agric. 2024, 220, 108876. [Google Scholar] [CrossRef]
- Naranjo-Torres, J.; Mora, M.; Hernández-García, R.; Barrientos, R.J.; Fredes, C.; Valenzuela, A. A review of convolutional neural network applied to fruit image processing. Appl. Sci. 2020, 10, 3443. [Google Scholar] [CrossRef]
- Varjão, J.O.R.; Botelho, G.M.; Almeida, T.; Martins, G.; Silva, W. Citrus fruit quality classification using support vector machines. Int. J. Advanc. Eng. Res. Sci. 2019, 6, 59–65. [Google Scholar] [CrossRef]
- Song, H.; Jiang, M.; Wang, Y.; Song, L. Efficient detection method for young apples based on the fusion of convolutional neural network and visual attention mechanism. Trans. Chin. Soc. Agric. Eng. 2021, 37, 297–303. (In Chinese) [Google Scholar]
- Zhang, T.; Wu, F.; Wang, M.; Chen, Z.; Li, L.; Zou, X. Grape-Bunch Identification and Location of Picking Points on Occluded Fruit Axis Based on YOLOv5-GAP. Horticulturae 2023, 9, 498. [Google Scholar] [CrossRef]
- Wenfeng, Z.; Yuanjue, H.; Minyue, Z.; Zhenyuan, L.; Zitao, L.; Jiajun, H. Multi-task Visual Perception Method in Dragon Orchards Based on OrchardYOLOP. Nongye Jixie Xuebao/Trans. Chin. Soc. Agric. Mach. 2024, 55, 160–170. [Google Scholar]
- Li, Q.; Jia, W.; Sun, M.; Hou, S.; Zheng, Y. A novel green apple segmentation algorithm based on ensemble U-Net under complex orchard environment. Comput. Electron. Agric. 2021, 180, 105900. [Google Scholar] [CrossRef]
- Shi, J.; Li, H.; Jing, L.; Xiao, Z.; Zhou, H.; Zhang, Z.; Xu, S. ITC-YOLO: An improved YOLOv8 model for individual tree crown segmentation in complex forest environments. Ecol. Indic. 2025, 180, 114355. [Google Scholar] [CrossRef]
- Zhou, J.; Chen, M.; Zhang, M.; Zhang, Z.; Zhang, Y.; Wang, M. Improved YOLOv8 for multi-colored apple fruit instance segmentation and 3D localization. Artif. Intell. Agric. 2026, 16, 381–396. [Google Scholar] [CrossRef]
- Varghese, R.; Sambath, M. Yolov8: A novel object detection algorithm with enhanced performance and robustness. In Proceedings of the 2024 International Conference on Advances in Data Engineering and Intelligent Computing Systems (ADICS); IEEE: Piscataway, NJ, USA, 2024; pp. 1–6. [Google Scholar]
- Zhong, J.; Chen, J.; Mian, A. DualConv: Dual convolutional kernels for lightweight deep neural networks. IEEE Trans. Neural Netw. Learn. Syst. 2022, 34, 9528–9535. [Google Scholar] [CrossRef] [PubMed]
- Si, Y.; Xu, H.; Zhu, X.; Zhang, W.; Dong, Y.; Chen, Y.; Li, H. SCSA: Exploring the synergistic effects between spatial and channel attention. arXiv 2024, arXiv:2407.05128. [Google Scholar] [CrossRef]
- Tong, Z.; Chen, Y.; Xu, Z.; Yu, R. Wise-IoU: Bounding box regression loss with dynamic focusing mechanism. arXiv 2023, arXiv:2301.10051. [Google Scholar]
- Selvaraju, R.R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the Proceedings of the IEEE International Conference on Computer Vision; IEEE: Piscataway, NJ, USA, 2017; pp. 618–626. [Google Scholar]
- Liang, X.; Wei, Z.; Chen, K. A method for segmentation and localization of tomato lateral pruning points in complex environments based on improved YOLOV5. Comput. Electron. Agric. 2025, 229, 109731. [Google Scholar] [CrossRef]
- Zhu, G.; Luo, Z.; Ye, M.; Xie, Z.; Luo, X.; Hu, H.; Wang, Y.; Ke, Z.; Jiang, J.; Wang, W. Instance Segmentation of Sugar Apple (Annona squamosa) in Natural Orchard Scenes Using an Improved YOLOv9-seg Model. Agriculture 2025, 15, 1278. [Google Scholar] [CrossRef]
- Xue, S.; Li, Z.; Wang, D.; Zhu, T.; Zhang, B.; Ni, C. YOLO-ALDS: An instance segmentation framework for tomato defect segmentation and grading based on active learning and improved YOLO11. Comput. Electron. Agric. 2025, 238, 110820. [Google Scholar] [CrossRef]
- Alzahrani, A.S.; Iqbal, A.; Zafar, W.; Husnain, G. Swin-YOLO-SAM: A hybrid Transformer-based framework integrating Swin Transformer, YOLOv12, and SAM-2.1 for automated identification and segmentation of date palm leaf diseases. Front. Plant Sci. 2025, 16, 1666374. [Google Scholar] [CrossRef]













| Data Set | Training Set | Validation Set | Test Set | Total Quantity |
|---|---|---|---|---|
| Original image | 1200 | 343 | 172 | 1715 |
| Augmented image | 4800 | 0 | 0 | 4800 |
| Total quantity | 6000 | 343 | 172 | 6515 |
| Training Parameter | Value |
|---|---|
| Input Image Size | 640 × 640 |
| Epochs | 200 |
| Batch Size | 128 |
| Optimizer | SGD |
| Initial Learning Rate | 0.01 |
| Weight Decay Coefficient | 0.0005 |
| Augment | True |
| Hue Shift (hsv_h) | 0.015 |
| Saturation Shift (hsv_s) | 0.7 |
| Brightness Shift (hsv_v) | 0.4 |
| Translation (translate) | 0.1 |
| Scale (scale) | 0.5 |
| Horizontal Flip (fliplr) | 0.5 |
| Mosaic (mosaic) | 1.0 |
| Seed | 0 |
| Models | Detection | Segmentation | GFLOPs | Params | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| P /% | R /% | mAP50 /% | mAP75 /% | mAP50:95 /% | P /% | R /% | mAP50 /% | mAP75 /% | mAP50:95 /% | |||
| YOLOv8n-seg | 93.4 | 87.7 | 93.0 | 78.5 | 67.4 | 92.5 | 86.5 | 92.1 | 72.5 | 62.1 | 12.0 | 3.26 × 106 |
| YOLOv8n-Db | 93.9 | 88.9 | 94.6 | 82.4 | 69.6 | 93.1 | 88.2 | 93.6 | 75.0 | 64.4 | 11.6 | 3.10 × 106 |
| YOLOv8n-Dn | 94.1 | 88.7 | 94.7 | 81.2 | 69.1 | 93.4 | 88.7 | 93.9 | 75.1 | 64.1 | 11.7 | 3.11 × 106 |
| YOLOv8n-Dbn | 94.1 | 89.1 | 94.8 | 82.5 | 69.7 | 93.7 | 88.6 | 94.0 | 75.3 | 64.5 | 11.3 | 2.96 × 106 |
| Models | Detection | Segmentation | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| P /% | R /% | mAP50 /% | mAP75 /% | mAP50:95 /% | P /% | R /% | mAP50 /% | mAP75 /% | mAP50:95 /% | |
| YOLOv8n-seg | 93.4 | 87.7 | 93.0 | 78.5 | 67.4 | 92.5 | 86.5 | 92.1 | 72.5 | 62.1 |
| YOLOv8n-L | 92.5 | 89.2 | 94.6 | 81.2 | 69.2 | 93.7 | 87.5 | 94.2 | 75.5 | 64.5 |
| YOLOv8n-M | 93.5 | 89.0 | 95.0 | 81.3 | 69.1 | 93.5 | 87.9 | 94.3 | 75.1 | 64.3 |
| YOLOv8n-S | 94.1 | 89.4 | 94.7 | 81.6 | 69.3 | 93.7 | 88.5 | 94.3 | 76.0 | 64.7 |
| YOLOv8n-all | 93.9 | 88.9 | 94.7 | 81.5 | 69.0 | 93.9 | 88.1 | 94.2 | 75.6 | 64.7 |
| Models | A | B | C | Detection | Segmentation | GFLOPs | Params | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| P /% | R /% | mAP50 /% | mAP75 /% | mAP50:95 /% | P /% | R /% | mAP50 /% | mAP75 /% | mAP50:95 /% | ||||||
| 1 | × | × | × | 93.4 | 87.7 | 93.0 | 78.5 | 67.4 | 92.5 | 86.5 | 92.1 | 72.5 | 62.1 | 12.0 | 3.26 × 106 |
| 2 | √ | × | × | 94.1 | 89.1 | 94.8 | 82.5 | 69.7 | 93.7 | 88.6 | 94.0 | 75.3 | 64.5 | 11.3 | 2.96 × 106 |
| 3 | × | √ | × | 94.1 | 89.4 | 94.7 | 81.6 | 69.3 | 93.7 | 88.5 | 94.3 | 76.0 | 64.7 | 12.0 | 3.27 × 106 |
| 4 | × | × | √ | 94.6 | 89.2 | 95.3 | 82.2 | 69.7 | 93.0 | 89.1 | 94.6 | 77.1 | 65.0 | 12.0 | 3.26 × 106 |
| 5 | √ | √ | × | 93.9 | 88.7 | 94.9 | 79.7 | 69.5 | 94.4 | 88.9 | 93.8 | 74.5 | 64.3 | 11.3 | 2.97 × 106 |
| 6 | √ | × | √ | 94.4 | 88.9 | 94.6 | 80.9 | 67.9 | 94.6 | 88.5 | 94.4 | 75.6 | 64.2 | 11.7 | 3.11 × 106 |
| 7 | × | √ | √ | 93.8 | 89.9 | 94.8 | 79.3 | 68.3 | 93.3 | 89.9 | 94.2 | 76.9 | 64.9 | 12.0 | 3.27 × 106 |
| 8 | √ | √ | √ | 94.7 | 90.2 | 95.6 | 83.2 | 70.3 | 95.0 | 89.9 | 94.8 | 78.2 | 65.3 | 11.3 | 2.97 × 106 |
| Models | Detection | Segmentation | GFLOPs | Params | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| P /% | R /% | mAP50 /% | mAP75 /% | mAP50:95 /% | P /% | R /% | mAP50 /% | mAP75 /% | mAP50:95 /% | |||
| YOLOv5n-seg | 90.9 | 78.5 | 85.9 | 72.1 | 62.4 | 90.8 | 77.6 | 84.3 | 68.5 | 57.5 | 6.7 | 1.88 × 106 |
| YOLOv8n-seg | 93.4 | 87.7 | 93.0 | 78.5 | 67.4 | 92.5 | 86.5 | 92.1 | 72.5 | 62.1 | 12.0 | 3.26 × 106 |
| YOLOv9c-seg | 95.4 | 90.3 | 96.1 | 90.8 | 79.2 | 95.5 | 90.5 | 96.2 | 85.5 | 70.9 | 157.6 | 2.76 × 107 |
| YOLO11n-seg | 92.5 | 90.4 | 94.4 | 82.6 | 69.3 | 93.4 | 89.1 | 94.4 | 77.8 | 64.7 | 10.4 | 2.84 × 106 |
| YOLO12n-seg | 93.6 | 90.7 | 95.2 | 83.1 | 69.9 | 93.3 | 89.9 | 94.2 | 77.6 | 64.5 | 10.4 | 2.82 × 106 |
| YOLOv8n-DSW | 94.7 | 90.2 | 95.6 | 83.2 | 70.3 | 95.0 | 89.9 | 94.8 | 78.2 | 65.3 | 11.3 | 2.97 × 106 |
| Models | Preprocess Time/ms | Inference Time/ms | Postprocess Time/ms | FPS | mAP50 (box)/% | mAP50:95 (box)/% | mAP50 (Mask)/% | mAP50:95 (Mask)/% |
|---|---|---|---|---|---|---|---|---|
| YOLOv8n-seg | 14.31 | 26.70 | 28.03 | 14.48 | 91.0 | 65.9 | 90.1 | 60.7 |
| YOLOv8n-DSW | 13.75 | 25.17 | 27.12 | 15.14 | 93.5 | 68.8 | 92.7 | 63.9 |
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.
Share and Cite
Hao, W.; Zhang, X.; Liang, H.; Shi, Y.; Chen, L.; Tang, B.; Yang, S.; Zhang, Y.; Zhang, Z. Instance Segmentation Method for ‘Yuluxiang’ Pear at the Fruit Thinning Stage Based on Improved YOLOv8n-seg Model. Agriculture 2026, 16, 346. https://doi.org/10.3390/agriculture16030346
Hao W, Zhang X, Liang H, Shi Y, Chen L, Tang B, Yang S, Zhang Y, Zhang Z. Instance Segmentation Method for ‘Yuluxiang’ Pear at the Fruit Thinning Stage Based on Improved YOLOv8n-seg Model. Agriculture. 2026; 16(3):346. https://doi.org/10.3390/agriculture16030346
Chicago/Turabian StyleHao, Weihao, Xi Zhang, Hao Liang, Yaozong Shi, Lihang Chen, Bo Tang, Sheng Yang, Yanqing Zhang, and Zhiyong Zhang. 2026. "Instance Segmentation Method for ‘Yuluxiang’ Pear at the Fruit Thinning Stage Based on Improved YOLOv8n-seg Model" Agriculture 16, no. 3: 346. https://doi.org/10.3390/agriculture16030346
APA StyleHao, W., Zhang, X., Liang, H., Shi, Y., Chen, L., Tang, B., Yang, S., Zhang, Y., & Zhang, Z. (2026). Instance Segmentation Method for ‘Yuluxiang’ Pear at the Fruit Thinning Stage Based on Improved YOLOv8n-seg Model. Agriculture, 16(3), 346. https://doi.org/10.3390/agriculture16030346
