Soybean pod living body detection method based on improved deep learning

By improving the SCCBlock, UIBC2f modules, and DAT attention mechanism of the YOLOv8 framework and combining them with a small object detection layer, a PodYOLO model was constructed. This solved the robustness and generalization problems of soybean pod detection in complex environments, and achieved fast and accurate live pod detection.

CN122048823APending Publication Date: 2026-05-15HEILONGJIANG BAYI AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HEILONGJIANG BAYI AGRICULTURAL UNIVERSITY
Filing Date
2026-01-14
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing soybean pod detection technologies lack robustness in complex natural environments, and their generalization ability across different growth stages is not sufficiently validated. There are also few studies on multi-stage live pod detection.

Method used

The PodYOLO model was constructed by introducing the SCCBlock module, UIBC2f module, DAT attention mechanism and small object detection layer into the YOLOv8 framework, optimizing the backbone and neck network structure, and combining data augmentation techniques to achieve fast and accurate pod detection.

Benefits of technology

It significantly improves the ability to identify soybean pods, enabling rapid and accurate live identification and detection of soybean pods in complex environments, providing a tool for high-throughput phenotyping and digital breeding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122048823A_ABST
    Figure CN122048823A_ABST
Patent Text Reader

Abstract

The soybean pod living body detection method based on improved deep learning belongs to a detection method, an SCCBlock module is introduced into a trunk part of a network, and separation, reconstruction, segmentation, transformation and fusion operation can be sequentially carried out on a feature map; the neck network adopts a UIBC2f module, and the optimal balance of feature fusion efficiency and model lightweight is realized in combination with depth separable convolution and reverse bottleneck design. And meanwhile, the DAT module is inserted between the SPPF module and the up-sampling operation, so that more flexible and accurate feature sampling can be realized. According to the network, a detection head is additionally arranged at a Head part, so that the detection capability of a small-scale pod target is improved. The interference of background similar areas such as stalks and leaves is reduced, so that the foreground and background distinguishing capability of the model is enhanced, the detection precision and robustness of the living bean pods are remarkably improved, the detection requirements in a complex environment are fully met, and the living recognition and detection of the soybean pods can be quickly and accurately realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention pertains to detection methods, and in particular relates to a method for detecting live soybean pods based on improved deep learning. Background Technology

[0002] Soybeans, as a crucial dual-purpose crop for both food and oil production globally, not only provide edible raw materials but also serve as processing by-products and animal feed, playing a central role in ensuring food security and supporting the industrial economy. As a homologous organ to leaves, the pod is the direct carrier of seed formation and yield; its number and morphology reflect the plant's growth status and are of key significance for breeding selection and cultivation management. Therefore, developing efficient methods for pod detection is essential.

[0003] To improve the accuracy and speed of detection, many studies have focused on achieving automatic identification of crop organs based on machine vision technology, using visual servo control to achieve efficient crop organ detection and improve harvesting performance. Traditional algorithms use texture features to extract and encode object features, which have been widely used in crop identification. However, single-dimensional features are greatly affected by environmental conditions and often require manual feature design, resulting in limited robustness and generalization ability. In recent years, deep learning-based object detection technology has been applied to detect ecological and morphological traits of crops, achieving good results in detecting crop fruits, diseases, stems, growth, and many other aspects. For the specific task of soybean pod detection, researchers have proposed several innovative methods. Zhang et al. published a paper titled "High-Throughput Classification and Counting of Vegetable Soybean Pods Based on Deep Learning" in the journal *Agronomy* in April 2023, utilizing instance segmentation for high-throughput classification and counting of vegetable soybean pods, improving the automation level in breeding scenarios (C. Zhang et al., 2023). Yu et al. published a paper titled "Accurate and fast implementation of soybean pod counting and localization from high-resolution image" in the journal *Frontiers in Plant Science* in February 2024, constructing a lightweight neural network to adapt to the deployment requirements of edge devices, significantly reducing parameter size and computational overhead while effectively maintaining pod counting accuracy (Yu et al., 2024). Li et al. published a paper titled "SoybeanNet: Transformer-based convolutional neural network for soybean pod counting from Unmanned..." in the journal *Computers and Electronics in Agriculture* in May 2024. For aerial vehicle (UAV) images, SoybeanNet based on Transformer is proposed for aerial field scenes. It performs pod counting based on UAV images, realizing cross-scale feature fusion and robust counting (J. Li et al., 2024).However, most existing studies rely heavily on image data or specific hardware devices, resulting in insufficient robustness in complex natural environments; at the same time, the generalization ability of soybean plants at different growth stages has not been fully verified, and there are few reports on the detection of live pods at multiple stages. Summary of the Invention

[0004] This invention aims to overcome the shortcomings of existing technologies and provide a soybean pod liveness detection method based on improved deep learning. Taking soybean plants from the pod-setting stage to the full maturity stage as the research object, the invention uses a self-developed soybean plant image acquisition system to acquire soybean plant images and construct a standardized dataset. A deep learning framework for the pod detection network PodYOLO is designed. Based on the detection results, a calculation method for key phenotypic features such as pod length, pod width, and pod color is proposed, realizing the automatic quantitative analysis of these phenotypic parameters. A fast and accurate soybean pod liveness detection model and phenotypic feature extraction method are proposed.

