Rice stem section segmentation method based on Encoder-Decoder architecture
Through the rice stem cross-section segmentation method based on the Encoder-Decoder architecture, combined with transformer hybrid encoding and wavelet transform decoding mechanism, the reliability and applicability of traditional rice stem phenotype trait acquisition are solved, and more efficient rice stem structure segmentation and identification are achieved.
Patent Information
- Application Number
- CN202510414280.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-08-08
AI Technical Summary
The traditional acquisition of phenotypic traits of rice stems is mainly done manually, with low reliability, damage and poor applicability, making it difficult to be suitable for large-scale screening and identification of rice varieties.
The rice stem cross-section segmentation method based on the Encoder-Decoder architecture is adopted, and combined with transformer hybrid coding and wavelet transform decoding mechanism, a rice stem structure segmentation model is constructed. Through image preprocessing and feature interaction, feature extraction capabilities are enhanced and noise interference is reduced.
It improves the accuracy and comprehensiveness of rice stem structure segmentation, reduces the impact of equipment noise on model prediction, enhances the feature extraction ability of the region of interest, and solves the problem of distinguishing similar structures.
Smart Images

Figure CN120451529A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of segmentation methods, and in particular to a rice stalk cross-section segmentation method based on an Encoder-Decoder architecture. Background Art
[0002] Rice is one of the world's major staple crops and a major grain crop in my country. Research has shown that during rice growth, rice stalks are easily damaged by transplanters, severely impacting rice yield and quality. Later in life, rice stalks are susceptible to lodging, which prevents normal filling and maturation, leading to yield declines. This requires precise measurement of the internal structure of rice stalks, objective and accurate data acquisition, selection of lodging-resistant rice varieties, and optimization of the structural design of rice transplanters to improve rice yield and quality.
[0003] Currently, traditional methods for obtaining rice stem phenotypic traits rely primarily on manual labor, which suffers from low reliability, damage, and poor applicability. This makes them unsuitable for large-scale screening and identification of rice varieties, severely hindering the development of rice functional genomics and rice breeding. With the continuous advancement of agricultural automation and intelligent technologies, deep learning technology, with its superior learning capabilities, has achieved improved results in image segmentation. For example, Patent No. 202210089760.9, entitled "Method for Constructing a Rice Stem Cross-Section Segmentation Model and Detection Method Based on Such a Model," uses collected CT images of rice stems to input into a U-Net network for phenotypic characterization. However, the U-Net network, based on 2D convolutional kernels, focuses on extracting detailed features and fails to automatically focus on globally important features, making segmentation accuracy difficult to guarantee. Therefore, developing a method that can automatically extract important feature information related to various rice structures from CT images, thereby enabling the acquisition of rice structural phenotypic shapes, would establish a technical foundation for crop lodging resistance research and be of great significance for achieving high, stable, and high-quality rice yields. Summary of the Invention
[0004] The technical problem to be solved by the present invention is: how to solve the problem that at this stage, the traditional acquisition of rice stem phenotypic traits mainly relies on manual work, has the disadvantages of low reliability, damage, poor applicability, etc., and is not suitable for large-scale screening and identification of rice varieties. A rice stem cross-section segmentation method based on an Encoder-Decoder architecture is provided.
[0005] The present invention solves the above technical problems through the following technical solutions, which include the following steps:
[0006] Step S1: collecting rice stem cross-section images;
[0007] Step S2: pre-processing the stem section image;
[0008] Step S3: generating a rice stalk cross-section image dataset based on the pre-processed rice stalk cross-section images;
[0009] Step S4: constructing a rice stalk structure segmentation model based on the Encoder-Decoder architecture, combining the transformer hybrid encoding and wavelet transform decoding mechanism;
[0010] Step S5: training the rice stalk structure segmentation model;
[0011] Step S6: Segment and classify the rice stalk structure image.
[0012] Furthermore, step S4 specifically includes:
[0013] Step S40: defining the input part of the model based on the data set;
[0014] Step S41: construct a feature encoder based on the combination of CNN and Transformer;
[0015] Step S42: constructing a feature decoder part based on wavelet transform;
[0016] Step S43: Select a loss function to define the output part of the model.
[0017] Furthermore, in step S1, the specific contents of pre-processing the collected rice seed image include: adjusting the size of the target rice stalk slice image captured in step S1, and performing image denoising and filtering on the image.
[0018] Furthermore, in step S3, the specific steps of preparing the rice seed image dataset include:
[0019] Step S30: processing the obtained rice stalk slice image by a data amplification method of rotation, brightness enhancement and contrast enhancement adjustment to amplify the sample number to several times the original number;
[0020] Step S31: Divide the data into a training set, a validation set, and a test set.
[0021] Furthermore, in step S40, the input part of the data set-based definition model is normalized.
[0022] Furthermore, the specific content of step S41 is: constructing a feature encoder based on the combination of CNN and Transformer and defining it to include an input part and a bottleneck part.
[0023] Furthermore, in step S42, the wavelet transform decoding module is a feature decoding module based on the wavelet transform method, which uses wavelet transform to decompose the feature into frequency domain features while decomposing it into four different components, and proposes a cross-domain feature interaction strategy.
[0024] Furthermore, in step S43, CrossEntropyLoss and DiceLoss are superimposed as a hybrid loss function, wherein CrossEntropyLoss uses the size of the cross entropy to represent the difference between the two probability distributions, and obtains an approximate distribution of the target probability distribution by minimizing the cross entropy;
[0025] The DiceLoss measures the similarity between two samples by calculating the ratio of the intersection size of the two samples to the union size of the two samples.
[0026] Furthermore, in step S6, the rice stalk slice image to be predicted is preprocessed and put into the trained model to segment the rice stalk structure. Specifically, the image size is adjusted to the size required for model training, and finally input into the model for prediction.
[0027] Compared with the existing technology, the present invention has the following advantages: the rice stem cross-section segmentation method based on the Encoder-Decoder architecture effectively avoids the interference of noise caused by inherent problems of the equipment on model prediction through image preprocessing methods, and reduces the impact of objective factors on practical applications.
[0028] In the feature extraction process, the CNN's ability to extract detailed features and the transformer's ability to extract global features are used to interact with each other to increase the comprehensiveness of the network's feature extraction. Frequency domain features are introduced on the decoder side to integrate low-frequency signals containing details into the decoding process, reducing the information loss problem caused by the network during decoding. At the same time, the attention mechanism is introduced to enhance the feature extraction capability of the region of interest, effectively solving the problem of distinguishing between similar structures and solving the problem of unsatisfactory recovery. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is the overall schematic composition of the present invention;
[0030] Figure 2 This is an example diagram of a cross-section of a rice stalk structure according to an embodiment of the present invention;
[0031] Figure 3 This is an example image in the rice stalk structure cross-section dataset according to an embodiment of the present invention;
[0032] Figure 4This is a structural diagram of the Encoder-Decoder network model according to an embodiment of the present invention;
[0033] Figure 5 This is a structural diagram of an encoder unit in the Encoder-Decoder network model according to an embodiment of the present invention;
[0034] Figure 6 The ResNet model structure diagram and the Transformer model structure diagram of the encoder according to the embodiment of the present invention;
[0035] Figure 7 This is a structural diagram of a frequency domain decoder in the Encoder-Decoder network model according to an embodiment of the present invention;
[0036] Figure 8 This is a structural diagram of the wavelet transform decomposition mechanism according to an embodiment of the present invention;
[0037] Figure 9 This is a structural diagram of the fusion of frequency domain features and spatial domain features described in an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The following is a detailed description of the embodiments of the present invention. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments. Figure 1 As shown, a rice stem cross-section segmentation method based on the Encoder-Decoder architecture is described below. The specific working method is described with specific embodiments: Example 1: The present invention provides a rice stem microstructure segmentation method based on the Encoder-Decoder architecture, which specifically includes the following steps:
[0039] Step S1: collecting rice stalk cross-section images and preprocessing the stalk cross-section images;
[0040] like Figure 2 The diagram shows the microstructure of a rice stalk. In this example, rice seedlings were collected from the Intelligent Agricultural Machinery Equipment Laboratory. Samples were taken from the upper and middle portions of the rice seedling stems and scanned using micro-CT. The scan voltage was 50 kV, the scan current was 80 μA, the resolution was 4 μm, the detector exposure time was 2800 ms, the test rotation step was 0.2°, and the image size was 2016 × 2016. The captured image was resized to 1024 × 968.
[0041] like Figure 3 The image example in the rice stem structure slice dataset shown is as follows: Step S2: pre-processing the collected rice stem structure slice images;
[0042] The cropped images were flipped, brightness adjusted, and contrast enhanced, and the dataset was expanded to three times the original size, 3766 images. After shuffling, the data was divided into training set, validation set, and test set in a ratio of 8:1:1.
[0043] Step S3: Building a segmentation model of rice stem microstructure based on the Encoder-Decoder architecture and combining the wavelet transform mechanism;
[0044] like Figure 4 The network model structure diagram of the embodiment of the present invention shown in the figure shows that the rice stem microstructure segmentation model with wavelet transform mechanism constructed based on the data set includes four parts: Input, Encoder, Decode, and Output.
[0045] The input part uses PyTorch to normalize the input image pixels. Using normalization in the input stage can achieve better convergence of model training.
[0046] like Figure 5 As shown in the encoder unit structure diagram, the encoder consists of ResNetBlock and TransformerBlock. First, the input part is preprocessed, including the Conv convolution layer, BN layer, ReLU activation function, Maxpool maximum pooling layer, and then passes through the residual network containing 3, 4, and 6 Bottleneck layers, and finally passes through the 12-layer TransformerBlock.
[0047] like Figure 6 The Bottleneck structure diagram and TransformerBlock structure diagram shown.
[0048] like Figure 6 The Conv layer shown is the abbreviation of Convolution, 7×7 is the convolution kernel size, and 64 is the number of convolution kernels; the BN layer is the abbreviation of BatchNormalization, which refers to normalizing the input part; the ReLU activation function refers to retaining and mapping the features of the activated neurons through the function; the Maxpool layer refers to extracting the feature data of the specified window to significantly reduce the size of the feature tensor.
[0049] like Figure 7The decoder structure shown in the figure is composed of a spatial branch, a frequency branch and a dynamic feature fusion module (Dynamic feature fusion, DFF). It proposes wavelet transform decomposition, performs secondary decomposition on the low-frequency signal decomposed by wavelet transform, and fuses it with the spatial signal of the same scale. It also proposes a cross-domain dynamic feature fusion method to fuse the spatial features with the frequency domain features to reduce the information loss problem of the model when restoring the image. Figure 8 The structure diagram of the wavelet transform decomposition mechanism is shown in FIG. Figure 9 The structure diagram of the dynamic feature fusion module is shown.
[0050] The Output part predicts the model output results. Selecting CrossEntropyLoss and DiceLoss as the hybrid loss function can simultaneously consider classification accuracy and segmentation quality, which can well reflect the prediction accuracy of the model. The formula is as follows:
[0051]
[0052] Step S5: training the rice stem microstructure segmentation model and adjusting parameters to obtain the best effect;
[0053] The following table shows the comparison of experimental results of different models under the same parameters.
[0054]
[0055]
[0056] Step S6: Pre-process the rice seedling stem structure image and input it into the model for classification.
[0057] The advantages of the implementation of the present invention are as follows: sufficient effective information is obtained during the sampling process, and feature extraction is more sufficient; the hierarchical encoding mode of the Unet network CNN is borrowed, and the Transformer module is introduced at the end of the CNN for hybrid feature extraction, thereby enhancing the ability to extract fine-grained information of large-scale feature maps and abstract semantic information of small-scale feature maps; drawing on the idea of wavelet transform, a wavelet transform decomposition mechanism is introduced at the decoding end, thereby reducing the probability of losing effective information at the decoding end, solving the problem of distinguishing similar structures, and enhancing information recovery capabilities.
[0058] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.
[0059] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0060] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A rice stem cross-section segmentation method based on an Encoder-Decoder architecture, characterized in that: The following steps are involved: Step S1: collecting rice stem cross-section images; Step S2: pre-processing the stem section image; Step S3: generating a rice stalk cross-section image dataset based on the pre-processed rice stalk cross-section images; Step S4: constructing a rice stalk structure segmentation model based on the Encoder-Decoder architecture, combining the transformer hybrid encoding and wavelet transform decoding mechanism; Step S5: training the rice stalk structure segmentation model; Step S6: Segment and classify the rice stalk structure image.
2. The rice stalk cross-section segmentation method based on the Encoder-Decoder architecture according to claim 1, characterized in that: The step S4 specifically includes: Step S40: defining the input part of the model based on the data set; Step S41: construct a feature encoder based on the combination of CNN and Transformer; Step S42: constructing a feature decoder part based on wavelet transform; Step S43: Select a loss function to define the output part of the model.
3. The rice stalk cross-section segmentation method based on the Encoder-Decoder architecture according to claim 1, characterized in that: In step S1, the specific contents of pre-processing the collected rice seed image include: adjusting the size of the target rice stalk slice image captured in step S1, and performing image denoising and filtering on the image.
4. The rice stalk cross-section segmentation method based on the Encoder-Decoder architecture according to claim 1, characterized in that: In step S3, the specific steps of preparing the rice seed image dataset include: Step S30: processing the obtained rice stalk slice image by a data amplification method of rotation, brightness enhancement and contrast enhancement adjustment to amplify the sample number to several times the original number; Step S31: Divide the data into a training set, a validation set, and a test set.
5. The rice stalk cross-section segmentation method based on the Encoder-Decoder architecture according to claim 1, characterized in that: In step S40, the input portion of the model defined based on the data set is normalized.
6. The rice stalk cross-section segmentation method based on the Encoder-Decoder architecture according to claim 2, characterized in that: The specific content of step S41 is: constructing a feature encoder based on the combination of CNN and Transformer and defining it to include an input part and a bottleneck part.
7. The rice stalk cross-section segmentation method based on the Encoder-Decoder architecture according to claim 2, characterized in that: In step S42, the wavelet transform decoding module is a feature decoding module based on the wavelet transform method, which uses wavelet transform decomposition to convert features into frequency domain features while decomposing them into four different components, and proposes a cross-domain feature interaction strategy.
8. The rice stalk cross-section segmentation method based on the Encoder-Decoder architecture according to claim 2, characterized in that: In step S43, CrossEntropyLoss and DiceLoss are superimposed as a hybrid loss function, wherein CrossEntropyLoss uses the size of the cross entropy to represent the difference between the two probability distributions, and obtains an approximate distribution of the target probability distribution by minimizing the cross entropy; The DiceLoss measures the similarity between two samples by calculating the ratio of the intersection size of the two samples to the union size of the two samples.
9. The rice stalk cross-section segmentation method based on an Encoder-Decoder architecture according to claim 1, characterized in that: In step S6, the rice stalk slice image to be predicted is preprocessed and put into the trained model to segment the rice stalk structure. The specific content is: the image size is adjusted to the size required for model training, and finally input into the model for prediction.
Citation Information
Patent Citations
Construction method of rice stem cross-section segmentation model and detection method based on the model
CN114677325B
Cited By
Frequency domain and scale common sensing network applied to pancreatic tumor segmentation
CN121190771A