The agricultural scene is a typical unstructured scene, which is intricate and heavily affected by sunlight, weather, and other factors. Agricultural segmentation targets are generally small in size and heavily obstructed. At the same time, image segmentation in agricultural scenes has strong application scenarios, such as blooming intensity estimation, which refers to the estimation of the density and intensity of blooms, fruit yield estimation, fruit harvesting positioning, and so on. Currently, CNNs dominate semantic segmentation of agricultural scenes due to the significant computational constraints of using the Transformer module. However, CNNs have several disadvantages, such as limited effective receptive fields and the inability to capture global information, which significantly reduce their segmentation accuracy in complex agricultural scenes. In addition, the simple upsampling process used in CNNs can result in blurred segmentation edges and inferior performance. This paper presents a new semantic segmentation algorithm based on SegFormer: PD-SegNet(Powerful Decoder SegFormer Network), which balances accuracy and computational efficiency and combines dynamic kernel self-renewal with edge-aware optimization. The proposed algorithm demonstrates outstanding performance in two typical agricultural scenarios: apple blossom and apple fruit segmentation detection and sets a new state-of-the-art (SOTA) on the MinneApple Apple segmentation dataset. Experimental results demonstrate that the proposed method outperforms the baseline method in the segmentation of complex small targets. This algorithm can optimize the semantics segmentation of small targets in complex scenes and contributes to the development of smart agriculture.
As deep learning has been successfully applied in various domains, it has recently received considerable research attention for decades, making it possible to efficiently and intelligently detect crop pests. Nevertheless, the detection of pest objects is still challenging due to the lack of discriminative features and pests’ aggregation behavior. Recently, intersection over union (IoU)-based object detection has attracted much attention and become the most widely used metric. However, it is sensitive to small-object localization bias; furthermore, IoU-based loss only works when ground truths and predicted bounding boxes are intersected, and it lacks an awareness of different geometrical structures. Therefore, we propose a simple and effective metric and a loss function based on this new metric, truncated structurally aware distance (TSD). Firstly, the distance between two bounding boxes is defined as the standardized Chebyshev distance. We also propose a new regression loss function, truncated structurally aware distance loss, which consider the different geometrical structure relationships between two bounding boxes and whose truncated function is designed to impose different penalties. To further test the effectiveness of our method, we apply it on the Pest24 small-object pest dataset, and the results show that the mAP is 5.0% higher than other detection methods.