Rice seedling counting method based on unmanned aerial vehicle
By improving the YOLOv8 network and introducing the phantom convolution module, C2f_Faster module and local window attention mechanism, the problems of complex background and high plant density in rice seedling images taken by drones are solved, and the accuracy and robustness of target detection are improved. Adapting to resource-constrained environments.
Patent Information
- Application Number
- CN202410628551.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-05-21
AI Technical Summary
Traditional UAV-captured images of rice seedlings have complex backgrounds, high plant density, and variable viewing angles and lighting conditions, which lead to a decrease in target detection accuracy and difficulty in accurate identification and counting.
Improve the YOLOv8 network, introduce the phantom convolution module and C2f_Faster module, build a new neck network and local window attention mechanism module, optimize the backbone network and neck network, and improve the accuracy and robustness of target detection.
It significantly improves the accuracy and robustness of target detection, reduces the number of model parameters, improves the efficiency and resource utilization of processing large-scale data, adapts to resource-constrained environments, and improves detection capabilities in complex scenes and occlusion situations.
Smart Images

Figure CN118537754A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning computer vision technology, and in particular to a rice seedling counting method based on an unmanned aerial vehicle. Background Art
[0002] Accurate rice yield forecasting can help farmers and government decision-makers to rationally arrange planting plans, adjust agricultural policies and resource allocation, and thus improve the efficiency and quality of crop production. In addition, rice is one of the world's major food crops, and its yield changes directly affect world food security and economic development. Therefore, rice yield forecasting is of great significance for ensuring food supply, maintaining social stability and promoting economic growth. The number of rice plants is one of the important criteria for measuring rice yield.
[0003] At present, the mainstream rice seedling counting is mostly target detection of rice images taken by fixed cameras. The observation angle, area, and data representation are often insufficient, and the occlusion situation is unpredictable. Fixed cameras will also produce perspective distortion and present scale differences. UAV-based rice seedling counting technology has brought significant advantages to agricultural production. Through drone aerial photography, image data of rice fields can be obtained comprehensively and efficiently, and the entire farmland can be overlooked from the air to capture information on rice seedlings in all directions, which improves the comprehensiveness and coverage of detection. Drones equipped with high-resolution cameras can provide high-quality, high-resolution image data, thereby realizing accurate counting and detection of rice seedlings.
[0004] As modern drones become one of the mainstream tools for data collection, traditional target detection methods are also facing new challenges. In particular, in images taken by drones, the background is usually more complex and the plant density may be higher. These factors have led to a decline in the counting performance of traditional target detection methods. Modern drones can take high-resolution images and capture more details and complex scenes, which means that there may be more interference factors in the images, which will make it difficult to identify and count targets; secondly, the increase in plant density also poses challenges to target detection. Under dense vegetation cover, the target may be partially or completely obscured, making it difficult to accurately detect and count. In addition, images taken by drones often have different viewing angles and lighting conditions, which may lead to diverse representations of targets in the image and increase the complexity of target detection algorithms. Summary of the invention
[0005] In order to solve the problems of more complex background, higher plant density, and changing viewing angle and lighting conditions when drone images are taken, the object of the present invention is to provide a drone-based rice seedling counting method that improves the accuracy and robustness of target detection tasks and improves the target recognition ability.
[0006] To achieve the above object, the present invention adopts the following technical solution: a method for counting rice seedlings based on drone, the method comprising the following steps in order:
[0007] (1) Data collection: Use drone equipment to photograph rice fields and obtain panoramic images of rice;
[0008] (2) Image preprocessing: Cropping the rice panoramic image into multiple 320*320 jpg format images, preprocessing the image to obtain the preprocessed rice image;
[0009] (3) Creating a data set: Annotate the preprocessed rice images with rectangular boxes to generate a rectangular box annotation data set containing a training set, a validation set, and a test set.
[0010] (4) Constructing a rice seedling detection model: Improve the YOLOv8 network to obtain the improved YOLOv8 network, i.e., the rice seedling detection model;
[0011] (5) Training the rice seedling detection model: inputting the rectangular box annotation dataset into the rice seedling detection model for training, verification, and testing to obtain the trained rice seedling detection model;
[0012] (6) Rice counting: The rice images to be predicted are preprocessed and input into the trained rice seedling detection model. The trained rice seedling detection model outputs the rice seedling counting results taken by the drone.
[0013] In step (2), the preprocessing refers to filtering, rotating, cropping, radiating, adding noise and enhancing brightness contrast of the image.
[0014] The step (4) specifically refers to: the rice seedling detection model includes an input network, a backbone network, a neck network and a head network, the C2f module in the backbone network of the YOLOv8 network is replaced with a C2f_Faster module, and a local window attention mechanism module is added to the backbone network of the YOLOv8 network, the backbone network performs shallow feature extraction on the image output by the input network to obtain a multi-scale first feature map; the neck network includes a repeated weighted bidirectional feature pyramid network, the first feature map is input into the neck network for a second feature extraction, and a multi-scale second feature map is obtained; the second feature map is input into the head network for further feature processing, and a target detection result is output, and the target detection result includes the position and category information of the rice.
[0015] The backbone network includes 2 phantom convolution modules, 4 C2f_Faster modules, 3 CBS modules, 1 SPPF module and 1 local window attention mechanism module; the 4 C2f_Faster modules are the first, second, third and fourth C2f_Faster modules;
[0016] Firstly, two phantom convolution modules are used to replace the two convolution modules of the original YOLOv8 network. The image features are gradually extracted with less computational cost, and the image resolution is gradually reduced to obtain a higher level of abstract feature representation. The convolution kernel size of the two phantom convolution modules is 3*3 and the step size is 2. Then, four C2f_Faster modules and three CBS modules are cross-stacked. Four C2f_Faster modules are used to replace the C2f modules of the original YOLOv8 network. According to the importance of different positions in the input feature map, the feature response is adaptively adjusted. The first, second and fourth C2f_Faster modules are repeated 3 times, and the third C2f_Faster module is repeated 6 times. Then, one SPPF module is stacked to perform pooling operations on the input feature map at different scales to capture the multi-scale information of the target. The convolution kernel size of the SPPF module is 5*5. Finally, one local window attention mechanism module is stacked to apply the attention mechanism in the local window, enhance the learning of short-range interactions in the local window, and aggregate fine-grained local features.
[0017] The neck network includes 6 CBS modules, 2 upsampling modules, 5 feature fusion modules and 5 C2f_Faster modules; the 6 CBS modules are the first, second, third, fourth, fifth and sixth CBS modules, the 2 upsampling modules are the first and second upsampling modules, the 5 feature fusion modules are the first, second, third, fourth and fifth feature fusion modules, and the 5 C2f_Faster modules are the fifth, sixth, seventh, eighth and ninth C2f_Faster modules;
[0018] The P2 layer includes the first CBS module with a convolution kernel size of 3*3 and a stride of 2;
[0019] The P3 layer sequentially includes a second CBS module with a convolution kernel size of 1*1 and a step size of 1, a first feature fusion module, a fifth C2f_Faster module with a repetition number of 3, a second feature fusion module, a sixth C2f_Faster module with a repetition number of 3, and a third CBS module with a convolution kernel size of 3*3 and a step size of 2;
[0020] The P4 layer sequentially includes a fourth CBS module with a convolution kernel size of 1*1 and a step size of 1, a third feature fusion module, a seventh C2f_Faster module with a repetition number of 3, a first upsampling module, a fourth feature fusion module, an eighth C2f_Faster module with a repetition number of 3, and a fifth CBS module with a convolution kernel size of 3*3 and a step size of 2;
[0021] The P5 layer includes the sixth CBS module with a convolution kernel size of 1*1 and a step size of 1, the second upsampling module, the fifth feature fusion module, and the ninth C2f_Faster module with a repetition number of 3;
[0022] First, feature maps of three scales, P3, P4, and P5, are selected and passed into the neck network. The three scales correspond to the results of downsampling the original image 3, 4, and 5 times, respectively.
[0023] To align the number of channels, the feature maps of P2, P3, P4, and P5 are first input into the 4 CBS modules of the corresponding layers for convolution. The feature map of P5 after convolution is upsampled and fused with the feature map of P4 after convolution in the third feature fusion module of the P4 layer. After this fusion, it passes through the seventh C2f_Faster module of P4 and then passes through the first upsampling module for upsampling. The output is then fused with the output of the convolution of the feature map of P3 in the first feature fusion module of the P3 layer. After this fusion, it passes through the fifth C2f_Faster module of the P3 layer and is fused with the feature maps of P2 and P3 after convolution in the second feature fusion module of the P3 layer. Among them, the feature map of P3 after convolution is jump-connected to the second feature fusion module. After this fusion, the result 1 is obtained through the sixth C2f_Faster module, and the result 1 is passed through the P3 layer The third CBS module of the P4 layer is convolved, and the output obtained is fused with the feature map of P4 after the convolution, the output of the seventh C2f_Faster module of the P4 layer, and the output of the first upsampling module of the P4 layer. The four are fused in the fourth feature fusion module of the P4 layer, wherein the feature map of P4 after the convolution and the output of the seventh C2f_Faster module of the P4 layer are both jump-connected to the fourth feature fusion module, and the output after the fusion of the four is passed through the eighth C2f_Faster module of the P4 layer to obtain result 2; result 2 is then passed through the fifth CBS module of the P4 layer, and the output obtained is fused with the feature map of P5 after the convolution in the fifth feature fusion module of the P5 layer, wherein the feature map of P5 after the convolution is jump-connected to the fifth feature fusion module, and the output after this fusion is passed through the ninth C2f_Faster module of the P5 layer to obtain result 3.
[0024] It can be seen from the above technical scheme that the beneficial effects of the present invention are: first, by introducing lightweight phantom convolution modules and C2f_Faster modules, the present invention successfully optimizes the backbone network, significantly reduces the number of parameters, and improves the running speed of the task. This improvement reduces the number of GFLOPS parameters from the original 8.1 to 7.1, which provides a significant improvement in the efficiency and performance of the model, making the model more efficient when processing large-scale data, and also provides better support for running in resource-constrained environments; second, the present invention constructs a new neck network, which is inspired by the repeatedly weighted bidirectional feature pyramid network and adopts a strategy of bidirectional paths and adding extra edges on the same layer, so that the predicted feature map not only has a high degree of semantic information, but also contains rich location information. This comprehensive feature representation is crucial for target detection tasks. It provides a more comprehensive and accurate information basis for the model, thereby improving the accuracy and robustness of target detection tasks. The design of this neck network not only improves the model's ability to recognize targets, but also makes the model perform better in dealing with complex scenes and occlusions. Third, add a local window attention mechanism module. Compared with the global self-attention mechanism, the local window attention mechanism module only needs to focus on the local window of the input image, so it is more efficient in calculation, and the local window attention mechanism module has a smaller memory requirement, which makes it better adapted to resource-constrained environments. And because it only considers information within the local window and is not disturbed by distant locations, it has better expressiveness in images of densely populated rice seedlings captured by drones. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a flow chart of the method of the present invention;
[0026] Figure 2 It is a schematic diagram of the structure of the backbone network in the present invention;
[0027] Figure 3 It is a schematic diagram of the structure of the neck network in the present invention. DETAILED DESCRIPTION
[0028] like Figure 1 As shown, a method for counting rice seedlings based on drones comprises the following steps in order:
[0029] (1) Data collection: Use drone equipment to photograph rice fields and obtain panoramic images of rice;
[0030] (2) Image preprocessing: Cropping the rice panoramic image into multiple 320*320 jpg format images, preprocessing the image to obtain the preprocessed rice image;
[0031] (3) Creating a data set: Annotate the preprocessed rice images with rectangular boxes to generate a rectangular box annotation data set containing a training set, a validation set, and a test set.
[0032] (4) Constructing a rice seedling detection model: Improve the YOLOv8 network to obtain the improved YOLOv8 network, i.e., the rice seedling detection model;
[0033] (5) Training the rice seedling detection model: inputting the rectangular box annotation dataset into the rice seedling detection model for training, verification, and testing to obtain the trained rice seedling detection model;
[0034] (6) Rice counting: The rice images to be predicted are preprocessed and input into the trained rice seedling detection model. The trained rice seedling detection model outputs the rice seedling counting results taken by the drone.
[0035] In step (2), the preprocessing refers to screening, rotating, cropping, radiating, adding noise and enhancing brightness contrast of the image. The image data is screened, and according to the lighting conditions, background impurities, and occlusion of branches and leaves, a batch of image data with severe reflection, more background impurities, and severe occlusion of branches and leaves are deleted.
[0036] The step (4) specifically refers to: the rice seedling detection model includes an input network, a backbone network, a neck network and a head network, the C2f module in the backbone network of the YOLOv8 network is replaced with a C2f_Faster module, and a local window attention mechanism module is added to the backbone network of the YOLOv8 network. The backbone network performs shallow feature extraction on the image output by the input network to obtain a multi-scale first feature map; the neck network includes a repeated weighted bidirectional feature pyramid network, the repeated weighted bidirectional feature pyramid network has two feature fusion paths, namely, top-down and bottom-up, and uses full feature fusion during feature fusion. The repeated weighted bidirectional feature pyramid network inputs the first feature map into the neck network for a second feature extraction to obtain a multi-scale second feature map; the second feature map is input into the head network for further feature processing, and a target detection result is output, and the target detection result includes the location and category information of rice.
[0037] like Figure 2 As shown, the backbone network includes 2 phantom convolution modules, 4 C2f_Faster modules, 3 CBS modules, 1 SPPF module and 1 local window attention mechanism module; the 4 C2f_Faster modules are the first, second, third and fourth C2f_Faster modules;
[0038] Firstly, two phantom convolution modules are used to replace the two convolution modules of the original YOLOv8 network. The image features are gradually extracted with less computational cost, and the image resolution is gradually reduced to obtain a higher level of abstract feature representation. The convolution kernel size of the two phantom convolution modules is 3*3 and the step size is 2. Then, four C2f_Faster modules and three CBS modules are cross-stacked. Four C2f_Faster modules are used to replace the C2f modules of the original YOLOv8 network. According to the importance of different positions in the input feature map, the feature response is adaptively adjusted. The first, second and fourth C2f_Faster modules are repeated 3 times, and the third C2f_Faster module is repeated 6 times. Then, one SPPF module is stacked to perform pooling operations on the input feature map at different scales to capture the multi-scale information of the target. The convolution kernel size of the SPPF module is 5*5. Finally, one local window attention mechanism module is stacked to apply the attention mechanism in the local window, enhance the learning of short-range interactions in the local window, and aggregate fine-grained local features.
[0039] like Figure 3 As shown, the neck network includes 6 CBS modules, 2 upsampling modules, 5 feature fusion modules and 5 C2f_Faster modules; the 6 CBS modules are the first, second, third, fourth, fifth and sixth CBS modules, the 2 upsampling modules are the first and second upsampling modules, the 5 feature fusion modules are the first, second, third, fourth and fifth feature fusion modules, and the 5 C2f_Faster modules are the fifth, sixth, seventh, eighth and ninth C2f_Faster modules;
[0040] The P2 layer includes the first CBS module with a convolution kernel size of 3*3 and a stride of 2;
[0041] The P3 layer sequentially includes a second CBS module with a convolution kernel size of 1*1 and a step size of 1, a first feature fusion module, a fifth C2f_Faster module with a repetition number of 3, a second feature fusion module, a sixth C2f_Faster module with a repetition number of 3, and a third CBS module with a convolution kernel size of 3*3 and a step size of 2;
[0042] The P4 layer sequentially includes a fourth CBS module with a convolution kernel size of 1*1 and a step size of 1, a third feature fusion module, a seventh C2f_Faster module with a repetition number of 3, a first upsampling module, a fourth feature fusion module, an eighth C2f_Faster module with a repetition number of 3, and a fifth CBS module with a convolution kernel size of 3*3 and a step size of 2;
[0043] The P5 layer includes the sixth CBS module with a convolution kernel size of 1*1 and a step size of 1, the second upsampling module, the fifth feature fusion module, and the ninth C2f_Faster module with a repetition number of 3;
[0044] First, feature maps of three scales, P3, P4, and P5, are selected and passed into the neck network. The three scales correspond to the results of downsampling the original image 3, 4, and 5 times, respectively.
[0045] To align the number of channels, the feature maps of P2, P3, P4, and P5 are first input into the 4 CBS modules of the corresponding layers for convolution. The feature map of P5 after convolution is upsampled and fused with the feature map of P4 after convolution in the third feature fusion module of the P4 layer. After this fusion, it passes through the seventh C2f_Faster module of P4 and then passes through the first upsampling module for upsampling. The output is then fused with the output of the convolution of the feature map of P3 in the first feature fusion module of the P3 layer. After this fusion, it passes through the fifth C2f_Faster module of the P3 layer and is fused with the feature maps of P2 and P3 after convolution in the second feature fusion module of the P3 layer. Among them, the feature map of P3 after convolution is jump-connected to the second feature fusion module. After this fusion, the result 1 is obtained through the sixth C2f_Faster module, and the result 1 is passed through the P3 layer The third CBS module of the P4 layer is convolved, and the output obtained is fused with the feature map of P4 after the convolution, the output of the seventh C2f_Faster module of the P4 layer, and the output of the first upsampling module of the P4 layer. The four are fused in the fourth feature fusion module of the P4 layer, wherein the feature map of P4 after the convolution and the output of the seventh C2f_Faster module of the P4 layer are both jump-connected to the fourth feature fusion module, and the output after the fusion of the four is passed through the eighth C2f_Faster module of the P4 layer to obtain result 2; result 2 is then passed through the fifth CBS module of the P4 layer, and the output obtained is fused with the feature map of P5 after the convolution in the fifth feature fusion module of the P5 layer, wherein the feature map of P5 after the convolution is jump-connected to the fifth feature fusion module, and the output after this fusion is passed through the ninth C2f_Faster module of the P5 layer to obtain result 3. In the training process, i.e., in step (5), the results 1, 2, and 3 are predicted to obtain a feature map list; in the counting process, i.e., in step (6), the results 1, 2, and 3 are predicted to obtain a feature map list, and then a prediction box is generated, and the prediction box is counted to obtain the rice seedling counting result.
[0046] The present invention makes three improvements to the YOLOv8 network:
[0047] First, the C2f module in the backbone network of the YOLOv8 network is replaced with the C2f_Faster module. Since the candidate box regression and region proposal network are added to the C2f_Faster module, the detection accuracy and speed are improved. The Conv convolution in the 0th and 1st layers is replaced with ghostconv. By combining a small number of convolution kernels with cheaper linear change operations instead of conventional convolution methods, the learning cost of non-critical features is reduced.
[0048] Second, a local window attention mechanism module is added to the encoding and decoding of the YOLOv8 network to enhance the learning of short-range interactions within the local window and aggregate fine-grained local features;
[0049] Third, a repeated weighted bidirectional feature pyramid network is introduced in the neck network part. When performing feature fusion, nodes with only one input edge are deleted, additional edges are added to the input and output of the same layer, and weighted feature fusion is used. This not only takes into account the precise location information and the recognition of small targets, but also reduces the amount of calculation and parameters compared to the PAnet, i.e. the path aggregation network. It is more regular, more explainable and modifiable than the NAS-FPN network.
[0050] In summary, the present invention successfully optimizes the backbone network by introducing lightweight phantom convolution modules and C2f_Faster modules, significantly reduces the number of parameters, and improves the running speed of the task. This improvement reduces the number of GFLOPS parameters from the original 8.1 to 7.1, which provides a significant improvement in the efficiency and performance of the model, making the model more efficient when processing large-scale data, and also provides better support for running in resource-constrained environments; the present invention constructs a new neck network, which is inspired by the repeated weighted bidirectional feature pyramid network, and adopts a strategy of bidirectional paths and adding extra edges on the same layer, so that the predicted feature map not only has a high degree of semantic information, but also contains rich location information. This comprehensive feature representation is crucial for target detection tasks. It provides the model with a more comprehensive and accurate information basis, thereby improving the accuracy and robustness of target detection tasks. The design of this neck network not only improves the model's ability to recognize targets, but also makes the model perform better in dealing with complex scenes and occlusions. The addition of a local window attention mechanism module, compared to the global self-attention mechanism, only requires attention to the local window of the input image, so it is more efficient in computation, and the local window attention mechanism module has a smaller memory requirement, which makes it better adapted to resource-constrained environments. And because it only considers information within the local window and is not disturbed by distant locations, it has better expressiveness in images of densely populated rice seedlings captured by drones.
Claims
1. A rice seedling counting method based on drone, characterized in that: The method comprises the following steps in order: (1) Data collection: Use drone equipment to photograph rice fields and obtain panoramic images of rice; (2) Image preprocessing: crop the rice panorama image into multiple 320*320 jpg images, preprocess the image, and obtain the preprocessed rice image; (3) Creating a data set: Annotate the preprocessed rice images with rectangular boxes to generate a rectangular box annotation data set containing a training set, a validation set, and a test set. (4) Constructing a rice seedling detection model: Improve the YOLOv8 network to obtain the improved YOLOv8 network, i.e., the rice seedling detection model; (5) Training the rice seedling detection model: inputting the rectangular box annotation dataset into the rice seedling detection model for training, verification, and testing to obtain the trained rice seedling detection model; (6) Rice counting: The rice images to be predicted are preprocessed and input into the trained rice seedling detection model. The trained rice seedling detection model outputs the rice seedling counting results taken by the drone.
2. The method for counting rice seedlings based on drone according to claim 1, characterized in that: In step (2), the preprocessing refers to filtering, rotating, cropping, radiating, adding noise and enhancing brightness contrast of the image.
3. The method for counting rice seedlings based on drone according to claim 1, characterized in that: The step (4) specifically refers to: the rice seedling detection model includes an input network, a backbone network, a neck network and a head network, the C2f module in the backbone network of the YOLOv8 network is replaced with a C2f_Faster module, and a local window attention mechanism module is added to the backbone network of the YOLOv8 network, the backbone network performs shallow feature extraction on the image output by the input network to obtain a multi-scale first feature map; the neck network includes a repeated weighted bidirectional feature pyramid network, the first feature map is input into the neck network for a second feature extraction, and a multi-scale second feature map is obtained; the second feature map is input into the head network for further feature processing, and a target detection result is output, and the target detection result includes the position and category information of the rice.
4. The method for counting rice seedlings based on drone according to claim 3, characterized in that: The backbone network includes 2 phantom convolution modules, 4 C2f_Faster modules, 3 CBS modules, 1 SPPF module and 1 local window attention mechanism module; the 4 C2f_Faster modules are the first, second, third and fourth C2f_Faster modules; Firstly, two phantom convolution modules are used to replace the two convolution modules of the original YOLOv8 network. The image features are gradually extracted with less computational cost, and the image resolution is gradually reduced to obtain a higher level of abstract feature representation. The convolution kernel size of the two phantom convolution modules is 3*3 and the step size is 2. Then, four C2f_Faster modules and three CBS modules are cross-stacked. Four C2f_Faster modules are used to replace the C2f modules of the original YOLOv8 network. According to the importance of different positions in the input feature map, the feature response is adaptively adjusted. The first, second and fourth C2f_Faster modules are repeated 3 times, and the third C2f_Faster module is repeated 6 times. Then, one SPPF module is stacked to perform pooling operations on the input feature map at different scales to capture the multi-scale information of the target. The convolution kernel size of the SPPF module is 5*5. Finally, one local window attention mechanism module is stacked to apply the attention mechanism in the local window, enhance the learning of short-range interactions in the local window, and aggregate fine-grained local features.
5. The method for counting rice seedlings based on drone according to claim 3, characterized in that: The neck network includes 6 CBS modules, 2 upsampling modules, 5 feature fusion modules and 5 C2f_Faster modules; the 6 CBS modules are the first, second, third, fourth, fifth and sixth CBS modules, the 2 upsampling modules are the first and second upsampling modules, the 5 feature fusion modules are the first, second, third, fourth and fifth feature fusion modules, and the 5 C2f_Faster modules are the fifth, sixth, seventh, eighth and ninth C2f_Faster modules; The P2 layer includes the first CBS module with a convolution kernel size of 3*3 and a stride of 2; The P3 layer sequentially includes a second CBS module with a convolution kernel size of 1*1 and a step size of 1, a first feature fusion module, a fifth C2f_Faster module with a repetition number of 3, a second feature fusion module, a sixth C2f_Faster module with a repetition number of 3, and a third CBS module with a convolution kernel size of 3*3 and a step size of 2; The P4 layer sequentially includes a fourth CBS module with a convolution kernel size of 1*1 and a step size of 1, a third feature fusion module, a seventh C2f_Faster module with a repetition number of 3, a first upsampling module, a fourth feature fusion module, an eighth C2f_Faster module with a repetition number of 3, and a fifth CBS module with a convolution kernel size of 3*3 and a step size of 2; The P5 layer includes the sixth CBS module with a convolution kernel size of 1*1 and a step size of 1, the second upsampling module, the fifth feature fusion module, and the ninth C2f_Faster module with a repetition number of 3; First, feature maps of three scales, P3, P4, and P5, are selected and passed into the neck network. The three scales correspond to the results of downsampling the original image 3, 4, and 5 times, respectively. To align the number of channels, the feature maps of P2, P3, P4, and P5 are first input into the 4 CBS modules of the corresponding layers for convolution. The feature map of P5 after convolution is upsampled and fused with the feature map of P4 after convolution in the third feature fusion module of the P4 layer. After this fusion, it passes through the seventh C2f_Faster module of P4 and then passes through the first upsampling module for upsampling. The output is then fused with the output of the convolution of the feature map of P3 in the first feature fusion module of the P3 layer. After this fusion, it passes through the fifth C2f_Faster module of the P3 layer and is fused with the feature maps of P2 and P3 after convolution in the second feature fusion module of the P3 layer. Among them, the feature map of P3 after convolution is jump-connected to the second feature fusion module. After this fusion, the result 1 is obtained through the sixth C2f_Faster module, and the result 1 is passed through the P3 layer The third CBS module of the P4 layer is convolved, and the output obtained is fused with the feature map of P4 after the convolution, the output of the seventh C2f_Faster module of the P4 layer, and the output of the first upsampling module of the P4 layer. The four are fused in the fourth feature fusion module of the P4 layer, wherein the feature map of P4 after the convolution and the output of the seventh C2f_Faster module of the P4 layer are both jump-connected to the fourth feature fusion module, and the output after the fusion of the four is passed through the eighth C2f_Faster module of the P4 layer to obtain result 2; result 2 is then passed through the fifth CBS module of the P4 layer, and the output obtained is fused with the feature map of P5 after the convolution in the fifth feature fusion module of the P5 layer, wherein the feature map of P5 after the convolution is jump-connected to the fifth feature fusion module, and the output after this fusion is passed through the ninth C2f_Faster module of the P5 layer to obtain result 3.
Citation Information
Patent Citations
Feature-fused high-density rice field unmanned aerial vehicle image rice ear counting method
CN113012150A
Remote sensing target detection method and device, electronic equipment and storage medium
CN117671509A
Rice ear detection counting and rice yield estimation method based on unmanned aerial vehicle
CN117853961A
Cited By
Fish egg and fry automatic monitoring system based on feature image recognition
CN118968276A
Underwater crab quality nonlinear estimation method, system, equipment, medium and product
CN119762464A