[0005] The soybean pod liveness detection method based on improved deep learning of the present invention is implemented through the following steps: (I) Constructing the dataset (1) Data collection: Collect no less than 205 high-resolution original images of soybeans from the pod-setting stage to the full maturity stage, and annotate the collected original images and divide them into training set, validation set and test set in a ratio of 7:1:2; (2) Data augmentation: Data augmentation is performed on the original images of the four periods obtained in step (1); (II) Construction of the PodYOLO model (1) Construct the SCCBlock module: In the original YOLOv8 architecture, the C2f module in the backbone network is replaced with the SCCBlock module. The SCC-BN module in the SCCBlock module mainly consists of two key components: the Spatial Reconstruction Unit (SRU) module and the Channel Reconstruction Unit (CRU) module. For input features... First, spatial refinement features are obtained through SRU operation. Then, the channel refinement features are obtained using the CRU operation. ; 2) Build the UIBC2f module The C2f module in the neck network of the original YOLOv8 architecture was replaced with UIBC2f, and the Bottleneck module in the traditional C2f was replaced with the ExtraDW module. The input feature map... The output features are obtained through alternating processing of depthwise separable convolution and pointwise convolution. ; (3) Introduce DAT attention mechanism The Deformable Attention Transformer module is introduced. The module uses bilinear interpolation to extract sampled features from the original feature map, and generates deformed keys and deformed values ​​through projection transformation. Then, the standard multi-head attention mechanism is used to realize the alignment calculation of the query and the sampled key, and the key feature information is extracted from the deformed value. (4) Add a small target detection layer A small target detection module was designed based on the original neck network structure of YOLOv8, and a P2 feature layer was introduced, with a spatial resolution of 160×160. The P2 detection layer designed an upsampling and fusion path from P2 to P3 through the UCC2f module. The number of channels of the P3 feature map was adjusted by 1×1 convolution, and then upsampled by 2 times. The feature information of the deep network was effectively fused with the feature information extracted directly from the shallow features of the backbone network by element-level addition. (5) Model construction of PodYOLO, a pod recognition network After the data augmentation image obtained in step 1 (2) is improved and fed into the YOLO8 network, the data is first input into the backbone network in the form of a three-channel image tensor. The backbone network transforms the data layer by layer through continuous convolution operations. As the network depth increases, the spatial size of the feature map gradually decreases and the number of channels gradually increases, thus forming a multi-level feature representation from shallow to deep. In several feature extraction layers of the backbone network, the convolution outputs are no longer stacked using the traditional bottleneck structure, but are instead input into the SCCBlock for processing. After receiving the feature tensor of the current layer, the SCCBlock first enters the Spatial Reconstruction Unit (SRU). The SRU normalizes the features and calculates the gate weights. The gate weights are nonlinearly mapped to form response coefficients to spatial positions. Based on this, the features are divided into two groups of spatial response regions and weighted separately. Then, the two groups of features are recombined and spliced ​​through cross-reconstruction to obtain the reconstructed feature map in the spatial dimension. The spatial reconstruction output then enters the Channel Reconstruction Unit (CRU). The CRU segments the input features along the channel dimension. The upper branch first adjusts the channels and then performs feature transformation and fusion through group convolution and pointwise convolution. The lower branch extracts detailed features through pointwise convolution and concatenates them with the lower branch input to form the lower branch output. Global average pooling is then applied to the outputs of both branches to obtain channel statistics. Channel weights are generated based on these statistics, and the features from both branches are weighted and fused to output a reconstructed feature tensor along the channel dimension. Features from the ends of the backbone network enter the SPPF module, where multi-scale pooling is used to aggregate deep feature representations. These deep features, along with the multi-scale lateral features of the backbone network, are then provided to the neck network. After receiving multi-scale features from the backbone network, the neck network performs multi-scale fusion along a bidirectional path from top to bottom and bottom to top. First, the deepest aggregated features are processed by the DAT module before entering the upsampling fusion path. DAT establishes a set of reference points on the feature map and generates sampling offsets for these reference points through an offset prediction branch. Then, it interpolates and samples the features at the offset positions to obtain deformed key-value features. Multi-head attention computation is then performed to align and aggregate the query features with the sampled features, outputting an attention-enhanced deep feature tensor. After attention enhancement, the deep features enter the top-down fusion process. This process improves spatial resolution through upsampling and concatenates the features with the lateral features output by the backbone network at the same scale along the channel dimension. The concatenated features are then reorganized by the fusion module. At multiple fusion locations, the fusion module uses UIBC2f instead of the conventional C2f. UIBC2f uses a unified inverse bottleneck structure as its basic unit, employing pointwise convolutions and depthwise separable convolutions to perform channel mixing and spatial feature extraction. Additional depthwise separable convolutions can be inserted between pointwise convolutions to increase the number of feature transformations. After multiple upsampling, stitching, and fusion processes, high-resolution fused features are obtained. Then, a bottom-up fusion process is initiated. The high-resolution fused features are downsampled using convolution to reduce their spatial resolution and stitched together with features of the corresponding scale from the top-down path. The fusion module then outputs the fusion result at that scale. This downsampling, stitching, and fusion process is repeated step-by-step to form a set of output features at different scales, which are used for multi-scale prediction by the subsequent detection head. The detection head performs prediction calculations on the features at each scale output by the neck network. The input features at each scale are first mapped to the prediction space through convolution, generating classification predictions and bounding box regression predictions. The classification branch outputs the confidence scores for each category, and the regression branch outputs the regression values ​​for the bounding box position and size. The prediction results at each scale are expanded spatially and aggregated to form a candidate set. Then, the final detection result is obtained through confidence score filtering and non-maximum suppression. The high-resolution branch for small targets also follows the same process to complete predictions and participate in aggregation and post-processing, thus forming a complete multi-scale detection output, thereby completing the construction of the PodYOLO model for pod recognition. (III) Pod Phenotypic Detection The pod identification network PodYOLO constructed in step (ii) is used to detect the pod phenotype.

[0006] As a further improvement of the present invention, the SRU module, through a separation-reconstruction method, divides the input feature map into information-rich regions and information-poor regions according to the amount of information, and then fuses them after differential processing. Initially, group normalization (GN) is used to standardize the input feature map to improve the stability of the features and reduce the distribution differences between different samples. The calculation formula is as follows: (1) in, Input feature map; The mean; Standard deviation; To maintain stability and prevent division by zero; This is the scaling factor; This is the offset; This is the output after group normalization; The output features are normalized; the formula for calculating the normalized relevance weights is: (2) in, For the first Scaling factor for each channel; This is the sum of the scaling factors for all channels; Number of channels; For summation index; For the first Normalized weight values ​​for each channel; The correlation coefficient is the normalized value. Input feature map After the weight information is mapped to the (0, 1) interval through the Sigmoid function, a threshold discrimination mechanism is used to determine the weights. Weights above the threshold are reset to 1 to obtain weights with rich information. Weights below the threshold are reset to 0 to obtain non-informative weights. This process can be represented as: (3) in, For gated functions; For activation functions; This is the processed weight matrix; Input feature map and Multiplying them yields two sets of weighted feature maps. and , It contains rich information that can more effectively express and distinguish the spatial structure of images, and Containing very little information, the SRU module proposes a Reconstruct operation, employing a cross-reconstruction approach to fully integrate information-rich features with less information-rich features, enhancing information flow. Finally, by concatenating the cross-reconstructed features, a more information-rich, spatially refined feature map is generated, effectively saving space resources. The entire Reconstruct operation can be represented as: (4) in, It is characterized by its rich information content; It is characterized by a relatively small amount of information; and The weights of the two sets of features; , , , Sub-features in cross-reconstruction; and These are the two sets of feature maps after cross-reconstruction; For spatial refinement of feature maps; This is element-wise multiplication; This is element-wise addition; This is for splicing operations.

[0007] As a further improvement of the present invention, the CRU module uses a segmentation-transformation-fusion method instead of standard convolution for feature extraction, reducing the feature map size. To reduce channel redundancy, the channels of the spatially refined feature map are split into two parts: One channel and The feature map is divided into several channels, and then a 1×1 convolution is used to obtain the upper-layer input feature map by converting the number of channels of the feature map. and lower layer input feature map ; In the upper-level transformation stage, the CRU module uses Group-Wise Convolution (GWC) and Point-Wise Convolution (PWC) instead of traditional convolution to transform the upper-level input feature maps. GWC and PWC operations are performed separately, and then the upper-layer output feature map is obtained through an addition operation at a lower cost than standard convolution. Its expression is: (5) in, and These are the learnable weight matrices for GWC and PWC, respectively. This is the output feature map for the upper layer; In the lower-level transformation stage, the CRU module uses PWC operations to generate shallow detail feature maps to supplement the features extracted in the upper-level transformation stage, and reuses the lower-level input feature maps. To obtain more feature information while keeping computational costs constant, the generated features and the lower-level input features are concatenated to obtain the lower-level output feature map, expressed as: (6) in, This is the learnable weight matrix for PWC; For feature splicing operations; This is the output feature map for the lower layer; After transformation and Global average pooling is used to aggregate information from the entire spatial area, resulting in a statistic reflecting the overall activity level of each channel. The calculation formula is as follows: (7) in, Input feature map; and These are the height and width of the feature map, respectively; For feature map In spatial location eigenvectors; This is a global pooling operation; For the obtained channel statistics; They were obtained respectively and Global channel statistics and Then, they are stacked together and a weight vector is generated through a channel-wise soft attention operation. Then, using the feature importance vector as channel weights, the upper and lower layer features are fused in a channel-based manner to obtain the refined features. The calculation formula is as follows: (8) (9) in, and They are respectively and Global channel statistics; It is an exponential function; and This is the feature importance vector; and These are respectively channel-based fusion of upper-layer and lower-layer feature maps; To obtain the final refined feature map of the channel.

