White lotus seedpod remote sensing recognition and extraction method and system based on optimized YOLOX network
By introducing the CA attention mechanism and ASFF feature fusion layer into the YOLOX network, the problem of small and medium-sized target recognition in lotus pod remote sensing recognition is solved, the recognition accuracy and recall rate are improved, and efficient detection performance is maintained in complex environments.
Patent Information
- Application Number
- CN202410716546.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-04
AI Technical Summary
The existing lotus remote sensing recognition technology is difficult to accurately identify small lotus targets in complex environments, and there are false detections and missed detections, especially in the lotus pond environment where lotus leaves and lotus are blocked. Traditional models such as PCNN, YOLO V2 and YOLO V5 fails to fully meet the needs in terms of recognition accuracy and speed.
Using a method based on the optimized YOLOX network, a more sensitive and accurate target detection network is constructed by adding the CA attention mechanism and the ASFF feature fusion layer to the YOLOX lotus detection network. The CA attention mechanism is used to dynamically adjust the importance of the feature map. characteristics, and integrates multi-level features through the ASFF module to improve the detection ability of small lotus targets.
It significantly improves the accuracy and recall rate of lotus pod recognition, improves the robustness and generalization ability of the model, speeds up the detection speed, and achieves efficient recognition in complex scenes.
Smart Images

