Dense agricultural crop detection method and system based on deep learning

By combining deep learning methods with RGB and Depth images, and using the lightweight CNN MobileNet model to optimize feature fusion and loss function training, the segmentation problem in high-resolution intensive agricultural scenarios was solved, achieving clear fruit segmentation boundaries and real-time, efficient detection of intensive agricultural crops.

CN121746904APending Publication Date: 2026-03-27YANGZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing segmentation models suffer from low computational efficiency, high memory consumption, and loss of detail in high-resolution intensive agricultural scenarios, making it difficult to meet real-time requirements. Furthermore, they do not achieve high-precision segmentation results in complex agricultural scenarios.

Method used

We employ the lightweight CNN network MobileNet model, combined with RGB and Depth images, to generate high-resolution probabilistic maps of dense agricultural crops through deep fusion, detail prediction, and mutually guided fusion algorithms. We optimize feature fusion using axial attention and residual connections, and conduct supervised training by setting a loss function.

Benefits of technology

It achieves clear fruit segmentation boundaries in high-resolution intensive agriculture scenarios, with a small model size, making it suitable for embedded platforms and improving segmentation accuracy and real-time performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121746904A_ABST
    Figure CN121746904A_ABST
Patent Text Reader

Abstract

The invention discloses an intensive agricultural crop detection method and system based on deep learning. The method comprises the following steps: extracting different branch features of a dense agricultural image through a MobileNet pre-training model; obtaining a dense agricultural image rough prediction map, a dense agricultural image detail prediction map and a dense agricultural image prediction map model; and by sampling the rough prediction map, the detail prediction map and the prediction map to the size of an original image, constructing a loss function calculation error, and using the obtained error to reversely update the dense agricultural segmentation model. And inputting the dense agricultural image into the updated model, and obtaining and outputting a corresponding dense agricultural image segmentation prediction map. According to the method, the capturing capability of hidden crops in dense agriculture is enhanced, and the light weight of the model is kept while the segmentation precision is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and digital image processing, and particularly to a method and system for detecting dense agricultural crops based on deep learning. Background Technology

[0002] Image detection technology, as an important research direction in the field of computer vision, has been widely applied in areas such as autonomous driving, security monitoring, and medical image analysis. Its core task is to automatically identify and locate target objects from images, involving techniques such as object detection, bounding box regression, and image segmentation. With the rise of deep learning, especially the application of convolutional neural networks (CNNs), image detection technology has made significant progress. By training on large-scale image data, models can efficiently learn image features and complete target recognition and classification.

[0003] In agricultural production, image segmentation technology is particularly important for the intelligent management of fruit tree planting. However, the complexity of agricultural scenarios poses a severe challenge to traditional segmentation methods: the colors of fruits, leaves, and branches in fruit tree images are similar, which makes the threshold method prone to segmentation errors due to brightness similarity; dynamic lighting conditions make the contrast between fruits and background unstable; and occlusion by branches and leaves and complex background noise further interfere with feature extraction.

[0004] In addition, existing segmentation models are mostly designed for low-resolution images. When applied to high-resolution agricultural images, they face three major bottlenecks: low computational efficiency, high memory consumption, and loss of detail. High-resolution input causes the computational cost of convolution to increase quadratically, making it difficult to meet real-time requirements; the large number of parameters exceeds the carrying capacity of edge devices; and downsampling operations weaken key features such as fruit texture.

[0005] Although current research attempts to improve crop segmentation through techniques such as lightweight networks, attention mechanism optimization, and knowledge distillation, breakthroughs are still needed for high-precision, real-time crop segmentation technology in complex agricultural scenarios. Summary of the Invention

[0006] Purpose of the invention: To address the problem of incorrect region segmentation caused by excessive differences in image scale and viewpoint, this invention proposes a deep learning-based method and system for detecting dense agricultural crops.

[0007] Technical solution:

[0008] This invention proposes a deep learning-based method for dense agricultural crop detection, comprising:

[0009] S1: Obtain a dense agricultural image set with crop annotation information from the existing dataset. Select high-resolution RGB, low-resolution RGB, and low-resolution depth formats of the same image and input them into the MobileNet model to obtain several sets of features corresponding to the high-resolution RGB images. Several sets of features corresponding to low-resolution RGB images Several sets of features corresponding to low-resolution depth images ,in For feature indexes, there is a one-to-one correspondence with feature resolutions. Each set of features includes feature resolution and number of channels. The resolution of high-resolution RGB images is greater than that of low-resolution RGB images and low-resolution Depth images.