[0008] This invention presents an improved deep learning-based method for soybean pod liveness detection. Building upon the YOLOv8 framework, it introduces the SCCBlock and UIBC2f modules to optimize the backbone and neck network structures, respectively. Simultaneously, it combines the DAT attention mechanism and a small target detection layer to construct a high-performance PodYOLO model, significantly enhancing pod recognition capabilities in complex environments. This method enables rapid and accurate liveness detection of soybean pods, providing a powerful tool for advancing future high-throughput phenotyping and digital breeding of soybeans. Attached Figure Description

[0009] Figure 1 Schematic diagram of the test site and image acquisition device; Figure 2 Augment the graph for the data; Figure 3 This is a diagram of the YOLOv8 network structure. Figure 4 Here is a structural diagram of the SCCBlock module; Figure 5 This is a diagram of the UIBC2f module structure. Figure 6 For UIB modules and their variants; Figure 7 Here is a diagram of the DAT module structure; Figure 8 YOLO network structure diagram with P2 detection layer added; Figure 9 Diagram of the PodYOLO network structure; Figure 10 Flowchart for pod length and pod width detection; Figure 11 Here is a flowchart for color recognition; Figure 12 A comparison chart of the results of the bean pod testing; Figure 13 A comparison chart of phenotypic parameter detection results; Figure 14 A color recognition image for each stage of the bean pod. Detailed Implementation