Figure CN118736402A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of remote sensing identification, and in particular relates to a white lotus seed pod remote sensing identification and extraction method and system based on an optimized YOLOX network. Background Art
[0002] Lotus pod is a special aquatic economic crop with the characteristics of strong regional production, wide planting area, long life cycle, rich nutritional value and high economic value. It has a large market demand, broad prospects and considerable economic benefits. However, the current monitoring of the planting distribution, area and yield of lotus pod is mainly through reporting statistics and field surveys, which is not only time-consuming and labor-intensive, but also difficult to fully reflect its planting area, distribution information and dynamic changes. UAV remote sensing technology has a series of advantages such as short data update cycle and economical and effective monitoring methods. Applying it to quickly monitor the distribution and dynamic changes of Chinese medicinal materials planting can provide decision-making basis for relevant departments to guide the reasonable planting of lotus pod. Establishing an efficient UAV image lotus pod recognition model is the primary task of realizing remote sensing monitoring of lotus pod. In recent years, deep learning has been widely used in related problems due to its strong ability to extract high-dimensional features of targets.
[0003] At present, target detection models are often used to identify Solanaceae fruits such as strawberries, kiwis, apples, grapes and cucumbers in automated harvesting operations or fruit maturity prediction. However, Solanaceae fruits hang just below the branches and usually show a regular natural drooping trend, making their identification relatively easy to achieve.
[0004] The growth of lotus pods is different from that of the above-mentioned Solanaceae fruits. The height, orientation, and degree of curvature of lotus pods vary, and the maturity period is also inconsistent. Under the influence of wind, lotus pods also have irregular swinging phenomena. Therefore, the growth posture needs to be considered when identifying lotus pods from a bird's-eye view. In addition, the maturity of lotus pods is a gradual process, and the characteristics of lotus pods at different maturity stages are not significantly different: fresh lotus pods are light green, lotus leaves are emerald green, and lotus flowers are reddish or white. The color difference between lotus pods and lotus leaves is not obvious, and they are similar in shape to lotus flowers, but the color difference is obvious; the lotus pods at the mature stage are turquoise, and the lotus seeds are slightly protruding from the lotus pods, and the lotus pods are drooping; the lotus pods at the dry and mature stage are brown, and the lotus seeds are black, and the posture is upright. In addition, since lotus pods are aquatic plants that grow in complex lotus pond environments, there are a large number of obstacles such as lotus leaves and lotus flowers, and the overlapping and occlusion phenomena are serious, which is very easy to cause false detection and missed detection. In summary, the recognition of lotus pods in drone images needs to consider many factors in order to achieve efficient and accurate recognition of lotus pods.
[0005] Although some studies have used PCNN models, YOLO V2 models or YOLO V5 models to achieve lotus pod recognition, the PCNN model is complex to train and has low accuracy, the YOLO V2 model is not accurate enough for small targets, and the YOLO V5 model mainly improves the model training speed and deployment, but does not improve the recognition accuracy enough. Targeted improvements are still needed for lotus pod recognition targets. Summary of the invention
[0006] In order to solve the above technical problems, the present invention proposes a technical solution for a white lotus seed pod remote sensing identification and extraction method based on an optimized YOLOX network to solve the above technical problems.
[0007] The first aspect of the present invention discloses a method for remote sensing identification and extraction of white lotus pods based on an optimized YOLOX network, the method comprising:
[0008] Step S1, collecting lotus pod images and performing data enhancement and labeling on them to obtain a lotus pod image dataset; dividing the lotus pod image dataset into a training set and a test set;
[0009] Step S2, constructing a YOLOX lotus pod detection network model by orderly connecting the input layer, the backbone network with CSPDarkNet53 as the basic architecture, the feature enhancement network with the composite structure of FPN+PAN, and the output prediction layer;
[0010] Step S3, by adding CA attention mechanism and ASFF feature fusion layer to the YOLOX lotus detection network model, an optimized YOLOX object detection network is obtained;
[0011] Step S4, referencing the training set to train the optimized YOLOX object detection network;
[0012] Step S5: Use the test set to test and evaluate the trained optimized YOLOX object detection network to obtain a lotus pod image detection result.
[0013] According to the method of the first aspect of the present invention, in step S3, the optimized YOLOX target detection network is obtained by adding a CA attention mechanism and an ASFF feature fusion layer to the YOLOX lotus detection network model, including:
[0014] By adding a CA attention mechanism between the backbone network and the feature enhancement network, and adding an ASFF feature fusion layer between the feature enhancement network and the output prediction layer, an optimized YOLOX object detection network is obtained.
[0015] According to the method of the first aspect of the present invention, in step S3, adding a CA attention mechanism between the backbone network and the feature enhancement network includes:
[0016] The CA attention modules are respectively attached to the output feature maps of the second, third and fourth CSP modules of the backbone network to obtain attention mechanism feature maps; and the attention mechanism feature maps are input into the feature enhancement network.
[0017] According to the method of the first aspect of the present invention, in step S3, the CA attention modules are respectively attached to the output feature maps to obtain the attention mechanism feature maps, including:
[0018] Inputting the output feature map into a residual module to obtain residual features;
[0019] Performing average pooling in the X direction and average pooling in the Y direction on the residual features to obtain an X-direction pooling feature map and a Y-direction pooling feature map;
[0020] The X-direction pooling feature map and the Y-direction pooling feature map are concatenated, and a first convolution feature map is obtained through a convolution layer;
[0021] Perform batch normalization and nonlinear transformation on the first convolution feature map to obtain a nonlinear feature map;
[0022] Applying convolution operations to the nonlinear feature map in the horizontal direction and the vertical direction respectively to obtain a second convolution feature map and a third convolution feature map;
[0023] Applying a Sigmoid function to the second convolution feature map and the third convolution feature map respectively to obtain a first function feature map and a second function feature map;
[0024] The first function feature map, the second function feature map and the residual feature are multiplied to obtain an attention mechanism feature map.
[0025] The second aspect of the present invention discloses a white lotus seed pod remote sensing identification and extraction system based on an optimized YOLOX network, the system comprising:
[0026] The first processing module is configured to collect lotus pod images and perform data enhancement and label annotation on them to obtain a lotus pod image dataset; and divide the lotus pod image dataset into a training set and a test set;
[0027] The second processing module is configured to construct a YOLOX lotus detection network model by orderly connecting the input layer, the backbone network with CSPDarkNet53 as the basic architecture, the feature enhancement network adopting the composite structure scheme of FPN+PAN, and the output prediction layer;
[0028] The third processing module is configured to obtain an optimized YOLOX object detection network by adding a CA attention mechanism and an ASFF feature fusion layer to the YOLOX lotus detection network model;
[0029] A fourth processing module is configured to train the optimized YOLOX object detection network by referencing the training set;
[0030] The fifth processing module is configured to use the test set to test and evaluate the trained optimized YOLOX object detection network to obtain a lotus pod image detection result.
[0031] According to the system of the second aspect of the present invention, the third processing module is specifically configured as follows: the optimized YOLOX target detection network obtained by adding the CA attention mechanism and the ASFF feature fusion layer to the YOLOX lotus detection network model includes:
[0032] By adding a CA attention mechanism between the backbone network and the feature enhancement network, and adding an ASFF feature fusion layer between the feature enhancement network and the output prediction layer, an optimized YOLOX object detection network is obtained.
[0033] According to the system of the second aspect of the present invention, the third processing module is specifically configured as follows: adding a CA attention mechanism between the backbone network and the feature enhancement network comprises:
[0034] The CA attention modules are respectively attached to the output feature maps of the second, third and fourth CSP modules of the backbone network to obtain attention mechanism feature maps; and the attention mechanism feature maps are input into the feature enhancement network.
[0035] According to the system of the second aspect of the present invention, the third processing module is specifically configured to attach a CA attention module to the output feature map, respectively, and obtain an attention mechanism feature map including:
[0036] Inputting the output feature map into a residual module to obtain residual features;
[0037] Performing average pooling in the X direction and average pooling in the Y direction on the residual features to obtain an X-direction pooling feature map and a Y-direction pooling feature map;
[0038] The X-direction pooling feature map and the Y-direction pooling feature map are concatenated, and a first convolution feature map is obtained through a convolution layer;
[0039] Perform batch normalization and nonlinear transformation on the first convolution feature map to obtain a nonlinear feature map;
[0040] Applying convolution operations to the nonlinear feature map in the horizontal direction and the vertical direction respectively to obtain a second convolution feature map and a third convolution feature map;
[0041] Applying a Sigmoid function to the second convolution feature map and the third convolution feature map respectively to obtain a first function feature map and a second function feature map;
[0042] The first function feature map, the second function feature map and the residual feature are multiplied to obtain an attention mechanism feature map.
[0043] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in any one of the white lotus and lotus seed pod remote sensing identification and extraction methods based on an optimized YOLOX network in the first aspect of the present disclosure are implemented.
[0044] The fourth aspect of the present invention discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any one of the white lotus seed pod remote sensing identification and extraction methods based on an optimized YOLOX network in the first aspect of the present disclosure are implemented.
[0045] In summary, the solution proposed in the present invention can significantly enhance the network's detection sensitivity and recognition accuracy for small lotus pod targets by integrating the CA (Channel Attention) attention mechanism and the ASFF (Adaptive Spatial Feature Fusion) feature fusion module. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 It is a flowchart of a method for remote sensing identification and extraction of white lotus pods based on an optimized YOLOX network according to an embodiment of the present invention;
[0048] Figure 2 A network structure diagram of a basic YOLOX according to an embodiment of the present invention;
[0049] Figure 3 An optimized YOLOX network structure diagram according to an embodiment of the present invention;
[0050] Figure 4A CA attention mechanism network structure diagram according to an embodiment of the present invention;
[0051] Figure 5 A line chart showing changes in key indicators during the model training process according to an embodiment of the present invention;
[0052] Figure 6 is a diagram of detection results according to an embodiment of the present invention;
[0053] Figure 7 A structural diagram of a white lotus seed pod remote sensing identification and extraction system based on an optimized YOLOX network according to an embodiment of the present invention;
[0054] Figure 8 The figure is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0056] The first aspect of the present invention discloses a remote sensing identification and extraction method of white lotus pods based on an optimized YOLOX network. Figure 1 FIG. 4 is a flowchart of a method for remote sensing identification and extraction of white lotus pods based on an optimized YOLOX network according to an embodiment of the present invention. Figure 1 As shown, the method includes:
[0057] Step S1, collecting lotus pod images and performing data enhancement and labeling on them to obtain a lotus pod image dataset; dividing the lotus pod image dataset into a training set and a test set;
[0058] Step S2, constructing a YOLOX lotus pod detection network model by orderly connecting the input layer, the backbone network with CSPDarkNet53 as the basic architecture, the feature enhancement network with the composite structure of FPN+PAN, and the output prediction layer;
[0059] Step S3, by adding CA attention mechanism and ASFF feature fusion layer to the YOLOX lotus detection network model, an optimized YOLOX object detection network is obtained;
[0060] Step S4, referencing the training set to train the optimized YOLOX object detection network;
[0061] Step S5: Use the test set to test and evaluate the trained optimized YOLOX object detection network to obtain a lotus pod image detection result.
[0062] In step S1, lotus pod images are collected and data enhancement and label annotation are performed on them to obtain a lotus pod image dataset; the lotus pod image dataset is divided into a training set and a test set.
[0063] Specifically, we adopted a drone collection strategy and used the DJI Mavic 3M drone to perform aerial photography missions over the lotus fields, successfully capturing 300 real-life images of lotus pods covering various angles, lighting conditions, and growth stages. In order to further improve the generalization ability of the model and cope with the diversity and complexity in practical applications, the dataset expansion in this paper uses a random combination of four core data enhancement methods: random brightness adjustment (including increase and decrease), and horizontal and vertical image flipping, to expand the original 300 images to 1,500 images; using the open source annotation tool LabelImg, we finely annotated the enhanced lotus pod images, drew precise rectangular boxes around each lotus pod instance, and stored the annotated data in a way that complies with the YOLO format, finally completing the construction of a dataset dedicated to lotus pod detection. Finally, on the premise of ensuring that the data set is sufficient and balanced, in accordance with industry practice, the entire labeled lotus pod detection data set is divided into training set and test set in a ratio of 9:1. 90% of the samples are used for model training to learn to identify the characteristic patterns of lotus pods, and the remaining 10% of the samples are used as an independent test set to objectively evaluate the performance of the model on unknown data, thereby effectively guiding the model optimization and iteration process.
[0064] In step S2, the YOLOX lotus detection network model is constructed by sequentially connecting the Input layer, the backbone network with CSPDarkNet53 as the basic architecture, the feature enhancement network adopting the composite structure scheme of FPN+PAN, and the output prediction layer.
[0065] Specifically, if Figure 2As shown in the figure, the overall architecture of the YOLOX lotus detection network model is divided into four key components, which are connected in an orderly manner to jointly realize the target detection function. The first is the Input module, which is responsible for receiving the image data to be detected. The size of the received image is adjustable and can be flexibly set according to different task scenarios and performance requirements. At this stage, the system will pre-adaptively resize and standardize the input image to meet the input specification requirements of the subsequent network model. Then there is the Backbone layer, which uses the optimized version of CSPDarkNet53 as the core network of the infrastructure. This part integrates multiple sub-structure units such as Focus, CSPNet, and SPPBottleNet to extract the key feature expressions of the image. Further is the Neck layer design, which adopts the composite structure of FPN+PAN. The FPN component is responsible for gradually transmitting powerful features rich in semantic information from the high level to the low level. At the same time, the PAN structure adds a reversely constructed feature pyramid on the basis of FPN, which is mainly used to transmit significant feature signals from the bottom level to the top that help precise positioning. Finally, the Predict layer uses the Anchor Free method, no longer relying on predefined anchor boxes, and directly predicts the bounding box coordinates and category probabilities of the target through regression. Among them, the Focus module cuts the spatial dimensions of the original image and splices the channels, halving the width and height of the image, while increasing the number of channels fourfold. This operation not only increases the richness of the features, but also reduces the amount of calculation in subsequent layers. The CBS module consists of a convolutional layer (Conv), a batch normalization layer (BatchNorm), and an activation function (Silu). It can improve the expressiveness of features and the robustness of the model through standardization and nonlinear activation. The CSP (Cross Stage Partial Network) module improves the expressiveness of the model through cross-connections of some features. It consists of multiple convolutional layers and residual connections. It can divide the input feature map into two parts, one through a convolutional layer and a residual connection, and the other part is directly connected, and finally the two parts of the feature map are spliced. The SPP module extracts features of different receptive fields through multi-scale pooling operations, enhances the multi-scale information of the feature map, and makes the model more robust when processing targets of different sizes. The YOLOHead module is responsible for generating the final target detection results. Through multi-layer convolution operations, it generates the location information, confidence, and category probability of each prediction box, and finally selects the optimal detection result through NMS.
[0066] Although YOLOX performs very well in all aspects, there are still some problems in identifying small lotus pod targets in complex scenes. For example, the distribution of lotus pods in the complex environment of lotus fields is blocked, which will cause many false detections and missed detections. At the same time, the small scale of lotus pods and the complex background of lotus fields also affect the speed and accuracy of detection. In response to the above problems, this embodiment proposes an optimized YOLOX lotus pod target detection model, which ensures accuracy while further achieving a higher running speed.
[0067] In step S3, the optimized YOLOX object detection network is obtained by adding the CA attention mechanism and the ASFF feature fusion layer to the YOLOX lotus detection network model.
[0068] In some embodiments, in step S3, Figure 3 As shown, by adding the CA attention mechanism and the ASFF feature fusion layer to the YOLOX lotus detection network model, the optimized YOLOX target detection network includes:
[0069] By adding a CA attention mechanism between the backbone network and the feature enhancement network, and adding an ASFF feature fusion layer between the feature enhancement network and the output prediction layer, an optimized YOLOX object detection network is obtained.
[0070] The adding of CA attention mechanism between the backbone network and the feature enhancement network includes:
[0071] To achieve attention-guided feature enhancement, CA attention modules are attached to the output feature maps of the second, third and fourth CSP modules of the backbone network respectively to obtain attention mechanism feature maps, so that the network can dynamically readjust and allocate the importance of different channels in the process of gradually extracting abstract features; the attention mechanism feature map is input into the feature enhancement network.
[0072] like Figure 4 As shown, the CA attention modules are respectively attached to the output feature maps, and the obtained attention mechanism feature maps include:
[0073] Inputting the output feature map into a residual module to obtain residual features;
[0074] Performing average pooling in the X direction and average pooling in the Y direction on the residual features to obtain a C×H×1 X-direction pooling feature map and a C×1×W Y-direction pooling feature map;
[0075] The X-direction pooling feature map and the Y-direction pooling feature map are concatenated, and a first convolution feature map is obtained through a convolution layer, and the dimension is C / r×1×(W+H);
[0076] The first convolutional feature map is batch normalized and nonlinearly transformed to obtain a nonlinear feature map with the dimension unchanged;
[0077] Applying convolution operations to the nonlinear feature map in the horizontal direction and the vertical direction respectively to obtain a second convolution feature map of C×H×1 and a third convolution feature map of C×H×1;
[0078] Applying a Sigmoid function to the second convolution feature map and the third convolution feature map respectively to obtain a first function feature map of C×1×W and a second function feature map of C×1×W;
[0079] The first function feature map, the second function feature map and the residual feature are multiplied to obtain an attention mechanism feature map.
[0080] In step S4, the training set is referenced to train the optimized YOLOX object detection network.
[0081] Specifically, the training set is input into the optimized YOLOX lotus object detection network model for training; and the model training parameters are set as follows: number of iterations = 2000, batch size = 32, optimizer is SGD, initial learning rate = 0.01, momentum = 0.937. Figure 5 This figure shows the changing trends of key indicators of the optimized YOLOX lotus pod detection model during the training process. It can be seen that the model tends to converge after more than 2000 iterations, indicating that the model can extract the features of lotus pods from the input data and can accurately predict the location of lotus pods. However, the performance of the model needs to be further evaluated.
[0082] In step S5, the test set is used to test and evaluate the trained optimized YOLOX object detection network to obtain a lotus pod image detection result.
[0083] Specifically, precision, recall, average precision and F1-score; precision (P) indicates the proportion of samples predicted by the model to be lotus pods that are actually lotus pods; recall (R) indicates the proportion of all lotus pods that the model correctly finds out. Average precision (AP) is used to measure the average area under the precision and recall curves at each IoU threshold. The F1 score is the harmonic mean of precision and recall, which comprehensively reflects the balanced performance of the model in terms of precision and recall. The specific calculation formula is as follows:
[0084]
[0085] Where P(R) is the precision of the recall measurement, N is the number of target detections, TP is the number of lotus pods predicted correctly by the model, FP is the number of images where non-lotus pods are identified as lotus pods, and FN is the number of samples where lotus pods are identified as lotus pods.
[0086] Finally, the test set is input into the trained original YOLOX lotus pod detection network model and the optimized YOLOX lotus pod detection network model. Figure 6 This is the test result of using the optimized YOLOX model. It can be seen that the optimized YOLOX model can well identify and locate lotus pods. Table 1 shows the evaluation index results of the optimized YOLOX lotus pod detection network model during the training process.
[0087] Table 1
[0088] P / % R / % AP / % F1 YOLOX 82.42 81.93 81.90 0.82 Optimized YOLOX 83.54 83.54 84.72 0.84
[0089] It has been verified that the optimized YOLOX lotus pod detection network model has shown significant performance improvement. In the test set, the recognition accuracy of the lotus pod target climbed to 83.54%. At the same time, the recall rate of the lotus pod target also reached the same value of 83.54%, and the corresponding F1 score was 0.84. Compared with the original model, this optimization has achieved steady growth in various key indicators, specifically: the accuracy rate increased by 1.12 percentage points, the recall rate increased by 1.6 percentage points, and the F1 score increased by 2.82 percentage points. In addition, it is worth noting that the number of model parameters and the computational load have been effectively reduced, which reveals that the present invention can successfully balance the detection speed while maintaining a high detection accuracy, achieving a good balance between accuracy and efficiency.
[0090] In summary, the detection capability of small-sized lotus pods is enhanced: the CA attention mechanism integrated in the YOLOX network can dynamically adjust the importance of each channel of the feature map, especially for the detection of small-sized lotus pods. By focusing on the key channel features related to target detection, it helps the model capture weak but important target signals, thereby improving the detection accuracy and recall rate of small-sized lotus pods. The ASFF feature fusion module can flexibly fuse feature information from different levels, especially for cross-scale targets. For lotus pod targets of different sizes, adaptive spatial feature fusion can make up for the shortcomings of single-scale feature maps in small target detection.
[0091] Improve the robustness and generalization of feature representation: The CA attention mechanism can effectively suppress irrelevant background noise, highlight potential lotus target features, and enhance the model's ability to distinguish lotus features, even in complex backgrounds or with large changes in illumination. The ASFF module integrates multi-level features, allowing the model to fully utilize the advantages of multi-scale features when processing various complex scenes and lotus pods in different postures, thereby improving the model's robustness and generalization in different situations.
[0092] Speed up inference and optimize memory usage: The CA attention mechanism selectively enhances only the features of the channel dimension through lightweight operations, avoiding excessive computational overhead, which helps the YOLOX network maintain a faster running speed while ensuring detection performance. Compared with traditional FPN and other methods, ASFF feature fusion can reduce redundant calculations while enhancing the effectiveness of features through a more effective feature integration method, which is particularly critical for embedded devices or drones in real-time transmission scenarios, and can achieve the construction of a lotus detection system with fast response and low resource consumption.
[0093] The second aspect of the present invention discloses a white lotus seed pod remote sensing identification and extraction system based on an optimized YOLOX network. Figure 7 : is a structural diagram of a white lotus remote sensing identification and extraction system based on an optimized YOLOX network according to an embodiment of the present invention; Figure 7 As shown, the system 100 includes:
[0094] The first processing module 101 is configured to collect lotus pod images and perform data enhancement and labeling on them to obtain a lotus pod image dataset; and divide the lotus pod image dataset into a training set and a test set;
[0095] The second processing module 102 is configured to construct a YOLOX lotus detection network model by sequentially connecting the input layer, the backbone network with CSPDarkNet53 as the basic architecture, the feature enhancement network adopting the composite structure scheme of FPN+PAN, and the output prediction layer;
[0096] The third processing module 103 is configured to obtain an optimized YOLOX object detection network by adding a CA attention mechanism and an ASFF feature fusion layer to the YOLOX lotus detection network model;
[0097] The fourth processing module 104 is configured to train the optimized YOLOX object detection network by referencing the training set;
[0098] The fifth processing module 105 is configured to use the test set to test and evaluate the trained optimized YOLOX object detection network to obtain a lotus pod image detection result.
[0099] According to the system of the second aspect of the present invention, the first processing module 101 is specifically configured as follows: in order to further improve the generalization ability of the model and cope with the diversity and complexity in practical applications, the data set expansion of this paper adopts a random combination of four core data enhancement methods, namely, random brightness adjustment (including increase and decrease), and horizontal and vertical flipping of the image, to expand the original 300 images to 1500 images; using the open source annotation tool LabelImg, the enhanced lotus pod images are finely annotated, and precise rectangular boxes are drawn around each lotus pod instance, and the annotated data is stored in a manner that conforms to the YOLO format, and finally the construction of a data set dedicated to lotus pod detection is completed. Finally, under the premise of ensuring that the data set is sufficient and balanced, in accordance with the common practice in the industry, the entire annotated lotus pod detection data set is divided into a training set and a test set at a ratio of 9:1, wherein 90% of the samples are used for model training to learn to identify the characteristic patterns of lotus pods, and the remaining 10% of the samples are used as independent test sets to objectively evaluate the performance of the model on unknown data, thereby effectively guiding the model optimization and iteration process.
[0100] According to the system of the second aspect of the present invention, the second processing module 102 is specifically configured as follows: Figure 2As shown in the figure, the overall architecture of the YOLOX lotus detection network model is divided into four key components, which are connected in an orderly manner to jointly realize the target detection function. The first is the Input module, which is responsible for receiving the image data to be detected. The size of the received image is adjustable and can be flexibly set according to different task scenarios and performance requirements. At this stage, the system will pre-adaptively resize and standardize the input image to meet the input specification requirements of the subsequent network model. Then there is the Backbone layer, which uses the optimized version of CSPDarkNet53 as the core network of the infrastructure. This part integrates multiple sub-structure units such as Focus, CSPNet, and SPPBottleNet to extract the key feature expressions of the image. Further is the Neck layer design, which adopts the composite structure of FPN+PAN. The FPN component is responsible for gradually transmitting powerful features rich in semantic information from the high level to the low level. At the same time, the PAN structure adds a reversely constructed feature pyramid on the basis of FPN, which is mainly used to transmit significant feature signals from the bottom level to the top that help precise positioning. Finally, the Predict layer uses the Anchor Free method, no longer relying on predefined anchor boxes, and directly predicts the bounding box coordinates and category probabilities of the target through regression. Among them, the Focus module cuts the spatial dimensions of the original image and splices the channels, halving the width and height of the image, while increasing the number of channels fourfold. This operation not only increases the richness of the features, but also reduces the amount of calculation in subsequent layers. The CBS module consists of a convolutional layer (Conv), a batch normalization layer (BatchNorm), and an activation function (Silu). It can improve the expressiveness of features and the robustness of the model through standardization and nonlinear activation. The CSP (Cross Stage Partial Network) module improves the expressiveness of the model through cross-connections of some features. It consists of multiple convolutional layers and residual connections. It can divide the input feature map into two parts, one through a convolutional layer and a residual connection, and the other part is directly connected, and finally the two parts of the feature map are spliced. The SPP module extracts features of different receptive fields through multi-scale pooling operations, enhances the multi-scale information of the feature map, and makes the model more robust when processing targets of different sizes. The YOLOHead module is responsible for generating the final target detection results. Through multi-layer convolution operations, it generates the location information, confidence, and category probability of each prediction box, and finally selects the optimal detection result through NMS.
[0101] Although YOLOX performs very well in all aspects, there are still some problems in identifying small lotus pod targets in complex scenes. For example, the distribution of lotus pods in the complex environment of lotus fields is blocked, which will cause many false detections and missed detections. At the same time, the small scale of lotus pods and the complex background of lotus fields also affect the speed and accuracy of detection. In response to the above problems, this embodiment proposes an optimized YOLOX lotus pod target detection model, which ensures accuracy while further achieving a higher running speed.
[0102] According to the system of the second aspect of the present invention, the third processing module 103 is specifically configured as follows: Figure 3 As shown, by adding the CA attention mechanism and the ASFF feature fusion layer to the YOLOX lotus detection network model, the optimized YOLOX target detection network includes:
[0103] By adding a CA attention mechanism between the backbone network and the feature enhancement network, and adding an ASFF feature fusion layer between the feature enhancement network and the output prediction layer, an optimized YOLOX object detection network is obtained.
[0104] The adding of CA attention mechanism between the backbone network and the feature enhancement network includes:
[0105] To achieve attention-guided feature enhancement, CA attention modules are attached to the output feature maps of the second, third and fourth CSP modules of the backbone network respectively to obtain attention mechanism feature maps, so that the network can dynamically readjust and allocate the importance of different channels in the process of gradually extracting abstract features; the attention mechanism feature map is input into the feature enhancement network.
[0106] like Figure 4 As shown, the CA attention modules are respectively attached to the output feature maps, and the obtained attention mechanism feature maps include:
[0107] Inputting the output feature map into a residual module to obtain residual features;
[0108] Performing average pooling in the X direction and average pooling in the Y direction on the residual features to obtain a C×H×1 X-direction pooling feature map and a C×1×W Y-direction pooling feature map;
[0109] The X-direction pooling feature map and the Y-direction pooling feature map are concatenated, and a first convolution feature map is obtained through a convolution layer, and the dimension is C / r×1×(W+H);
[0110] The first convolutional feature map is batch normalized and nonlinearly transformed to obtain a nonlinear feature map with the dimension unchanged;
[0111] Applying convolution operations to the nonlinear feature map in the horizontal direction and the vertical direction respectively to obtain a second convolution feature map of C×H×1 and a third convolution feature map of C×H×1;
[0112] Applying a Sigmoid function to the second convolution feature map and the third convolution feature map respectively to obtain a first function feature map of C×1×W and a second function feature map of C×1×W;
[0113] The first function feature map, the second function feature map and the residual feature are multiplied to obtain an attention mechanism feature map.
[0114] According to the system of the second aspect of the present invention, the fourth processing module 104 is specifically configured to input the training set into the optimized YOLOX lotus target detection network model for training; and the model training parameters are set as follows: number of iterations = 2000 times, batch size = 32, optimizer is SGD, initial learning rate = 0.01, momentum = 0.937. Figure 5 This figure shows the changing trends of key indicators of the optimized YOLOX lotus pod detection model during the training process. It can be seen that the model tends to converge after more than 2000 iterations, indicating that the model can extract the features of lotus pods from the input data and can accurately predict the location of lotus pods. However, the performance of the model needs to be further evaluated.
[0115] According to the system of the second aspect of the present invention, the fifth processing module 105 is specifically configured as accuracy (Precision), recall rate (Recall), average precision (Average Precision) and F1 score (F1-Score); the accuracy rate (P) indicates the proportion of samples predicted by the model to be lotus pods that are actually lotus pods; the recall rate (R) indicates the proportion of all lotus pods that the model correctly finds out. Average precision (AP) is used to measure the average of the areas under the precision and recall curves at each IoU threshold. The F1 score is the harmonic mean of precision and recall, which comprehensively reflects the balanced performance of the model in terms of precision and recall. The specific calculation formula is as follows:
[0116]
[0117] Where P(R) is the precision of the recall measurement, N is the number of target detections, TP is the number of lotus pods predicted correctly by the model, FP is the number of images where non-lotus pods are identified as lotus pods, and FN is the number of samples where lotus pods are identified as lotus pods.
[0118] Finally, the test set is input into the trained original YOLOX lotus pod detection network model and the optimized YOLOX lotus pod detection network model. Figure 6This is the test result of using the optimized YOLOX model. It can be seen that the optimized YOLOX model can well identify and locate lotus pods. Table 1 shows the evaluation index results of the optimized YOLOX lotus pod detection network model during the training process.
[0119] It has been verified that the optimized YOLOX lotus pod detection network model has shown significant performance improvement. In the test set, the recognition accuracy of the lotus pod target climbed to 83.54%. At the same time, the recall rate of the lotus pod target also reached the same value of 83.54%, and the corresponding F1 score was 0.84. Compared with the original model, this optimization has achieved steady growth in various key indicators, specifically: the accuracy rate increased by 1.12 percentage points, the recall rate increased by 1.6 percentage points, and the F1 score increased by 2.82 percentage points. In addition, it is worth noting that the number of model parameters and the computational load have been effectively reduced, which reveals that the present invention can successfully balance the detection speed while maintaining a high detection accuracy, achieving a good balance between accuracy and efficiency.
[0120] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the white lotus and lotus seed pod remote sensing identification and extraction methods based on an optimized YOLOX network disclosed in the first aspect of the present invention are implemented.
[0121] Figure 8 is a structural diagram of an electronic device according to an embodiment of the present invention, such as Figure 8 As shown, the electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, near field communication (NFC) or other technologies. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a button, a trackball or a touch pad set on the housing of the electronic device, or an external keyboard, touch pad or mouse, etc.
[0122] Those skilled in the art will understand that Figure 8The structure shown in the figure is only a structural diagram of the part related to the technical solution of the present disclosure, and does not constitute a limitation on the electronic device to which the technical solution of the present application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0123] The fourth aspect of the present invention discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any one of the steps in the method for remote sensing identification and extraction of white lotus pods based on an optimized YOLOX network disclosed in the first aspect of the present invention are implemented.
[0124] Please note that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several variations and improvements can be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the patent in this application shall be based on the attached claims.
Claims
1. A method for remote sensing identification and extraction of white lotus pods based on optimized YOLOX network, characterized in that: The method comprises: Step S1, collecting lotus pod images and performing data enhancement and labeling on them to obtain a lotus pod image dataset; dividing the lotus pod image dataset into a training set and a test set; Step S2, constructing the YOLOX lotus detection network model by orderly connecting the input layer with CSPDarkNet53 as the backbone network of the basic architecture, the feature enhancement network adopting the composite structure solution of FPN+PAN, and the output prediction layer; Step S3, by adding CA attention mechanism and ASFF feature fusion layer to the YOLOX lotus detection network model, an optimized YOLOX object detection network is obtained; Step S4, referencing the training set to train the optimized YOLOX object detection network; Step S5: Use the test set to test and evaluate the trained optimized YOLOX object detection network to obtain a lotus pod image detection result.
2. The method for remote sensing identification and extraction of white lotus pods based on optimized YOLOX network according to claim 1, characterized in that: In step S3, the optimized YOLOX target detection network obtained by adding CA attention mechanism and ASFF feature fusion layer to the YOLOX lotus detection network model includes: By adding a CA attention mechanism between the backbone network and the feature enhancement network, and adding an ASFF feature fusion layer between the feature enhancement network and the output prediction layer, an optimized YOLOX object detection network is obtained.
3. The method for remote sensing identification and extraction of white lotus pods based on optimized YOLOX network according to claim 2, characterized in that: In the step S3, adding a CA attention mechanism between the backbone network and the feature enhancement network includes: The CA attention modules are respectively attached to the output feature maps of the second, third and fourth CSP modules of the backbone network to obtain attention mechanism feature maps; and the attention mechanism feature maps are input into the feature enhancement network.
4. The method for remote sensing identification and extraction of white lotus pods based on optimized YOLOX network according to claim 3 is characterized in that: In step S3, the CA attention modules are respectively attached to the output feature maps, and the attention mechanism feature maps obtained include: Inputting the output feature map into a residual module to obtain residual features; Performing average pooling in the X direction and average pooling in the Y direction on the residual features to obtain an X-direction pooling feature map and a Y-direction pooling feature map; The X-direction pooling feature map and the Y-direction pooling feature map are concatenated, and a first convolution feature map is obtained through a convolution layer; Perform batch normalization and nonlinear transformation on the first convolution feature map to obtain a nonlinear feature map; Applying convolution operations to the nonlinear feature map in the horizontal direction and the vertical direction respectively to obtain a second convolution feature map and a third convolution feature map; Applying a Sigmoid function to the second convolution feature map and the third convolution feature map respectively to obtain a first function feature map and a second function feature map; The first function feature map, the second function feature map and the residual feature are multiplied to obtain an attention mechanism feature map.
5. A white lotus seed pod remote sensing identification and extraction system based on optimized YOLOX network, characterized in that: The system comprises: The first processing module is configured to collect lotus pod images and perform data enhancement and label annotation on them to obtain a lotus pod image dataset; and divide the lotus pod image dataset into a training set and a test set; The second processing module is configured to construct a YOLOX lotus detection network model by orderly connecting the input layer, the backbone network with CSPDarkNet53 as the basic architecture, the feature enhancement network adopting the composite structure scheme of FPN+PAN, and the output prediction layer; The third processing module is configured to obtain an optimized YOLOX object detection network by adding a CA attention mechanism and an ASFF feature fusion layer to the YOLOX lotus detection network model; A fourth processing module is configured to train the optimized YOLOX object detection network by referencing the training set; The fifth processing module is configured to use the test set to test and evaluate the trained optimized YOLOX object detection network to obtain a lotus pod image detection result.
6. The white lotus seed pod remote sensing identification and extraction system based on optimized YOLOX network according to claim 5 is characterized in that: The optimized YOLOX target detection network obtained by adding CA attention mechanism and ASFF feature fusion layer to the YOLOX lotus detection network model includes: By adding a CA attention mechanism between the backbone network and the feature enhancement network, and adding an ASFF feature fusion layer between the feature enhancement network and the output prediction layer, an optimized YOLOX object detection network is obtained.
7. The white lotus seed pod remote sensing identification and extraction system based on optimized YOLOX network according to claim 6, characterized in that: The adding of CA attention mechanism between the backbone network and the feature enhancement network includes: The CA attention modules are respectively attached to the output feature maps of the second, third and fourth CSP modules of the backbone network to obtain attention mechanism feature maps; and the attention mechanism feature maps are input into the feature enhancement network.
8. The white lotus seed pod remote sensing identification and extraction system based on optimized YOLOX network according to claim 7, characterized in that: The CA attention modules are respectively added to the output feature maps, and the obtained attention mechanism feature maps include: Inputting the output feature map into a residual module to obtain residual features; Performing average pooling in the X direction and average pooling in the Y direction on the residual features to obtain an X-direction pooling feature map and a Y-direction pooling feature map; The X-direction pooling feature map and the Y-direction pooling feature map are concatenated, and a first convolution feature map is obtained through a convolution layer; Perform batch normalization and nonlinear transformation on the first convolution feature map to obtain a nonlinear feature map; Applying convolution operations to the nonlinear feature map in the horizontal direction and the vertical direction respectively to obtain a second convolution feature map and a third convolution feature map; Applying a Sigmoid function to the second convolution feature map and the third convolution feature map respectively to obtain a first function feature map and a second function feature map; The first function feature map, the second function feature map and the residual feature are multiplied to obtain an attention mechanism feature map.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps of the white lotus and lotus seed pod remote sensing identification and extraction method based on optimized YOLOX network described in any one of claims 1 to 4 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the white lotus and lotus seed pod remote sensing identification and extraction method based on the optimized YOLOX network described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Wheat ear detection method based on improved YOLOv5
CN114973002A
Pedestrian occlusion detection method based on improved YOLOX algorithm
CN115082855A
Face detection method in classroom environment based on YOLO deep network and detection system thereof
CN115240259A
Remote sensing image target detection method based on improved lightweight YOLOv4
CN116363529A
Optical remote sensing image ground object detection method based on YOLOX
CN116385876A