[0010] S2: Establish a crop segmentation model, including:

[0011] A coarse prediction module is used to predict pairs of objects with the same resolution. , The features are obtained using a deep fusion algorithm to acquire the corresponding coarse prediction features, which are then processed to obtain a coarse prediction map.

[0012] The detail prediction module is used to... Input the data into the MobileNet model to obtain detailed prediction features, and process them to obtain a detailed prediction map.

[0013] The guided fusion module is used to generate fusion features based on the coarse prediction map and the detailed prediction map through a mutual guided fusion algorithm. The fusion features are used by the prediction head to generate a probability map of a specified resolution, which is used as the output of the crop segmentation model.

[0014] S3: Supervised training of the crop segmentation model using the existing dataset, adjusting the spatial dimensions of coarse prediction features, detailed prediction features, and fused features, setting the loss function, and inversely updating the trainable parameters of the crop segmentation model;

[0015] S4: Acquire the image to be detected, input the image to be detected into the updated crop segmentation model, and obtain a probability map output with the same size as the image to be detected, so as to realize the detection of dense agricultural crops.

[0016] Furthermore, the deep fusion algorithm includes:

[0017] The first Group Depth Features With RGB features Element-wise multiplication generates cross-modal interaction features, which are then processed through axial attention. Spatial correlation is extracted to obtain attention weights; where i satisfies the relationship between i and the feature resolution n. ;

[0018] The attention weights are used to adjust the depth features, and then added to the depth features to form a fused feature. , is represented as:

[0019]

[0020] By compressing the excitation layer Channel-level dynamic filtering is applied to the fused features to output coarse predicted features. , is represented as:

[0021] .

[0022] Furthermore, the processing yields a coarse prediction map, including:

[0023] For each group and The deep fusion algorithm and coarse prediction were used sequentially. After doubling the upsampling, the sum is expressed by the formula:

[0024]

[0025]

[0026] in, This indicates a deep fusion algorithm. This indicates that the input has been upsampled by a factor of two. This represents an operational unit consisting of a 3×3 convolutional layer, a batch normalized layer, and a modified linear unit activation function in that order.

[0027] The above process from Initially, with each depth fusion, the value of i is decremented by one, representing the coarse features. Enter 3 Three convolutional layers are used to obtain a rough prediction image. .

[0028] Furthermore, the acquisition of detailed prediction features includes:

[0029] The detail prediction module will specify the range of RGB features. The RGB features are input into the MobileNet model and pre-trained using MobileNet-V2. With Depth features Upsampling followed by convolution, batch normalization, and ReLU activation are used to extract detailed output features. The expression is:

[0030]

[0031]

[0032] The above process from Initially, with each depth fusion, the value of i is decremented by one, until the top-level detailed features are obtained. As a feature for detail prediction.

[0033] Furthermore, the processing yields a detailed prediction map, including:

[0034] The detailed prediction features The input is fed into a prediction head consisting of a convolutional layer, which generates a prediction map with the same resolution as the input image. Each pixel value in the prediction map represents the prediction probability that the location belongs to the target detail region. The prediction probability is normalized to the [0,1] interval by the Sigmoid activation function to obtain the detail prediction map.

[0035] Furthermore, the mutual guidance fusion algorithm includes:

[0036]

[0037]

[0038]

[0039] in, This indicates the mutual guidance and fusion of Algorithm A. This indicates the mutual guidance and fusion B algorithm;

[0040] The mutually guided fusion A algorithm includes: processing coarse features Detail features Attention enhancement, fusion, and convolution are performed separately to obtain multi-scale interaction features. The attention mechanism is applied to the multi-scale interaction features and combined with residual connections to generate multi-scale interaction attention. The formula is expressed as:

[0041]

[0042]

[0043] The mutually guided fusion B algorithm includes: integrating the detailed features of the current layer... Deep fusion features of upsampling By performing fusion and convolution, multi-scale interactive features are obtained. An attention mechanism is applied to the multi-scale interaction features and combined with residual connections to generate multi-scale interaction attention. The formula is expressed as:

[0044]

[0045] .

[0046] Furthermore, adjusting the spatial dimensions of the coarse prediction features, detailed prediction features, and fused features includes:

[0047] rough features Detail features and fusion features The spatial dimensions of the coarse truth map, detailed truth map, and truth map of the existing dataset are adjusted through upsampling operations.

[0048] Furthermore, the setting of the loss function includes:

[0049] Segmentation loss is calculated based on each prediction map and the corresponding ground map. Each prediction map includes a coarse prediction map generated by Gaussian blurring and distance transformation of the ground map, a detailed prediction map obtained by subtracting the coarse supervision signal from the ground map, and a complete prediction map. Coarse prediction loss, detailed prediction loss and fusion prediction loss are obtained.

[0050] The three types of losses are summed to form a total loss function, and all trainable parameters of the intensive agriculture segmentation model are updated based on this total loss using the backpropagation algorithm. The expression is:

[0051]

[0052] in, Represents the binary cross-entropy function. This represents a cross-joint function.

[0053] Furthermore, the image to be detected is acquired through the following devices: an image acquisition device with a resolution of not less than 1024×1024 pixels; and a storage device that ensures the image quality meets the model input requirements.

[0054] This invention also proposes a deep learning-based intensive agricultural crop detection system, comprising:

[0055] The feature extraction module is used to obtain a dense agricultural image set with crop annotation information from the existing dataset. It selects high-resolution RGB, low-resolution RGB, and low-resolution depth forms of the same image and inputs them into the MobileNet model to obtain several sets of features corresponding to the high-resolution RGB image. Several sets of features corresponding to low-resolution RGB images Several sets of features corresponding to low-resolution depth images ,in For feature indexes, there is a one-to-one correspondence with feature resolutions. Each set of features includes feature resolution and number of channels. The resolution of high-resolution RGB images is greater than that of low-resolution RGB images and low-resolution Depth images.

[0056] The crop segmentation model, used for the detection of intensive agricultural crops, includes the following sub-modules:

[0057] A coarse prediction submodule is used to predict pairs of objects with the same resolution. , The features are obtained using a deep fusion algorithm to acquire the corresponding coarse prediction features, which are then processed to obtain a coarse prediction map.

[0058] The detail prediction submodule is used to... Input the data into the MobileNet model to obtain detailed prediction features, and process them to obtain a detailed prediction map.

[0059] The guidance fusion submodule is used to generate fusion features based on the coarse prediction map and the detailed prediction map through a mutual guidance fusion algorithm. The fusion features are used to generate a probability map of a specified resolution via the prediction head, which is then used as the output of the crop segmentation model.

[0060] The model training submodule is used to supervise the training of the crop segmentation model using the existing dataset, adjust the spatial size of coarse prediction features, detailed prediction features, and fused features, set the loss function, and update the trainable parameters of the crop segmentation model in reverse.

[0061] The segmentation module is used to acquire the image to be detected. The image to be detected is input into the updated crop segmentation model to obtain a probability map output with the same size as the image to be detected, thereby realizing the detection of dense agricultural crops.

[0062] Beneficial effects:

[0063] This invention fuses RGB and depth images, employing branch supervision to ensure clear crop segmentation in intensive agricultural scenarios. This addresses the problem of existing segmentation models often performing poorly in high-resolution intensive agricultural environments, which are primarily designed for low resolution. Compared to existing technologies that directly increase input resolution, resulting in excessively large model parameters exceeding the capabilities of edge devices, this invention's lightweight, high-resolution intensive agricultural segmentation model provides clear fruit segmentation boundaries without interference in high-resolution intensive agricultural scenarios. Furthermore, the proposed segmentation model is small in size and has few parameters, making it suitable for embedded platforms. Attached Figure Description

[0064] Figure 1 This is a flowchart of the method of the present invention;

[0065] Figure 2 Examples of RGB and Depth images;

[0066] Figure 3 This is a flowchart of the feature extraction method of the present invention;

[0067] Figure 4 A flowchart of the deep fusion algorithm;

[0068] Figure 5 This is a rough prediction chart;

[0069] Figure 6 For detailed prediction charts;

[0070] Figure 7 Flowchart of Algorithm A for mutual guidance and fusion;

[0071] Figure 8 Flowchart of the B-algorithm for mutual guidance and fusion;