[0010] The soybean pod liveness detection method based on improved deep learning of the present invention is implemented through the following steps: (I) Constructing the dataset (1) Data collection: Soybean cultivation and plant data collection were conducted at the experimental base of Bayi Agricultural Reclamation University in Heilongjiang, China. The soybean cultivation experiment, with the agronomical background of investigating pod detection under normal soybean growth conditions, used the nematode-resistant soybean variety 'Kangchong 8', which exhibits semi-determinate pod-bearing characteristics, and cultivated it outdoors under natural light intensities of 0-1200 μmol·m⁻²·s⁻¹ and temperatures of 20-34℃. 'Kangchong 8' soybean has white flowers, sickle-shaped pods that turn yellowish-gray at maturity, and mostly contains 3 seeds. Planting began in mid-May, with soybean seeds sown in agricultural pots. The plants were harvested after reaching maturity in late August to early September. To ensure the diversity and representativeness of the data, this study built a soybean image acquisition platform based on a Canon 700D camera, as shown in Figure 1(b). The shooting resolution was 4032×3024 pixels. 205 high-resolution original images of soybeans were acquired at each stage from the beginning of grain filling (R5), full grain filling stage (R6), early maturity stage (R7), and full maturity stage (R8). Each key growth stage was systematically captured once or twice, and a total of 820 high-quality soybean plant images were finally obtained (Figure 1(c)). The acquired original images were labeled using the Roboflow annotation tool to ensure the accuracy of the data and the consistency of the annotation. The images were divided into training set, validation set, and test set in a ratio of 7:1:2, that is, the training set contained 574 images, the validation set contained 82 images, and the test set contained 164 images. (2) Data augmentation: Data augmentation is performed on the original images obtained in step (1) for the four periods, such as... Figure 2 As shown, seven data augmentation methods were used: brightness variation, random erasure, bidirectional reversal, Gaussian noise, random rotation, random scaling, and affine transformation. One of these methods was randomly selected each time to augment the sample to ensure data diversity. The final dataset contained a total of 3432 images, of which the training set contained 2870 images, the validation set contained 410 images, and the test set contained 152 images. (II) Construction of the PodYOLO model (1) Construct the SCCBlock module: In the original YOLOv8 architecture, such as Figure 3As shown, the C2f module effectively captures rich gradient information by fusing low-level and high-level feature maps. However, the complex convolutional bottleneck structure contained in this module significantly increases the number of model parameters and computational complexity. To address this issue, in the original YOLOv8 architecture, the C2f module in the backbone network is replaced by the SCCBlock module (Figure 4(a)). This module replaces the original Bottleneck module with a newly designed SCC-BN, as shown in Figure 4(b). The SCC-BN module in the SCCBlock module mainly consists of two key components: the Spatial Reconstruction Unit (SRU) module and the Channel Reconstruction Unit (CRU) module. For input features... First, spatial refinement features are obtained through SRU operation. Then, the channel refinement features are obtained using the CRU operation. These two units are arranged sequentially and work together, which can effectively reduce computational complexity and the number of model parameters while maintaining feature representation capabilities. The SRU module, through a separation-reconstruction method, divides the input feature map into information-rich regions and information-poor regions based on the amount of information, and then fuses them after differential processing, as shown in Figure 4(c). Initially, group normalization (GN) is used to standardize the input feature map to improve feature stability and reduce distribution differences between different samples. The calculation formula is as follows: (1) in, Input feature map; The mean; Standard deviation; To maintain stability and prevent division by zero; This is a scaling factor used to evaluate the amount of information in the feature map; its size reflects the degree of change in spatial pixels. This is the offset; This is the output after group normalization; The output features are normalized; the relevant weights of the normalization are... The calculation formula is: (2) in, For the first Scaling factor for each channel; This is the sum of the scaling factors for all channels; Number of channels; For summation index; For the first Normalized weight values ​​for each channel; The correlation coefficient is the normalized value. Input feature map After the weight information is mapped to the (0, 1) interval through the Sigmoid function, a threshold discrimination mechanism is used to determine the weights. Weights above the threshold are reset to 1 to obtain weights with rich information. Weights below the threshold are reset to 0 to obtain non-informative weights. This process can be represented as: (3) in, For gated functions; For activation functions; This is the processed weight matrix; Input feature map and Multiplying them yields two sets of weighted feature maps. and , It contains rich information that can more effectively express and distinguish the spatial structure of images, and Containing very little information, the SRU module proposes a Reconstruct operation to reduce spatial redundancy. Instead of directly adding the two types of features, it employs a cross-reconstruction method to fully integrate information-rich and information-poor features, enhancing information flow. Finally, by concatenating the cross-reconstructed features, a more information-rich, spatially refined feature map is generated, effectively saving space resources. The entire Reconstruct operation can be represented as: (4) in, It is characterized by its rich information content; It is characterized by a relatively small amount of information; and The weights of the two sets of features; , , , Sub-features in cross-reconstruction; and These are the two sets of feature maps after cross-reconstruction; For spatial refinement of feature maps; This is element-wise multiplication; This is element-wise addition; For splicing operations; The CRU module uses a segmentation-transformation-fusion method instead of standard convolution for feature extraction, reducing the number of feature maps. The channel redundancy is shown in Figure 4(d). The channels of the spatially refined feature map are split into two parts: One channel and The feature map is divided into several channels, and then a 1×1 convolution is used to obtain the upper-layer input feature map by converting the number of channels of the feature map. and lower layer input feature map ; In the upper-level transformation stage, the CRU module uses Group-Wise Convolution (GWC) and Point-Wise Convolution (PWC) instead of traditional convolution. GWC employs sparse convolutional connections, effectively reducing the number of parameters and computational cost, but it blocks information exchange between channels. PWC, on the other hand, weights and combines features along the depth direction, promoting dynamic interaction of features within channels and compensating for the information loss caused by GWC. The upper-level input feature map... GWC and PWC operations are performed separately, and then the upper-layer output feature map is obtained through an addition operation at a lower cost than standard convolution. Its expression is: (5) in, and These are the learnable weight matrices for GWC and PWC, respectively. This is the output feature map for the upper layer; In the lower-level transformation stage, the CRU module uses PWC operations to generate shallow detail feature maps to supplement the features extracted in the upper-level transformation stage, and reuses the lower-level input feature maps. To obtain more feature information while keeping computational costs constant, the generated features and the lower-level input features are concatenated to obtain the lower-level output feature map, expressed as: (6) in, This is the learnable weight matrix for PWC; For feature splicing operations; This is the output feature map for the lower layer; After transformation and Global average pooling is used to aggregate information from the entire spatial area, resulting in a statistic reflecting the overall activity level of each channel. The calculation formula is as follows: (7) in, Input feature map; and These are the height and width of the feature map, respectively; For feature map In spatial location eigenvectors; This is a global pooling operation; For the obtained channel statistics; They were obtained respectively and Global channel statistics and Then, they are stacked together and a weight vector is generated through a channel-wise soft attention operation. Then, using the feature importance vector as the channel weight, the upper and lower layer features are fused in a channel-based manner to obtain the refined features. The calculation formula is as follows: (8) (9) in, and They are respectively and Global channel statistics; It is an exponential function; and This is the feature importance vector; and These are respectively channel-based fusion of upper-layer and lower-layer feature maps; To finally obtain the refined feature map of the channel; (2) Construct the UIBC2f module The YOLOv8 model faces the challenge of balancing feature extraction efficiency and computational resources in the pod recognition task, especially the C2f module of the neck network, which has a large number of parameters and high computational complexity. This study constructs a novel convolutional module, UIBC2f, using the Unified Inverted Bottleneck (UIB) module to replace part of the C2f module in the neck network (Figure 5). Leveraging its depthwise separable convolution and inverted bottleneck design advantages, it significantly reduces computational overhead while maintaining detection accuracy. UIB is designed based on the MobileNetV4 architecture. It adopts an inverse bottleneck structure that combines depthwise separable convolution with pointwise operations. It enhances feature extraction capabilities by introducing two optional depthwise separable convolutional layers before and after the expansion layer, providing rich feature extraction options to adapt to different computing resource constraints and performance requirements. Its structure is shown in Figure 6. In Figure 6, positions ② and ④ both consist of 1×1 pointwise convolutions (PWCs) with embedded activation and normalization layers. ExtraDW inserts DWCs with kernel size k between the first PWC and the two PWCs, achieving increased network depth and expanded receptive field with low computational cost. This study uses the ExtraDW module to replace the Bottleneck module in traditional C2f, with input features... The output features are obtained through alternating processing of depthwise separable convolution and pointwise convolution. The process expression is: (10) in, Input feature map; For pointwise convolution; For depthwise convolution; For normalization layer; For activation functions; Output feature map; (3) Introduce DAT attention mechanism The Deformable Attention Transformer (DAT) module is introduced. This module can adaptively adjust the shape and range of the region of interest through a deformable attention mechanism. By sharing a few sampling offset groups for all queries, it moves the key and value to the key region. While maintaining linear space complexity, it introduces a deformable attention mode to the Transformer backbone network. It can capture the features of small targets with varied shapes more accurately while significantly reducing the amount of computation and maintaining high performance. Figure 7 illustrates the workflow of the DAT module. The DAT module uses bilinear interpolation to extract sampled features from the original feature map, and then uses projection transformation to generate deformed keys and deformed values. A standard multi-head attention mechanism is then used to align the query with the sampled keys, and key feature information is extracted from the deformed values. As shown in Figure 7(a), the DAT is a feature map. Establish a unified reference point grid. As a reference point, the size of the grid is obtained by downsampling the size of the input feature map, and its calculation formula is as follows: (11) in, , Input feature map Dimensions; This is the scaling factor; , This refers to the grid size; These reference points are kept consistent across all input data as initial sampling locations. To obtain the offset of each reference point, the feature map is projected onto the query marker. In the process, an offset is generated through a lightweight sub-network, and then features are sampled from the deformed point positions as keys and values ​​using a projection matrix. The calculation formula is as follows: (12) (13) (14) (15) (16) in, Input feature map; for The projection matrix; For reference sampling location; This is the sampling offset vector; The deformed feature map; and These are the projection matrices for the keys and values, respectively; and These are the transformed key and value embeddings, respectively; For offset prediction function; The sampling function, typically bilinear interpolation, is used to extract data from the feature map. The bilinear interpolation formula for the features after mid-sample deformation is: (17) (18) in, The coordinates of the target sampling location; The integer coordinates in the grid that are closest to the sampling position; and This is a weighting function used to calculate the weights of the relative distances to the sampling locations; In order to be in The value of the feature map sampled at that location; In order to be in Feature map The result of the interpolation calculation; Continuous coordinates; The coordinates of adjacent integer grid cells; The distance between continuous coordinates and grid points; This is a function to find the maximum value. It is a one-dimensional linear interpolation kernel. The DAT module uses a multi-head attention mechanism to process... , , And using relative position offset The output formula for an attention head is: (19) in, For activation functions; , , The first Each attention head's query vector, key vector, and value vector; The dimensions of the query vector and key vector; This is a positional bias term used to adjust the relative relationship between queries and keys in deformable attention; For the first Each attention head outputs a feature vector, which is generated by aggregating features from different locations. The features from each attention head are concatenated together, as shown in the formula: (20) in, For the projection matrix, For splicing operations; This is the final output feature vector; The DAT module designs a structurally efficient offset generation network. As shown in Figure 7(b), the network first receives the input features. Features are obtained by extracting and downsampling local spatial features through a depthwise separable convolution of size k×k and stride r. The output features are obtained by processing with the GeLU nonlinear activation function and then through 1×1 convolution. ; (4) Add a small target detection layer A small target detection module was designed based on the original neck network structure of YOLOv8, introducing the P2 feature layer, as shown in Figure 8(b). Its spatial resolution reaches 160×160, which has higher spatial resolution and richer fine-grained feature information compared to the P3, P4, and P5 layers, making it crucial for capturing key details such as the edges and textures of small targets. The P2 detection layer uses the UCC2f module (Figure 8(c)) to design an upsampling and fusion path from P2 to P3. The number of channels in the P3 feature map is adjusted by 1×1 convolution, and then upsampled by 2 times. The feature information of the deep network is effectively fused with the feature information extracted directly from the shallow features of the backbone network by element-wise addition. The CCC2f module (Figure 8(d)) fuses more abstract semantic information and finer spatial information from the backbone network. By integrating feature maps from different levels and paths, the expressive power of the features is further enhanced. The processed feature maps are passed to the P3 detection head and subsequent feature network, respectively, for target detection at a scale of 40×40 and higher-level feature extraction. (5) Construction of the PodYOLO model for pod recognition Based on the above improvements, a novel YOLO network is obtained, as shown in Figure 9. The 3432 data-enhanced images obtained in step one (2) are used as input, and after size normalization and pixel normalization, they form the network input tensor. The input is fed into an improved YOLOv8 network; in the improved YOLOv8 network, the input tensor... After Stem convolution and downsampling, the three-channel features are converted into multi-channel feature maps. In the feature extraction process of the backbone network, the C2f module is replaced with the SCCBlock module (Figure 9(a)). The SCCBlock module effectively enhances the expressive power of spatial features and suppresses the interference of redundant information by sequentially performing separation, reconstruction, segmentation, transformation, and fusion operations on the feature map. Feature map Multi-scale feature maps are obtained through the backbone network. , , , Multi-scale feature maps All inputs are fed into the first and second paths. Path 1 processes the data along the backbone network direction, while path 2 integrates the three feature maps from their respective locations into the neck network for cross-scale fusion. After processing by the SPPF module, the output is sent to the first path and the second path. Path 1 enters the DAT module inserted between the SPPF output and the upsampling operation (Figure 9(b)) to obtain the feature map. The DAT module utilizes its deformable attention mechanism to achieve more flexible and accurate feature sampling on the feature map aggregated by SPPF, effectively alleviating the problem of small target features being easily lost during multi-layer upsampling. Path 2 concatenates the downsampled feature map with the neck network to form a fused feature map. Feature map After upsampling, it is sequentially compared with the feature map. , , splicing to form a fused feature map , , ; During the upsampling process of the neck network, the two deep C2f modules are replaced with UIBC2f modules (Figure 9(b)). The UIBC2f module combines depthwise separable convolution with an inverse bottleneck design, achieving the best balance between feature fusion efficiency and model lightweighting. (Fused feature map) and The UIBC2f module is entered sequentially to obtain feature maps. and Both feature maps are input to the first and second paths. Path 1 propagates along the upsampling direction of the neck network, while path 2 merges the two feature maps from their respective positions into the downsampling part of the neck network. The feature map is obtained by entering the C2f module. Feature map The input is fed into the first and second paths. Path 1 propagates along the downsampling direction of the neck network, sequentially passing through the feature maps. , , splicing to form a fused feature map , , Path 2 leads to the newly added P2 detection head (Figure 9(c)), which further enhances the detection capability for small-scale bean pod targets; feature map and Both are processed by the C2f module and then input to the first and second paths. Path 1 propagates along the downsampling direction of the neck network, and path 2 enters the P3 and P4 detection heads of the detection head. Feature maps After being processed by the C2f module, the P5 detector head enters the detection head, thus obtaining the PodYOLO pod recognition network, and outputting the category prediction and location regression results of the pod target; While maintaining efficient inference and low computational consumption, this network can better capture the subtle spatial features and irregular shapes of small targets such as pods, reduce interference from similar background regions such as stems and leaves, thereby enhancing the model's ability to distinguish between foreground and background, significantly improving the detection accuracy and robustness of live pods, and fully meeting the detection needs in complex environments. (III) Pod Phenotypic Detection The pod identification network PodYOLO constructed in step (ii) is used to detect the pod phenotype.

