1. Introduction
In recent years, with the rapid economic development of the forest and fruit industries, peach trees have been growing in scale and yield as one of the most popular. However, there is room for improvement in the cultivation quality and technical level of peach trees. In the growth cycle of peach trees, in order to improve the yield and quality of peach fruits, in addition to doing well in soil management, fertilization, irrigation, and pest and disease prevention and control, flower management is a crucial link. Studies have shown that under good pollination conditions, the final yield of peach fruits is positively correlated with the flowering quantity [
1]. Therefore, the flowering quantity of peach trees can be used as an important indicator for yield prediction, which can help to simplify the arrangement of harvesting labor, other resources (such as orchard platforms), and post-harvest processing strategies while providing a quantitative basis for rational planning of harvesting [
2]. Meanwhile, the yield measurement of peach trees can help fruit farmers to grasp the growth status of fruit trees and estimate the economic benefits of orchards. In addition, the yield measurement of peach trees can be used to conduct quantitative analysis of possible losses and provide evidence support for loss assessment in agricultural insurance [
3]. Due to the annual changes in flowering quantity and climatic conditions (temperature, precipitation, etc.) during the flowering period, the harvest period yield of the same orchard varies in different years. Therefore, it is necessary to establish a relationship model between flowering quantity, climatic factors, and yield in order to predict the yield from the flowering quantity.
The thinning of peach trees has a significant impact on the yield, quality, and health of peach fruits; thus, choosing a suitable thinning method is an important part of peach flower management. Existing studies have shown that proper thinning can improve the yield and quality of fruits [
4,
5,
6,
7], directly affecting their market value. The traditional thinning method relies on manual operation, which is time-consuming and labor-intensive. There are two kinds of thinning methods with higher efficiency: chemical thinning and physical thinning [
8,
9]. Chemical thinning is restricted by factors such as weather, spraying time, tree age, tree vigor, etc. [
10]. With the improvement of people’s living standards and the attention to fruit safety, the demand for reducing or avoiding the use of pesticides and other inorganic substances in fruit production is greatly increasing. Therefore, physical thinning is expected to become the mainstream trend in the future [
11]. However, using ropes or other striking devices for mechanical thinning can easily cause damage to the tree or poor thinning effect. Therefore, automatic and precise thinning is expected to be the future development trend, and it is urgent to develop a fast and accurate method for detecting the flowering quantity.
Early studies used traditional image processing algorithms to detect and identify fruit tree flowers; [
12] was the first to use computer vision technology to detect flowers, which was based on color thresholding but was only applicable to controlled situations. Krikeb et al. [
13] used thresholding and morphological methods to identify flowers and predict the timing and intensity of full bloom. Hočevar et al. [
14] used thresholding in the HSL color space to identify apple flowers. Wang [
15] used fixed color thresholds to separate flowers, then refined the segmentation results via SVM classification. Wang [
16] used pixel color thresholding, then used accelerated robust features for SVM classification to segment mango flowers; however, the applicability of this approach is limited by the changes in illumination conditions and the occlusion of stems, leaves, or other flowers. Most of these methods rely on manually designed features, meaning that their overall performance can only achieve good results in relatively controlled environments, such as artificial lighting on a night curtain-covered background. Flower detection based on traditional image processing algorithms is easily affected by environmental factors such as lighting, shadows, etc., and has poor applicability [
17].
Other studies have attempted flower detection based on deep learning; [
18] was the first to use CNN for apple flower detection, which was superior to the color-based method, although limited by the inherent inaccuracy of its superpixel segmentation and network architecture. Dias et al. [
19] used the DeepLab+RGR model to identify peach and pear flowers. Sun et al. [
20] proposed a method using the DeepLab-ResNet network to detect apple, peach, and pear flowers; however, the recognition effect of peach flowers in this method was poor. Wang et al. [
21,
22] proposed a fully convolutional network-based apple flower segmentation method. Tian et al. [
23] successfully applied the single-stage SSD algorithm to detect apple flowers, achieving an average detection accuracy of 87.40%. Farjon et al. [
24] used the deep learning-based Faster R-CNN algorithm for object detection, and employed image processing techniques to cluster and count the detected flowers, effectively realizing the automatic estimation of the number of apple flowers. However, these deep learning-based methods are mostly used for detecting flowers in single images. Wu et al. [
25] and Tian et al. [
26] proposed apple flower detection methods based on the YOLOv4 and MASU R-CNN models, respectively, both of which achieved high detection accuracy. Ye et al. [
27] improved the YOLOv5 model by adding a CA attention mechanism and the feature fusion structure to detect pear flowers. Shang et al. [
28] used the lightweight YOLO v5s model and added a context extraction module (CAM) to detect apple flowers of various colors under different weather and lighting conditions. Tao et al. [
29] proposed a method based on an RGBD camera and convolutional neural network that integrated the attention mechanism and multi-scale feature fusion to detect peach flower density.
As can be seen from the above literature review, deep learning has shown great potential in fruit tree flower recognition and detection and has effectively improved detection performance compared with traditional methods. However, compared with other fruit tree flowers, there are few related recognition studies on peach flowers. Although deep learning-based models have relevant research in the field of peach flower detection, the current research on high-precision classification and detection of peach flowers with different morphologies has not achieved effective results. Taking
Figure 1 as an example, the reasons that hinder the development of this process are as follows: (1) peach flower recognition belongs to complex background small object recognition, which is easily affected by the background of branches, leaves, ground, and other fruit trees; (2) peach flowers are divided into three morphologies, namely, buds, flowers, and fallen flowers, meaning that there can be three morphologies of flowers in a stage at the same time, requiring all three morphologies to be classified and recognized; and (3) there are many peach flowers on a peach tree, and there are serious occlusion problems between flowers, meaning that the original flower segmentation method cannot accurately segment all complete flower morphologies.
To address the above problems, this paper proposes a method based on improved YOLOv5s for segmentation of peach flowers with different morphologies and detection of peach blossom quantity. The main contributions of this paper are as follows:
- (1)
A peach flower image dataset is constructed (a total of 5000 images) to provide data support for the training and validation of the peach flower detection model.
- (2)
An additional layer dedicated to small object detection is added. Because it is fused with shallower feature maps, the new feature map has strong semantic information and precise location information, which can be used to improve the detection rate of buds.
- (3)
The combination of a context extraction module (CAM) and a feature refinement module (FSM) is adopted. The CAM module is used to extract context information, while feature refinement through the FSM module can further suppress conflicting information and improve the accuracy of flower detection.
- (4)
To improve model performance, the K-means++ algorithm is used to help the initial clustering center escape the local optimum and reach the global optimum, while the SIoU loss function replaces the original CIoU function in order to more fully consider the influence of the vector direction between the ground truth box and the predicted box while providing faster model convergence.
4. Discussion
The number of flowers on fruit trees is important for determining the thinning intensity and predicting the yield. Currently, the most common method for estimating the number of flowers is manual inspection, which is time-consuming, labor-intensive, and prone to errors. With the successful application of computer vision and deep learning in agriculture, researchers have started to use new technologies to obtain the flowering density of fruit trees. However, peach flowers have higher flowering density and smaller color variation among different types of flower morphologies compared with other fruit tree flowers. At present, there are few studies on peach flower recognition in the field of fruit tree flower recognition. The main methods are to use drones to aerially photograph a peach orchard during the flowering period to roughly identify the flower density [
39] or to recognize single-type peach flowers [
29]. There is a lack of methods able to recognize peach flowers with different growth morphologies. In this study, we use an improved YOLOv5s model to recognize three different peach flower morphologies and count the number of flowers.
Our experimental results show that the method proposed in this paper provides better AP values compared with current mainstream object detection algorithms for the recognition of three different peach blossom shapes, namely, buds, flowers, and falling flowers, with values of 87.5%, 89.8%, and 93.3%, respectively. The final mAP value for flower recognition reaches 90.2%, which can meet the requirements of monitoring peach tree flowering quantity.
The purpose of this study is to provide an effective method for obtaining more intuitive and accurate data sources for peach yield prediction and to lay a theoretical foundation for the development of thinning robots. Thinning is a highly labor-intensive task, and manual thinning makes it difficult to meet the thinning requirements of large orchards. However, the recognition performance of the model proposed in this study was only verified on the existing dataset, and further verification of peach blossoms from different regions is needed in the later stage to improve the generalization ability of the model. In the future, the model’s performance on embedded devices could be improved, and the network structure could be further optimized to achieve real-time detection and evaluation of peach blossom quantity on mobile devices when making thinning decisions.