[0072] Figure 9 This is a diagram illustrating the operational process of an intensive agriculture segmentation model. Detailed Implementation

[0073] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments.

[0074] This invention provides a deep learning-based method for detecting intensive agricultural crops, with specific steps illustrated in the diagram below. Figure 1 As shown, it includes:

[0075] S1: Obtain a set of densely labeled agricultural images from a public dataset, and combine the high-resolution and low-resolution RGB images of the same image in the set. and low-resolution depth images The input is fed into the lightweight CNN network ModelNet, and the output is a high-resolution RGB image feature. Low-resolution RGB image features and low-resolution depth-form image features The set of RGB images and depth images selected in this embodiment are as follows: Figure 2 As shown.

[0076] The process of S1 extracting image features is as follows: Figure 3 As shown, the first row, from left to right, consists of depth images with a resolution of 256×256. 256×256 RGB image RGB image with a resolution of 1024×1024 In the diagram, Mb-v2 represents the MobileNet model described above. MobileNet is used as... and The pre-trained model, after being processed by a multi-layer network, yields high-resolution RGB features. , , , , and low-resolution RGB features , , , , Similarly, MobileNet is used as... The pre-trained model, after being processed by a multi-layer network, yields low-resolution depth features. , , , , .

[0077] Each set of features includes resolution and number of channels. In this embodiment... , , , , The represented resolutions and number of channels are {512, 32}, {256, 32}, {128, 32}, {64, 32}, and {32, 32}, respectively. , , , , The represented resolutions and number of channels are {128, 32}, {64, 32}, {32, 32}, {16, 32}, and {8, 32}, respectively. , , , , The represented resolutions and number of channels are {128, 32}, {64, 32}, {32, 32}, {16, 32}, and {8, 32}, respectively. Furthermore, an RGB image with a resolution of 1024 is also shown. pass directly After convolution, we get The resolution and number of channels represented are {1024, 32}.

[0078] S2: Establish a crop segmentation model, including a coarse prediction module, a detailed prediction module, and a guided fusion module.

[0079] S2.1: Construct a coarse prediction module to receive features from a low-resolution RGB image and a low-resolution depth image, and output a low-resolution coarse prediction map. The coarse prediction module uses ModelNet as a pre-trained model, selects the output features of each layer, and quickly generates a coarse prediction map of the target region based on the low-resolution features of the input image, providing overall contour information.

[0080] Specifically, it includes the following sub-steps:

[0081] S2.1.1: Features of low-resolution depth images Features of low-resolution RGB images Using a deep fusion algorithm, coarse predictive features are obtained. This can be expressed as a formula:

[0082]