[0011] In summary, the PodYOLO pod recognition network introduces the SCCBlock module in the backbone (Figure 9(a)). By sequentially performing separation, reconstruction, segmentation, transformation, and fusion operations on the feature map, it effectively enhances the expressive power of spatial features and suppresses the interference of redundant information. The neck network replaces part of the C2f structure with the UIBC2f module (Figure 9(b)). Combined with depthwise separable convolution and inverse bottleneck design, it achieves the best balance between feature fusion efficiency and model lightweighting. At the same time, the DAT module is inserted between the SPPF module and the upsampling operation (Figure 9(b)). Its deformable attention mechanism enables more flexible and accurate feature sampling on the feature map after SPPF aggregation, effectively alleviating the problem of easy loss of small target features during multi-layer upsampling. The network also adds a small target detection layer and adds a corresponding detection head in the head part (Figure 9(c)), further improving the detection capability of small-scale pod targets. While maintaining efficient inference and low computational cost, this network can better capture the subtle spatial features and irregular shapes of small targets such as pods, reduce interference from similar background regions such as stems and leaves, thereby enhancing the model's ability to distinguish between foreground and background, significantly improving the detection accuracy and robustness of live pods, and fully meeting the detection needs in complex environments.

[0012] The PodYOLO network constructed above is used to perform phenotypic detection on fully mature soybean plants.

[0013] First, the acquired images are analyzed based on the PodYOLO model to identify and extract the region of interest (ROI) containing a single pod, as shown in Figure 10(a). For the extracted ROI image, the Otsu thresholding method (Ma&Yue, 2022) is used to separate the pod region from the background, and morphological opening and closing operations (J. Zhang et al., 2022) are combined to eliminate noise and fill holes, generating an accurate binary mask, as shown in Figure 10(b). Subsequently, the outer contour of the pod is extracted from this binary mask. To avoid interference from other structures, the contour with the largest area is selected as the effective contour of the pod (Figure 10(c)), and its mathematical expression is: (twenty one) in, These are the pixel coordinates on the outline; This represents the total number of contour points. This is the set of outline points for the bean pod. (The final sentence, "Obtain the set of outline points for the bean pod," is a separate, unrelated statement.) The pixel length and width of the pod can then be calculated, as shown in Figure 10(d). To convert the pixel size to the actual physical size, a calibration board containing four rectangular markers of the same size was placed in the image acquisition scene, as shown in Figure 10(e). By calculating the average pixel width and height of the markers on the calibration board in the image, and combining this with their known physical width and height, the pixel-to-millimeter conversion factor was calculated. The calculation formula is as follows: (twenty two) in, and These are the physical width and height of the label, respectively. and The width and height of the label in pixels; This is the conversion scaling factor.

[0014] Principal component analysis was used to calculate the pod length, and PCA (Esmaeili, Abbasi-Moghadam, Sharifi, Tariq, & Li, 2023) was used to determine the pod contour point set. The main extension direction is used to project all contour points onto this principal axis to obtain the projection point set. The formula for calculating the pixel length of the bean pod is: (twenty three) in, and These are the minimum and maximum values ​​of the projection of the contour points onto the principal axis, respectively; and They are respectively and Position in pixel space; The pixel length of the pod.

[0015] This detection method calculates the pod width based on the maximum inscribed circle and outlines the pod. The diameter of the largest inscribed circle inside is taken as the width of the pod. (This is based on the outline.) Filled binary mask image Calculate the distance transform (Božič, Tabernik, & Skočaj, 2021). The distance transform calculates the distance from each pixel within the mask to its nearest background pixel. The maximum value in the distance transform result is the radius of the largest inscribed circle, and the diameter of the largest inscribed circle is the pixel width of the pod. This process can be represented as: (twenty four) (25) (26) in, The distance is Euclidean. The pixels within the mask; For outline pixels on; for arrive The distance; The maximum distance transformation value; The pixel width of the pod.

[0016] Ultimately, the actual physical length and width of the pod are obtained using the following formula: (27) (28) in, For scale conversion factors; This refers to the actual length of the bean pod; This refers to the actual width of the pod.

[0017] To automatically identify the pod-like color features, a pod-like color recognition method based on image color features was adopted (Figure 11). First, to reduce the impact of illumination changes on color analysis and better separate color information, the ROI image was converted from the RGB color space to the HSV color space. The HSV space describes color as having three components: hue, saturation, and lightness. Hue mainly represents the color type, saturation represents the color purity, and lightness represents the color brightness. Subsequently, pixels belonging to the pod region within the ROI were extracted based on a binary mask. The average hue of these pixels in each channel of the HSV space was calculated. Average saturation and average brightness This is a key feature characterizing the overall color of the bean pod. The calculation formula is as follows: (29) (30) (31) in, It is the set of all non-zero pixels within the mask; Its total number of pixels; , , pixels The hue, saturation, and brightness values ​​at each location are calculated. Finally, the average HSV feature extracted is used as the basis for the final result. A rule-based classifier based on prior knowledge is used to determine the color, and the pod-like color is identified through this classifier.

[0018] The effects of the present invention will be further explained below: To compare the detection performance of the PodYOLO model with the original YOLOv8 on live pods, this study trained the original YOLOv8, YOLOv8 with added SCCBlock, UIBC2f, DAT attention and P2 detection heads, and PodYOLO models with six different configurations. The evaluation metrics for each model are shown in Table 2.

[0019] Note: ① is the original YOLOv8n model; ② is an improved model that only replaces all C2f modules in the backbone network with SCCBlock modules; ③ is an improved model that only improves all C2f modules in the neck network with UIBC2f modules; ④ is an improved model that only adds a DAT attention mechanism between the SPPF module and the upsampling operation; ⑤ is an improved model that only adds a small object detection layer; ⑥ is an improved model that combines the improvements of ②-⑤.

[0020] The original YOLOv8 model has the largest number of parameters (3.01M) and FLOPs (8.1G), but the lowest detection accuracy, with mAP and mAP@0.5:0.95 at 0.875 and 0.570, respectively. Replacing the C2f model in the backbone network with SCCBlock reduced the number of parameters and FLOPs by 4.0% and 2.5%, respectively, while improving mAP and mAP@0.5:0.95 by 1.5% and 4.7%, respectively. Replacing the C2f model in the neck network with the UIBC2f module resulted in a more significant reduction in computational cost, with parameter count and FLOPs decreasing by 13.3% and 9.9%, respectively, while accuracy improved slightly, with mAP and mAP@0.5:0.95 increasing by 0.3% and 0.7%, respectively. Adding the DAT structure to the original network slightly increased the number of model parameters and FLOPs by 9.6% and 3.7%, respectively, but improved accuracy, with mAP and mAP@0.5:0.95 increasing by 0.8% and 3.7%, respectively. The P2 detection head showed the most significant improvement, increasing mAP and mAP@0.5:0.95 by 2.4% and 5.4%, respectively, but also had the highest computational cost, with the number of parameters decreasing by 2.7% while FLOPs increased by 51.9%. PodYOLO reduced its parameter count to a minimum of 2.38M, a decrease of 20.9%. Due to the addition of an object detection head, FLOPs increased significantly to 10.8G, but its detection accuracy was significantly better than the original YOLOv8 and various single-module improvements, with mAP reaching 0.902 and mAP@0.5:0.95 reaching 0.614, representing improvements of 2.7% and 4.4% compared to the original, respectively. It demonstrates excellent detection performance and model efficiency, proving the effectiveness of the multi-module collaborative optimization strategy in the pod detection task.

[0021] To visually demonstrate the performance difference of the improved model on the soybean pod detection task, four soybean samples at different growth stages were randomly selected from the test dataset, including one pot each of single-plant and multi-plant states. The original YOLOv8 and PodYOLO models were used for identification, respectively. Figure 12 As shown in Figure 12, the results of pod detection are compared. Rows 1-4 represent soybean plants in the R5-R8 stage. a and c are the detection results of YOLOv8, and b and d are the detection results of PodYOLO.

[0022] As shown in Figure 12, YOLOv8 exhibits significant false negatives and false positives in the pod liveness detection task, with an average of 1-3 unidentified targets per sample. In complex scenes with severe occlusion, its detection performance drops significantly, as shown in Figure 12c-4, where entire clusters of pods are not correctly identified. Furthermore, its detection performance for small targets is poor, as shown in Figure 12a-1, indicating that YOLOv8 has limited ability to extract key features such as pod color and edge contours in this task, making it difficult to effectively distinguish foreground targets from the background environment. In contrast, the PodYOLO model, through optimized feature extraction and multi-scale fusion mechanisms, successfully detects targets missed by YOLOv8, significantly improving detection accuracy and effectively enhancing robustness to occluded scenes and sensitivity to small targets.

[0023] To investigate the impact of different insertion positions of the improved module on model performance, ablation experiments were conducted on SCCBlock and UIBC2f. First, the C2f modules in each layer of the backbone network were sequentially replaced with SCCBlock, and models under each replacement configuration were trained to obtain the corresponding performance metrics. The results are shown in Table 3.

[0024] As shown in Table 3, the model performance shows a significant improvement as the C2f module in the backbone network is replaced layer by layer by SCCBlock. When only the C2f module in the third layer was replaced, the number of parameters remained almost unchanged, FLOPs decreased by 0.8%, mAP increased by 0.3%, but FPS decreased by 9.4%. After further replacing the C2f module in the fifth layer, the number of parameters and FLOPs decreased by 0.2% and 0.8%, respectively, mAP and mAP@0.5:0.95 increased by 0.4% and 0.7%, respectively, but FPS decreased by 11.3%. When replacing up to the seventh layer, the number of parameters and FLOPs decreased by 0.7% and 1.7%, respectively, mAP and mAP@0.5:0.95 increased by 0.6% and 1.7%, respectively, but FPS decreased by 18.1%. When all C2f modules in the backbone network were replaced with SCCBlock, the model performance reached its optimal state, with the number of parameters and FLOPs decreasing by 1.2% and 2.5%, respectively, mAP and mAP@0.5:0.95 increasing by 1.2% and 1.5%, respectively, and FPS decreasing by 21.7% compared to the original model. Experimental results show that although the real-time performance decreases slightly with increasing SCCBlock replacement layers, the detection speed remains above 46 FPS even with complete replacement, meeting the requirements of real-time applications. Furthermore, SCCBlock optimizes spatial feature representation, reduces model complexity, and achieves higher detection accuracy through its effective feature separation and reconstruction mechanism, striking a better balance between computational cost and accuracy. Overall evaluation results indicate that fully replacing the traditional C2f module with SCCBlock in the backbone network is the optimal strategy for improving pod detection performance.

[0025] For the neck network portion, this application uses UIBC2f modules to replace the original C2f structure layer by layer, and verifies and evaluates the model's performance under different replacement configurations. The experimental results are shown in Table 4;

[0026] In Table 4, the baseline model has 3.090M parameters, 12.2G FLOPs, mAP and mAP@0.5:0.95 are 0.897 and 0.607 respectively, and FPS is 53.62. After replacing C2f layer by layer in the neck network with the UIBC2f module, the model's parameter count and FLOPs gradually decrease, and the FPS changes accordingly. In particular, when replacing C2f layer 28, the parameter count and FLOPs decrease significantly, by 13.7% and 9.8% respectively, but mAP and mAP@0.5:0.95 only increase by 0.3% and 0.7% respectively, and the FPS is 4.6% lower than the baseline model. This indicates that the C2f module in the deeper layers of the network has a large parameter overhead. UIBC2f can significantly achieve lightweighting at this layer, but the overall network capacity reduction restricts the ability to extract high-level semantic features, resulting in limited performance improvement. At the same time, it introduces an additional computational bottleneck, affecting inference speed. In contrast, when only layers 13 and 16 were replaced with UIBC2f, while the remaining layers retained C2f, mAP and mAP@0.5:0.95 improved by 1.6% and 3.0%, respectively, FPS increased by 3.8% compared to the baseline model, and parameter count and FLOPs decreased by 2.6% and 3.3%, respectively. This indicates that the depthwise separable convolutions of UIBC2f can more efficiently fuse spatial information during the basic feature extraction process of shallow and mid-layer networks, reducing the computational burden, while retaining the deep C2f modules maintains the expressive power of high-level semantic information, achieving an optimal balance between detection accuracy, computational efficiency, and inference speed. These results demonstrate that selectively replacing the first two C2f modules with UIBC2f in the YOLOv8 neck network can significantly improve detection performance while effectively reducing model complexity.