[0083] The process of the deep fusion algorithm is as follows: Figure 4 As shown, the deep fusion algorithm uses features of low-resolution depth images ( Features of RGB Images Element-wise multiplication generates cross-modal interaction features, which are then processed by axial attention (AA) to extract spatial correlations and obtain attention weights. These weights are then used to weight and adjust the original RGB features, which are then added to themselves to form a fused feature. Finally, channel-level dynamic filtering is applied to the fused features through a compression excitation (SE) layer to further optimize the feature representation, ultimately outputting the enhanced multimodal features. The entire process achieves efficient fusion and fine-tuning of RGB and Depth modes. This can be expressed as a formula:

[0084]

[0085]

[0086] in, Indicates axial attention. Indicates a compressed excitation layer. Features representing low-resolution depth images. This represents the characteristics of a low-resolution RGB image.

[0087] S2.1.2: Features of low-resolution depth images RGB feature images The deep fusion algorithm was used sequentially, followed by a coarse prediction. After performing double upsampling (bilinear interpolation) and summing the results, the formula is as follows:

[0088]

[0089]

[0090] in, This indicates a deep fusion algorithm. This indicates that the input has been upsampled by a factor of two (bilinear interpolation). Representing different resolutions, i and its corresponding resolution n satisfy a mathematical relationship. That is, i from 0 to 7 represents resolutions of 1024, 512, 256, 128, 64, 32, and 16, respectively. The above process... Starting with a resolution of 16, the value of i decreases by one for each depth fusion. This represents an operational unit consisting of a 3×3 convolutional layer (32 output channels), a batch normalization layer, and a ReLU activation function in reverse order. Batch normalization normalizes the convolutional output to accelerate convergence and stabilize training, while ReLU introduces non-linear characteristics. This coarsely extracted features... Enter 3 3. Convolution to obtain a low-resolution coarse prediction map The rough prediction map obtained in this embodiment is as follows: Figure 5 As shown.

[0091] S2.2: Construct a detail prediction module to receive high-resolution RGB image features and output a detail prediction map. The detail prediction module generates a detail prediction map containing edge and texture information based on the high-resolution image features, providing fine structural information.

[0092] The detail prediction module inputs high-resolution RGB image features into the MobileNet model, which is then pre-trained with MobileNet-V2. and Upsampling followed by convolution, batch normalization, and ReLU activation are used to extract detailed output features. .

[0093] The mathematical expression for the above process is:

[0094]

[0095]

[0096] The above process from Starting at a resolution of 64, the value of i is decremented by one with each depth fusion. This yields the most detailed features at the top layer. The image is then fed into a prediction head consisting of a convolutional layer (with one output channel for single-class segmentation) to generate a detail prediction map with the same resolution as the input image. Each pixel value in this detail prediction map represents the predicted probability that the location belongs to the target detail region. The prediction probability is normalized to the [0,1] interval using a sigmoid activation function to obtain the final high-resolution detail prediction map. In this region map, a pixel value close to 1 indicates a high confidence level of belonging to the detail region, while a pixel value close to 0 indicates belonging to the background region. The detail prediction map obtained in this embodiment is shown below. Figure 6 As shown.

[0097] S2.3: Based on the outputs of the S2 coarse prediction module and the S3 detailed prediction module, a guided fusion module is constructed, and an intensive agriculture segmentation model is established based on this module. The guided fusion module achieves bidirectional guidance and fusion of coarse and detailed prediction information through a mutual guided fusion algorithm, thereby generating a fused feature map that combines global and local features. .

[0098] The mathematical expression for guiding the fusion module is:

[0099]

[0100]

[0101]

[0102] in, This indicates the mutual guidance and fusion of Algorithm A. This indicates a mutual guidance and fusion B-fusion algorithm.

[0103] The process is as follows Figure 7 As shown, the multi-scale interaction features are first calculated using the first formula. This feature is achieved by separately enhancing the attention of coarse and detailed features, fusing them with another feature, and then performing convolution to capture their complementary information; then, the second formula, based on this, further refines... The application uses channel attention mechanisms combined with residual connections, and finally generates the final multi-scale interactive attention through a convolutional module. This further refines and emphasizes key interactive information. Expressed as a formula:

[0104]

[0105]

[0106] The process is as follows Figure 8As shown, the multi-scale interaction features are first calculated using the first formula. This feature integrates information at different scales by initially processing and fusing the current layer's detailed features with the upsampled deep fusion features, followed by convolution. Then, the second formula, based on this, further refines the... The spatial attention mechanism is applied and combined with residual connections, and finally, the multi-scale interactive attention is generated through convolutional layers. This further refines and emphasizes key spatial interaction information, expressed by the formula:

[0107]

[0108]

[0109] The intensive agriculture segmentation model consists of a coarse prediction module (S2), a detailed prediction module (S3), and a guided fusion module (S4) connected sequentially. The operation process is as follows: Figure 9 As shown in the diagram, in terms of model structure, the input image first passes through a feature extraction network (pre-trained MobileNet-V2) to generate features for both low-resolution and high-resolution images, which are then fed into a coarse prediction module and a detail prediction module for processing, respectively. Subsequently, the output features of the two modules are fused in a multi-level fusion module to obtain the final fused features. The fused features are used to generate a final segmentation probability map with the same resolution as the input image via a prediction head (consisting of a 1×1 convolutional layer and a sigmoid activation function), which is output as the intensive agriculture segmentation result. The formula for calculating the segmentation probability is as follows:

[0110]

[0111] In the above formula, This represents a probability map, with matrix elements ranging from [0,1], used to identify the spatial distribution probability of the target object; This represents a linear transformation operation using a 1×1 convolution kernel, with a weight matrix of dimension O(n). ,in and These represent the number of input / output channels, respectively. The input detail feature map is obtained through a pre-feature extraction network, and its tensor shape is as follows: H and W are the height and width of the feature map, respectively; This represents the sigmoid activation function, whose function expression is: .

[0112] S3: Supervised training of the intensive agriculture segmentation model described in S4 was performed using the ACOD12K dataset. The specific steps were: [The text abruptly ends here, likely due to an incomplete sentence or missing information.] Detail features and fusion features The upsampling operation is used to adjust the spatial dimensions of the coarse truth map, detailed truth map, and truth map to match those in the dataset.

[0113] Segmentation loss is calculated based on each prediction map and its corresponding ground truth map. Each prediction map includes: a coarse prediction map (corresponding to S2) generated by Gaussian blurring and distance transformation of the ground truth map, a detailed prediction map (corresponding to S3) obtained by subtracting the coarse supervision signal from the ground truth map, and a complete prediction map (i.e., the original ground truth map of S1). The coarse prediction loss, detailed prediction loss, and fusion prediction loss are obtained.

[0114] The three types of losses are summed to form a total loss function. This total loss is then used to update all trainable parameters of the intensive agriculture segmentation model via backpropagation, thereby improving the model's segmentation accuracy in both coarse contours and detailed structures. The loss function expression is as follows:

[0115]

[0116] in, Represents the binary cross-entropy function. This represents the cross-joint function. It takes an intensive agriculture image as input to the updated model and outputs a corresponding intensive agriculture image segmentation prediction map.

[0117] S4: Acquire the image to be detected and input it into the trained dense agricultural segmentation model, outputting a single-channel or multi-channel probability map with the same size as the input image. The value of each pixel represents the predicted probability that the pixel belongs to the target category (such as a crop area). This probability map is normalized to the range [0,1] within the model using the sigmoid activation function.

[0118] The image to be detected is acquired in any of the following ways: an image acquisition device (such as an RGB camera, a multispectral sensor, or a depth camera) with a resolution of not less than 1024×1024 pixels; or a storage device (such as a historical agricultural image database) that ensures the image quality meets the model input requirements.

[0119] This embodiment verifies the effectiveness of the invention through the following methods. Specific usage. , The index calculation is based on the accuracy and model size of the deep learning-based intensive agricultural crop detection method to determine the memory usage of the method.

[0120] (1) It is a comprehensive measurement indicator, defined as the weighted harmonic mean of precision and recall, expressed as:

[0121]

[0122] In the formula, This represents the weighted harmonic average evaluation index, used to quantify the overall performance of the detection system. Its value range is [0,1], and the larger the value, the better the system performance. This is the weighting adjustment factor, with a default value of 0.3. At that time, it indicated that more emphasis was placed on accuracy. This indicates a greater emphasis on recall rate. This is verified through experiments in this embodiment. It achieves the optimal balance between false positives and false negatives. Precision is defined as: Where TP (True Positive) represents the number of correctly detected targets, and FP (False Positive) represents the number of falsely detected targets, this parameter reflects the system's ability to suppress false detections; Recall is defined as: FN (False Negative) represents the number of targets missed, and this parameter reflects the system's ability to suppress missed detections.

[0123] (2) Widely used to measure the structural similarity between the original image and the image to be tested, it is defined as a weighted sum of object-oriented structural similarity and region-oriented structural similarity, expressed as:

[0124]

[0125] In the formula This represents the comprehensive structural similarity index, with a value range of [0,1]. The larger the value, the higher the structural similarity between the image to be tested and the original image. For object-oriented structural similarity, image regions are divided by target detection boxes, and the mean local structural similarity within each object region is calculated to reflect the degree of shape and texture matching of key objects. To achieve region-oriented structural similarity, the image is uniformly divided into... The grid is used to calculate the average SSIM index of each grid region, reflecting the degree of matching of the global spatial structure. This is a dynamic weighting coefficient, with a value range of 0.4 ≤ ≤0.6, with a preferred value of 0.5, is used to balance the contribution of object-level and region-level indicators.

[0126] (3) This is a binary foreground map measurement method that uses enhanced alignment to improve the accuracy and robustness of the evaluation, represented as:

[0127]

[0128] In the formula, The value range is [0,1]. The larger the value, the higher the matching degree between the foreground segmentation result and the ground truth label. The spatial resolution of the feature map is given by , where Indicates the number of pixels in the height direction. Indicates the number of pixels in the width direction; Indicates position The alignment matching function at the specified location is defined as follows:

[0129] in For indicator functions, and These are the predicted feature map and the ground truth labeled feature map, respectively. This represents a sub-pixel-level coordinate transformation based on optical flow estimation. The matching threshold is set to 0.3 (preferably).

[0130] Table 1 lists the comparative data of image segmentation methods proposed in recent years. The upward arrows indicate that the larger the index, the better the model performance.

[0131] Table 1 Comparison and verification results

[0132]

[0133] The data in Table 1 shows that the network model of this invention exhibits the best performance in various tests, further confirming that this invention has a stronger ability to capture multi-scale targets when dealing with hidden crops in intensive agriculture. Utilizing the mutually guided fusion module, this invention can optimize the detailed features of the prediction map layer by layer, effectively reducing the blurring of boundaries inaccurate image localization. This optimization significantly improves the boundary accuracy of image segmentation and reduces the problem of incorrectly segmented regions. Simultaneously, while maintaining the prediction results, it also achieves a smaller model size and faster running speed.

Claims

1. A deep learning-based method for detecting intensive agricultural crops, characterized in that, include: S1: Obtain a dense agricultural image set with crop annotation information from the existing dataset. Select high-resolution RGB, low-resolution RGB, and low-resolution depth formats of the same image and input them into the MobileNet model to obtain several sets of features corresponding to the high-resolution RGB images. Several sets of features corresponding to low-resolution RGB images Several sets of features corresponding to low-resolution depth images ,in For feature indexes, there is a one-to-one correspondence with feature resolutions. Each set of features includes feature resolution and number of channels. High-resolution RGB images have a higher resolution than both low-resolution RGB images and low-resolution Depth images. S2: Establish a crop segmentation model, including: A coarse prediction module is used to predict pairs of features with the same resolution. , The features are obtained using a deep fusion algorithm to acquire the corresponding coarse prediction features, which are then processed to obtain a coarse prediction map. The detail prediction module is used to... Input the data into the MobileNet model to obtain detailed prediction features, and process them to obtain a detailed prediction map. The guided fusion module is used to generate fusion features based on the coarse prediction map and the detailed prediction map through a mutual guided fusion algorithm. The fusion features are used by the prediction head to generate a probability map of a specified resolution, which is used as the output of the crop segmentation model. S3: Supervised training of the crop segmentation model using the existing dataset, adjusting the spatial dimensions of coarse prediction features, detailed prediction features, and fused features, setting the loss function, and inversely updating the trainable parameters of the crop segmentation model; S4: Acquire the image to be detected, input the image to be detected into the updated crop segmentation model, and obtain a probability map output with the same size as the image to be detected, so as to realize the detection of dense agricultural crops.

2. The method for detecting intensive agricultural crops according to claim 1, characterized in that, The deep fusion algorithm includes: The first Group Depth Features With RGB features Element-wise multiplication generates cross-modal interaction features, which are then processed through axial attention. Spatial correlation is extracted to obtain attention weights; where i satisfies the following condition: ; The attention weights are used to adjust the depth features, and then added to the depth features to form a fused feature. , is represented as: By compressing the excitation layer Channel-level dynamic filtering is applied to the fused features to output coarse predicted features. , is represented as: 。 3. The method for detecting intensive agricultural crops according to claim 2, characterized in that, The processing yields a coarse prediction map, including: For each group and The deep fusion algorithm and coarse prediction were used sequentially. After doubling the upsampling, the sum is expressed by the formula: in, This indicates a deep fusion algorithm. This indicates that the input has been upsampled by a factor of two. This represents an operational unit consisting of a 3×3 convolutional layer, a batch normalized layer, and a modified linear unit activation function in that order. The above process from Initially, with each depth fusion, the value of i is decremented by one, representing the coarse features. Enter 3 Three convolutional layers are used to obtain a rough prediction image. .

4. The method for detecting intensive agricultural crops according to claim 5, characterized in that, The acquisition of detailed prediction features includes: The detail prediction module will specify the range of RGB features. The RGB features are input into the MobileNet model and pre-trained using MobileNet-V2. With Depth features Upsampling followed by convolution, batch normalization, and ReLU activation are used to extract detailed output features. The expression is: The above process from Initially, with each depth fusion, the value of i is decremented by one, until the top-level detailed features are obtained. As a feature for detail prediction.

5. The method for detecting intensive agricultural crops according to claim 4, characterized in that, The processing yields a detailed prediction map, including: The detailed prediction features The input is fed into a prediction head consisting of a convolutional layer, which generates a prediction map with the same resolution as the input image. Each pixel value in the prediction map represents the prediction probability that the location belongs to the target detail region. The prediction probability is normalized to the [0,1] interval by the Sigmoid activation function to obtain the detail prediction map.

6. The method for detecting intensive agricultural crops according to claim 5, characterized in that, The mutual guidance fusion algorithm includes: in, This indicates the mutual guidance and fusion of Algorithm A. This indicates the mutual guidance and fusion B algorithm; The mutually guided fusion A algorithm includes: processing coarse features Detail features Attention enhancement, fusion, and convolution are performed separately to obtain multi-scale interaction features. The attention mechanism is applied to the multi-scale interaction features and combined with residual connections to generate multi-scale interaction attention. The formula is expressed as: The mutually guided fusion B algorithm includes: integrating the detailed features of the current layer... Deep fusion features of upsampling By performing fusion and convolution, multi-scale interactive features are obtained. An attention mechanism is applied to the multi-scale interaction features and combined with residual connections to generate multi-scale interaction attention. The formula is expressed as: 。 7. The method for detecting intensive agricultural crops according to claim 6, characterized in that, The adjustment of the spatial dimensions of the coarse prediction features, detailed prediction features, and fused features includes: rough features Detail features and fusion features The spatial dimensions of the coarse truth map, detailed truth map, and truth map of the existing dataset are adjusted through upsampling operations.

8. The method for detecting intensive agricultural crops according to claim 7, characterized in that, The setting of the loss function includes: Segmentation loss is calculated based on each prediction map and the corresponding ground map. Each prediction map includes a coarse prediction map generated by Gaussian blurring and distance transformation of the ground map, a detailed prediction map obtained by subtracting the coarse supervision signal from the ground map, and a complete prediction map. Coarse prediction loss, detailed prediction loss and fusion prediction loss are obtained. The three types of losses are summed to form a total loss function, and all trainable parameters of the intensive agriculture segmentation model are updated based on this total loss using the backpropagation algorithm. The expression is: in, Represents the binary cross-entropy function. This represents a cross-joint function.

9. The method for detecting intensive agricultural crops according to claim 8, characterized in that, The image to be detected is acquired through the following devices: an image acquisition device with an image resolution of not less than 1024×1024 pixels; and a storage device that ensures the image quality meets the model input requirements.

10. A deep learning-based intensive crop detection system, characterized in that, include: The feature extraction module is used to obtain a dense agricultural image set with crop annotation information from the existing dataset. It selects high-resolution RGB, low-resolution RGB, and low-resolution depth forms of the same image and inputs them into the MobileNet model to obtain several sets of features corresponding to the high-resolution RGB image. Several sets of features corresponding to low-resolution RGB images Several sets of features corresponding to low-resolution depth images ,in For feature indexes, there is a one-to-one correspondence with feature resolutions. Each set of features includes feature resolution and number of channels. High-resolution RGB images have a higher resolution than both low-resolution RGB images and low-resolution Depth images. The crop segmentation model, used for the detection of intensive agricultural crops, includes the following sub-modules: The coarse prediction submodule is used to predict pairs of features with the same resolution. , The features are obtained using a deep fusion algorithm to acquire the corresponding coarse prediction features, which are then processed to obtain a coarse prediction map. The detail prediction submodule is used to... Input the data into the MobileNet model to obtain detailed prediction features, and process them to obtain a detailed prediction map. The guidance fusion submodule is used to generate fusion features based on the coarse prediction map and the detailed prediction map through a mutual guidance fusion algorithm. The fusion features are used to generate a probability map of a specified resolution via the prediction head, which is then used as the output of the crop segmentation model. The model training submodule is used to supervise the training of the crop segmentation model using the existing dataset, adjust the spatial size of coarse prediction features, detailed prediction features, and fused features, set the loss function, and update the trainable parameters of the crop segmentation model in reverse. The segmentation module is used to acquire the image to be detected. The image to be detected is input into the updated crop segmentation model to obtain a probability map output with the same size as the image to be detected, thereby realizing the detection of dense agricultural crops.