[0027] To comprehensively evaluate the detection performance of the PodYOLO model, this application selected nine mainstream object detection algorithms, including SSD, Faster R-CNN, and the YOLO series, as comparison models and validated them under the same dataset and configuration. The recognition effect and key performance indicators of each model are shown in Table 5.

[0028] The traditional two-stage detector, Faster R-CNN, has mAP and mAP@0.5:0.95 values ​​of 0.784 and 0.421, respectively, with a parameter count of 165.690M and a computational complexity of 176.28G FLOPs. These factors significantly limit its practical application value in resource-constrained environments. DetectoRS, an improvement based on Faster R-CNN, improves mAP and mAP@0.5:0.95 to 0.821 and 0.455, respectively, through a recursive feature pyramid structure, demonstrating strong feature extraction capabilities. However, its 47.712M parameter count and 181.7G computational complexity still fail to achieve an effective balance between performance and computational efficiency. Among traditional single-stage detectors, SSD has mAP and mAP@0.5:0.95 values ​​of 0.718 and 0.364, respectively, showing relatively weak detection performance. Although RetinaNet achieves an mAP of 0.799, its excessively high parameter count and computational load severely limit its deployment efficiency in real-world scenarios. In comparison, CenterNet achieves an mAP of 0.741 and an mAP@0.384 of 0.5:0.95 with 32.611M parameters and a computational complexity of 35.4G, exhibiting relatively balanced performance among traditional single-stage models. The DETR model based on the Transformer architecture has 31.986M parameters, slightly lower than traditional detection models, with a computational complexity of 103.4G FLOPs. Its mAP and mAP@0.5:0.95 reach 0.782 and 0.439 respectively, outperforming most traditional single-stage models in terms of target localization accuracy. The lightweight YOLO series models demonstrate significant efficiency advantages. YOLOv10n, YOLOv11n, and YOLOv12n all have approximately 2.6M parameters, with computational complexities of 8.2G, 6.3G, and 6.3G FLOPs, respectively. They achieve mAPs of 0.865, 0.860, and 0.857 and mAP@0.5:0.95 of 0.558, 0.544, and 0.538, respectively, significantly outperforming traditional models with larger parameter sizes. The PodYOLO model proposed in this study has 3.009M parameters, slightly more than the YOLO series models, but its mAP and mAP@0.5:0.95 reach 0.911 and 0.625, respectively, representing improvements of 5.3% and 12.0% compared to the best-performing YOLOv10n. Despite PodYOLO's computational complexity of 11.8 G FLOPs, its superior detection accuracy fully validates the effectiveness of the structure optimization strategy targeting pod features.

[0029] To demonstrate the performance and accuracy of the soybean pod phenotypic parameter detection method, the detected and measured values ​​of each phenotypic were compared and analyzed. The effectiveness of the method was verified by constructing a linear regression model between the detected and measured values ​​of pod length and width, and by evaluating the confusion matrix for pod color classification. The results are shown in Figure 13: Figures 13(a) and 13(b) show the scatter plots and linear regression analysis results of the detected and measured values ​​of pod length and width, respectively. For pod length, the detected and measured values ​​showed a strong positive correlation, with a coefficient of determination R² of 0.9351 and an RMSE of 3.7794 mm. For pod width prediction, the detected and measured values ​​also showed a significant positive correlation, with a coefficient of determination R² of 0.9166 and an RMSE of 0.0474 mm. This indicates that the method proposed in this application can accurately measure the pod length and width of soybeans. Figure 13(c) shows the confusion matrix of the pod color recognition results, used to evaluate the algorithm's accuracy in recognizing the three main color categories: brown, green, and yellow. The values ​​on the diagonal of the matrix represent the correct classification rate for each category. The results show that the algorithm achieves a 93% accuracy rate for brown, 90% for green, and 85% for yellow. However, there is some inter-category confusion: approximately 3% of actual green pods were misclassified as brown, 10% as yellow, 4% as yellow, and no actual yellow pods were misclassified as brown, but 10% were misclassified as green. This confusion matrix indicates that the color detection algorithm has high accuracy.

[0030] To verify the effectiveness of the pod color detection method proposed in this application in identifying soybean growth stages, the pod color changes during four key growth stages (R5 to R8) of soybean plants were further visualized, tracked, and analyzed. The results are shown in Figure 14: Figures 14(a) to 14(d) are images of the same soybean plant at stages R5-R8, respectively; Figures 14(e) to 14(g) are visualizations of the corresponding live pod color identification. During stage R5 (Figure 14(e)), all pods detected by the algorithm were green, consistent with the physiological characteristics of rapid pod development and high chlorophyll content at this stage. Entering stage R6 (Figure 14(f)), the results showed that color differentiation began to appear in the pod population. In addition to green pods, a small number of yellow pods were detected, indicating that the pods continued to develop, and some pods had reached the initial stage of maturity. During stage R7 (Figure 14(g)), there were significant differences in pod color at different developmental stages on the plant. The number of yellow pods further increased, and brown pods appeared, indicating that most of the pods on the plant began to mature at this stage, and some pods had reached full maturity. At stage R8 (Figure 14(h)), all detected pods were brown, consistent with the typical characteristics of fully mature soybeans. In summary, the color detection method proposed in this application demonstrates high accuracy and reliability in accurately identifying different color categories and reflecting the overall growth stage of the plant.

Claims

1. A soybean pod liveness detection method based on improved deep learning, characterized in that: This is achieved through the following steps: (I) Constructing the dataset (1) Data collection: Collect no less than 205 high-resolution original images of soybeans from the pod-setting stage to the full maturity stage, and annotate the collected original images and divide them into training set, validation set and test set in a ratio of 7:1:2; (2) Data augmentation: Data augmentation is performed on the original images of the four periods obtained in step (1); (II) Construction of the PodYOLO model (1) Construct the SCCBlock module: In the original YOLOv8 architecture, the C2f module in the backbone network is replaced with the SCCBlock module. The SCC-BN module in the SCCBlock module mainly consists of two key components: the Spatial Reconstruction Unit (SRU) module and the Channel Reconstruction Unit (CRU) module. For input features... First, spatial refinement features are obtained through SRU operation. Then, the channel refinement features are obtained using the CRU operation. ; (2) Construct the UIBC2f module The C2f module in the neck network of the original YOLOv8 architecture was replaced with UIBC2f, and the Bottleneck module in the traditional C2f was replaced with the ExtraDW module. The input feature map... The output features are obtained through alternating processing of depthwise separable convolution and pointwise convolution. ; (3) Introduce DAT attention mechanism The Deformable Attention Transformer module is introduced. The module uses bilinear interpolation to extract sampled features from the original feature map, and generates deformed keys and deformed values ​​through projection transformation. Then, the standard multi-head attention mechanism is used to realize the alignment calculation of the query and the sampled key, and the key feature information is extracted from the deformed value. (4) Add a small target detection layer A small target detection module was designed based on the original neck network structure of YOLOv8, and a P2 feature layer was introduced, with a spatial resolution of 160×160. The P2 detection layer designed an upsampling and fusion path from P2 to P3 through the UCC2f module. The number of channels of the P3 feature map was adjusted by 1×1 convolution, and then upsampled by 2 times. The feature information of the deep network was effectively fused with the feature information extracted directly from the shallow features of the backbone network by element-level addition. (5) Model construction of PodYOLO, a pod recognition network After the data-enhanced image obtained in step 1 (2) is improved and enters the YOLO8 network, the data is first input into the backbone network in the form of a three-channel image tensor. The backbone network transforms the data layer by layer through continuous convolution operations, thereby forming a multi-level feature representation from shallow to deep. In several feature extraction layers of the backbone network, the convolution input is fed into the SCCBlock for processing. After receiving the feature tensor of the current layer, the SCCBlock first enters the spatial reconstruction unit SRU. The SRU normalizes the features and calculates the gate weights. The gate weights form the response coefficients to the spatial position after nonlinear mapping. Based on this, the features are divided into two groups of spatial response regions and weighted separately. Then, the two groups of features are recombined and spliced ​​through cross-reconstruction to obtain the reconstructed feature map in the spatial dimension. The spatial reconstruction output then enters the channel reconstruction unit CRU. The input features are segmented along the channel dimension. The upper branch first performs channel adjustment and then completes feature transformation and fusion through group convolution and pointwise convolution respectively. The lower branch extracts detailed features through pointwise convolution and concatenates them with the input of the lower branch to form the output of the lower branch. Then, global average pooling is performed on the outputs of the upper and lower branches to obtain channel statistics. Channel weights are generated based on the statistics, and the features of the upper and lower branches are weighted and fused to output the reconstructed feature tensor along the channel dimension. The features at the end of the backbone network enter the SPPF module, and deep feature representation is obtained through multi-scale pooling aggregation. This deep feature and the multi-scale lateral features of the backbone network are provided to the neck network. After receiving the multi-scale features output by the backbone network, the neck network completes multi-scale fusion according to a bidirectional path from top to bottom and bottom to top: First, the deepest aggregated features are processed by the DAT module before entering the upsampling fusion path. The DAT establishes a set of reference points on the feature map and generates sampling offsets for the reference points through the offset prediction branch. Then, the features are interpolated and sampled at the offset position to obtain deformed key-value features. Then, multi-head attention calculation is performed to complete the alignment and aggregation of query features and sampled features, and outputs the deep feature tensor after attention enhancement. After attention enhancement is completed, deep features enter a top-down fusion process. This process improves spatial resolution through upsampling and concatenates them with lateral features output by the backbone network at the same scale in the channel dimension. The concatenated features then enter the fusion module for reorganization. UIBC2f uses a unified inverse bottleneck structure as the basic unit and employs pointwise convolution and depthwise separable convolution to complete channel mixing and spatial feature extraction. Additional depthwise separable convolutions can be inserted between pointwise convolutions to increase the number of feature transformations. After multiple upsampling, stitching and fusion processes, high-resolution fusion features are obtained; Then, a bottom-up fusion process is entered. The high-resolution fusion features are reduced in spatial resolution by convolutional downsampling and concatenated with the features of the corresponding scale in the top-down path. The fusion module then outputs the fusion result at that scale. This downsampling, concatenation and fusion process is repeated step by step to form a set of output features at different scales, which are used for multi-scale prediction by the subsequent detection head. The detection head performs prediction calculations on the features at each scale output by the neck network. The input features at each scale are first mapped to the prediction space through convolution to generate classification predictions and bounding box regression predictions. The classification branch outputs the confidence scores for each category, and the regression branch outputs the regression values ​​for the bounding box position and size. The prediction results at each scale are expanded in space and summarized to form a candidate set. Then, the final detection result is obtained through confidence screening and non-maximum suppression; thus, the construction of the PodYOLO model for pod recognition is completed. (III) Pod Phenotypic Detection The pod identification network PodYOLO constructed in step (ii) is used to detect the pod phenotype.

2. The soybean pod liveness detection method based on improved deep learning according to claim 1, characterized in that... : The SRU module, through a separation-reconstruction method, divides the input feature map into information-rich and information-poor regions based on the amount of information, performs differential processing, and then fuses them. Initially, group normalization is used to standardize the input feature map to improve feature stability and reduce distribution differences between different samples. The calculation formula is as follows: (1) in, Input feature map; The mean; Standard deviation; To maintain stability and prevent division by zero; This is the scaling factor; This is the offset; This is the output after group normalization; The output features are normalized; the relevant weights of the normalization are... The calculation formula is: (2) in, For the first Scaling factor for each channel; This is the sum of the scaling factors for all channels; Number of channels; For summation index; For the first Normalized weight values ​​for each channel; The correlation coefficient is the normalized value. Input feature map After the weight information is mapped to the (0, 1) interval through the Sigmoid function, a threshold discrimination mechanism is used to determine the weights. Weights above the threshold are reset to 1 to obtain weights with rich information. Weights below the threshold are reset to 0 to obtain non-informative weights. This process can be represented as: (3) in, For gated functions; For activation functions; This is the processed weight matrix; Input feature map and Multiplying them yields two sets of weighted feature maps. and , It contains rich information that can more effectively express and distinguish the spatial structure of images, and Containing very little information, the SRU module proposes a Reconstruct operation, employing a cross-reconstruction approach to fully integrate information-rich features with less information-rich features, enhancing information flow. Finally, by concatenating the cross-reconstructed features, a more information-rich, spatially refined feature map is generated, effectively saving space resources. The entire Reconstruct operation can be represented as: (4) in, It is characterized by its rich information content; It is characterized by a relatively small amount of information; and The weights of the two sets of features; , , , Sub-features in cross-reconstruction; and These are the two sets of feature maps after cross-reconstruction; For spatial refinement of feature maps; This is element-wise multiplication; This is element-wise addition; This is for splicing operations.

3. The soybean pod liveness detection method based on improved deep learning according to claim 1, characterized in that... : The CRU module uses a segmentation-transformation-fusion method instead of standard convolution for feature extraction, reducing the number of feature maps. To reduce channel redundancy, the channels of the spatially refined feature map are split into two parts: One channel and The feature map is divided into several channels, and then a 1×1 convolution is used to obtain the upper-layer input feature map by converting the number of channels of the feature map. and lower layer input feature map ; In the upper-level transformation stage, the CRU module uses Group-Wise Convolution and Point-Wise Convolution instead of traditional convolution to transform the upper-level input feature maps. GWC and PWC operations are performed separately, and then the upper-layer output feature map is obtained through an addition operation at a lower cost than standard convolution. Its expression is: (5) in, and These are the learnable weight matrices for GWC and PWC, respectively. This is the output feature map for the upper layer; In the lower-level transformation stage, the CRU module uses PWC operations to generate shallow detail feature maps to supplement the features extracted in the upper-level transformation stage, and reuses the lower-level input feature maps. To obtain more feature information while keeping computational costs constant, the generated features and the lower-level input features are concatenated to obtain the lower-level output feature map, expressed as: (6) in, This is the learnable weight matrix for PWC; For feature splicing operations; Output feature maps for the lower layer; After transformation and Global average pooling is used to aggregate information from the entire spatial area, resulting in a statistic reflecting the overall activity level of each channel. The calculation formula is as follows: (7) in, Input feature map; and These are the height and width of the feature map, respectively; For feature map In spatial location eigenvectors; This is a global pooling operation; For the obtained channel statistics; They were obtained respectively and Global channel statistics and Then, they are stacked together and a weight vector is generated through a channel-by-channel soft attention operation. Then, using the feature importance vector as channel weights, the upper and lower layer features are fused in a channel-based manner to obtain the refined features. The calculation formula is as follows: (8) (9) in, and They are respectively and Global channel statistics; It is an exponential function; and This is the feature importance vector; and These are respectively channel-based fusion of upper-layer and lower-layer feature maps; To obtain the final refined feature map of the channel.