Crop growth prediction method, device, equipment and storage medium
Patent Information
- Application Number
- CN202511969524.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2045-12-24
AI Technical Summary
[0004]然而,上述现有技术在作物生长动态预测方面仍存在诸多不足
[0016] The crop growth prediction method, apparatus, device, and storage medium provided by this invention acquire and preprocess original image sequences of the target crop at different growth stages. A Segformer encoder, including a channel and spatial attention mechanism (CBAM) module, extracts multi-scale encoded feature maps. This is combined with a Segformer decoder based on a lightweight feature pyramid (L-FPN) structure for multi-level semantic fusion, generating a semantic segmentation map sequence representing the crop's morphological structure. Spatial features are then extracted using a convolutional neural network and input into a long short-term memory (LSTM) network for temporal modeling. This fully integrates temporal image features, effectively capturing the dynamic evolution trend and cumulative effects of crops across stages. It solves the problems of unstable feature extraction and insufficient model generalization ability caused by changes in ambient light and viewpoint shifts in existing technologies, achieving long-term, high-precision continuous growth prediction.
Smart Images

Figure CN121838124B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart agriculture technology, and in particular to a method, apparatus, equipment and storage medium for predicting crop growth. Background Technology
[0002] Crop growth dynamic prediction is a key technological link in realizing precision management and yield optimization in smart agriculture. With the development of computer vision and deep learning technologies, image-based visualization perception methods have become an important technical support for crop status recognition, trait estimation, and growth trend analysis due to their advantages such as non-contact, high resolution, and automation.
[0003] In existing technologies, various solutions based on image processing and sensor monitoring have been applied to crop growth monitoring. Regarding image processing algorithms, some solutions utilize spectral image thresholding and pixel difference calculation techniques to accurately distinguish between plant and soil areas and correct background noise, constructing a growth status index reflecting crop health. In terms of data acquisition hardware, some solutions employ automated suspended track systems to carry cameras and sensors, achieving simultaneous automated acquisition of crop images along with environmental parameters such as temperature and humidity. Regarding modeling and recognition, some solutions fuse temporal data and texture features from remote sensing images, using classifiers such as support vector machines to improve crop recognition accuracy, or utilize multi-date hyperspectral imagery combined with growth period recognition networks to establish linear models to estimate biomass for temporal monitoring. Furthermore, some systems integrate plant phenotypic feature analysis with environmental data, using standard model comparison methods to automatically identify abnormal plant growth.
[0004] However, the aforementioned existing technologies still have many shortcomings in predicting crop growth dynamics. First, most methods focus on feature extraction from static images and single-moment state determination, making it difficult to capture the dynamic evolution trend and cumulative effects of crops across stages. Second, during image acquisition, problems such as changes in ambient light, viewpoint shifts, and physical occlusion are commonly encountered, leading to difficulties in data temporal alignment and poor stability of image feature extraction. Finally, existing models are mostly based on simple linear assumptions or lack a unified multi-source data fusion mechanism, making it difficult to fully integrate external environmental parameters and complex temporal image features. This results in insufficient generalization ability of the models in complex and ever-changing agricultural scenarios, making it impossible to achieve long-term, high-precision continuous growth prediction. Summary of the Invention
[0005] This invention provides a crop growth prediction method, apparatus, device, and storage medium to solve the above-mentioned problems.
[0006] This invention provides a crop growth prediction method, comprising the following steps: Obtain the original image sequence of the target crop at different growth stages, and preprocess the original image sequence to obtain input data; The input data is fed into a Segformer encoder that includes a channel and spatial attention mechanism CBAM module to extract multi-scale encoded feature maps. The Segformer decoder, based on the lightweight feature pyramid L-FPN structure, performs multi-level semantic fusion on the multi-scale encoded feature map to generate a semantic segmentation map sequence for characterizing crop morphological structure. The crop morphological spatial features are extracted from the semantic segmentation map sequence by a convolutional neural network, and then the crop morphological spatial features are input into a long short-term memory network (LSTM) to output the prediction result of the future growth status of the target crop.
[0007] According to a crop growth prediction method provided by the present invention, the step of performing multi-level semantic fusion on the multi-scale encoded feature map through a Segformer decoder based on an L-FPN structure to generate a semantic segmentation map sequence for characterizing crop morphological structure includes: The multi-scale encoded feature map is unified by a 1×1 convolution to obtain a multi-level standardized feature map; The highest-level standardized feature map is used as the initial fusion feature. For each level of standardized feature map other than the highest level, the fusion feature of the previous level and the standardized feature map of the current level are added pixel by pixel through nearest neighbor upsampling to obtain the fusion feature of the current level, until a multi-level fusion feature containing the lowest level information is generated. Based on the multi-level fusion features, a semantic segmentation map sequence is generated to characterize the morphological structure of crops.
[0008] According to a crop growth prediction method provided by the present invention, the step of generating a semantic segmentation map sequence for characterizing crop morphological structure based on the multi-level fusion features includes: The multi-level fused features are each optimized locally through a 3×3 convolutional layer to obtain multiple feature maps. Unify all feature maps to the same scale by upsampling the nearest neighbor; Multiple feature maps, after being unified to the same scale, are spliced along the channel dimension to form a globally fused feature. Based on the global fusion features, a semantic segmentation map sequence is generated to characterize the morphological structure of crops.
[0009] According to a crop growth prediction method provided by the present invention, the preprocessing of the original image sequence to obtain input data includes: An adaptive histogram equalization algorithm is used to process the original image sequence to improve the image contrast in low-light areas; and the processed image is converted from the RGB color space to the HSV color space. The excessively blurred or missing images in the original image sequence are removed, and the remaining image sequence is unified to a standard resolution format to obtain the input data.
[0010] According to a crop growth prediction method provided by the present invention, the CBAM module includes a channel attention unit and a spatial attention unit connected in series. The channel attention unit is used to perform global pooling on the input features to generate channel attention weights, and then multiply the channel attention weights with the input features channel by channel to obtain a channel-weighted feature map. The spatial attention unit is used to perform channel-dimensional pooling on the channel-weighted feature map to generate a spatial attention weight map, and then multiply the spatial attention weight map with the channel-weighted feature map pixel by pixel to output the final encoded feature map.
[0011] According to a crop growth prediction method provided by the present invention, the method involves extracting crop morphological spatial features from the semantic segmentation map sequence using a convolutional neural network, inputting the crop morphological spatial features into an LSTM, and outputting a prediction result of the future growth state of the target crop, including: The semantic segmentation map sequence is used to extract features by a convolutional neural network to generate a spatial feature vector sequence that represents the shape of the crop crown and the distribution of leaves. The spatial feature vector sequence is input into an LSTM to obtain the prediction result of the future growth status of the target crop; the prediction result of the future growth status includes the crop canopy width parameter and / or growth level at future time.
[0012] The present invention also provides a crop growth prediction device, comprising the following modules: The acquisition module is used to acquire the original image sequence of the target crop at different growth stages, and to preprocess the original image sequence to obtain input data; The extraction module is used to input the input data into the Segformer encoder of the integrated channel and spatial attention mechanism CBAM module to extract multi-scale coded feature maps; The fusion module is used to perform multi-level semantic fusion on the multi-scale encoded feature map through the Segformer decoder based on the lightweight feature pyramid L-FPN structure, and generate a semantic segmentation map sequence for characterizing crop morphological structure. The prediction module is used to extract crop morphological spatial features from the semantic segmentation map sequence using a convolutional neural network, input the crop morphological spatial features into a long short-term memory network (LSTM), and output the prediction result of the future growth status of the target crop.
[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the crop growth prediction method as described above.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the crop growth prediction method as described above.
[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the crop growth prediction method as described above.
[0016] The crop growth prediction method, apparatus, device, and storage medium provided by this invention acquire and preprocess original image sequences of the target crop at different growth stages. A Segformer encoder, including a channel and spatial attention mechanism (CBAM) module, extracts multi-scale encoded feature maps. This is combined with a Segformer decoder based on a lightweight feature pyramid (L-FPN) structure for multi-level semantic fusion, generating a semantic segmentation map sequence representing the crop's morphological structure. Spatial features are then extracted using a convolutional neural network and input into a long short-term memory (LSTM) network for temporal modeling. This fully integrates temporal image features, effectively capturing the dynamic evolution trend and cumulative effects of crops across stages. It solves the problems of unstable feature extraction and insufficient model generalization ability caused by changes in ambient light and viewpoint shifts in existing technologies, achieving long-term, high-precision continuous growth prediction. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating the crop growth prediction method provided by the present invention.
[0019] Figure 2 This is a flowchart illustrating the crop growth dynamic prediction method based on image vision provided by the present invention.
[0020] Figure 3 This is a schematic diagram of the structure of the Segformer encoder with integrated CBAM provided by the present invention.
[0021] Figure 4 This is a schematic diagram of the Segformer decoder based on the L-FPN structure provided by the present invention.
[0022] Figure 5 This is a flowchart of a prediction network that integrates image spatial semantics and time series dynamic modeling provided by the present invention.
[0023] Figure 6 This is a schematic diagram of the crop growth prediction device provided by the present invention.
[0024] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0026] Figure 1 This is a flowchart illustrating the crop growth prediction method provided by the present invention, as shown below. Figure 1 As shown, the method includes the following steps: Step 100: Obtain the original image sequences of the target crop at different growth stages, preprocess the original image sequences to obtain input data.
[0027] Step 101: Input the input data into the Segformer encoder, which includes the channel and spatial attention mechanism CBAM module, and extract multi-scale encoded feature maps.
[0028] Step 102: Using the Segformer decoder based on the lightweight feature pyramid L-FPN structure, multi-level semantic fusion is performed on the multi-scale encoded feature maps to generate a semantic segmentation map sequence for characterizing crop morphological structure.
[0029] Step 103: Extract crop morphological spatial features from the semantic segmentation map sequence using a convolutional neural network, input the crop morphological spatial features into a long short-term memory network (LSTM), and output the prediction results of the future growth status of the target crop.
[0030] Specifically, the target crop refers to the crop whose growth needs to be predicted. The execution entity of the method provided in this embodiment of the invention can be a computing device with certain computing capabilities, or a crop growth prediction system containing a computing device. The following description uses a system as an example to illustrate the method provided by this invention.
[0031] First, the system can acquire raw image sequences of the target crop at different growth stages through an image acquisition device, and preprocess the raw image sequences to obtain standard input data.
[0032] In some implementations, one can start by developing standardized image acquisition specifications, covering dimensions such as shooting angle, shooting interval, image resolution, and acquisition device parameters, thereby enabling dynamic modeling of the target crop growth process.
[0033] For example, taking cabbage as an example, the image acquisition device can use a handheld camera. Within the cabbage growing area in a greenhouse or field, a fixed shooting angle and height are set, and images are continuously acquired every two days during the growing season. This ensures that each image completely captures the entire cabbage plant, thus constructing a multi-temporal image sequence dataset that combines temporal continuity and spatial consistency. To ensure the acquired images are clear and consistent, the handheld camera can use functions such as automatic exposure and white balance lock, and timestamps and region numbers are embedded in the image naming rules to facilitate subsequent time-series processing.
[0034] Based on this, the obtained original image sequence is preprocessed in batches. This process may include illumination correction, color standardization, noise suppression and format unification, etc., but the embodiments of the present invention do not limit this.
[0035] According to a crop growth prediction method provided by the present invention, the original image sequence is preprocessed to obtain input data, including: An adaptive histogram equalization algorithm is used to process the original image sequence to improve the image contrast in low-light areas; and the processed image is converted from the RGB color space to the HSV color space. The excessively blurred or missing images in the original image sequence are removed, and the remaining image sequence is unified to a standard resolution format to obtain the input data.
[0036] Specifically, firstly, for the acquired original image sequence, in order to improve the problem of image detail loss caused by uneven ambient lighting or shadow occlusion, the system can use an adaptive histogram equalization algorithm to process each frame of the sequence. This algorithm dynamically adjusts pixel values by calculating the local histogram distribution of the image, thereby focusing on improving the image contrast in low-light areas. For example, the Contrast Limited Adaptive Histogram Equalization (CLAHE) algorithm can be used.
[0037] In this way, the texture and edge information of crop leaves, which are originally difficult to discern in the dark, are highlighted, making the light distribution of the image more uniform.
[0038] After improving the contrast of the image through adaptive histogram equalization, the image can then be converted from the common RGB color space to the HSV color space. Compared to RGB, HSV generally reflects human visual perception of color more intuitively and is less sensitive to changes in lighting. Since the target crops are typically greenish, subsequent algorithms can be more stable and efficient in processing crop segmentation and recognition.
[0039] To further ensure the quality of data used for subsequent deep learning model training or prediction, it is necessary to screen the original image sequences for content integrity, removing samples that do not meet the requirements. Specifically, excessively blurry images generated during the acquisition process, as well as images with missing targets, can be checked and removed. This screening mechanism ensures that the data input to subsequent models consists of clear samples containing complete crop features, avoiding negative interference from invalid data in the prediction results.
[0040] Finally, after quality screening, the remaining valid image sequences can be uniformly adjusted to a standard resolution format. Since deep learning models typically require input tensors to have a fixed size, images from different sources or cropped images need to be adjusted to uniform width and height pixel values, for example, to the model's preset input size.
[0041] After a series of steps including illumination enhancement, color space conversion, quality screening, and size normalization, standardized input data is finally obtained. This data is consistent in terms of visual quality, format specifications, and content validity, and can then be used as input for the subsequent Segformer encoder.
[0042] In some implementations, to further improve the model's generalization ability, enhancement strategies such as image flipping, rotation, brightness adjustment, and noise addition can be introduced to expand the sample size. Subsequently, an image annotation system is constructed, and keyframe images are annotated using tools such as LabelMe to form an image-label pair time-series dataset, which constitutes the input basis for subsequent models.
[0043] After obtaining preprocessed input data, the system can feed this data into the Segformer encoder, which includes a Convolutional Block Attention Module (CBAM), to extract multi-scale encoded feature maps. In this process, after the input data enters the network, the Segformer encoder extracts features from the image using its unique hierarchical structure.
[0044] The introduced CBAM module can adaptively weight features in both channel and spatial dimensions. This means that the Segformer encoder can focus more on key regions in the image that are closely related to the crop growth state, such as leaf texture and edge shape. At the same time, the Segformer encoder can suppress background noise such as soil and weeds.
[0045] In this way, the Segformer encoder can generate multi-scale feature maps with different resolutions and semantic levels, providing rich information support for subsequent reconstruction of the detailed morphology of crops.
[0046] Next, based on the extracted multi-scale encoded feature maps, the system processes them through a Segformer decoder based on a lightweight feature pyramid (L-FPN) structure. The purpose is to perform multi-level semantic fusion on the multi-scale encoded feature maps, thereby generating a semantic segmentation map sequence for characterizing crop morphological structure.
[0047] At this stage, the L-FPN structure can effectively integrate features from different levels of the encoder, combining low-level detailed information with high-level semantic information. Through this multi-level semantic fusion, the decoder can gradually restore the spatial resolution of the image and output a sequence of semantic segmentation maps. These semantic segmentation maps are digital representations of crop morphology and structure, clearly outlining the contours and morphology of the target crop at different time points, forming a dynamic sequence reflecting crop growth changes.
[0048] Finally, the system extracts spatial features representing the crop morphology at the current moment from each semantic segmentation map in the semantic segmentation map sequence using Convolutional Neural Networks (CNNs), and inputs these temporally ordered spatial features into a Long Short-Term Memory (LSTM) network. Because LSTM has the advantage of processing time-series data, it can learn the evolution patterns of crop morphological features over time and capture long-term dependencies in the growth process. Based on the learned spatiotemporal evolution patterns, the LSTM network ultimately outputs a prediction of the future growth state of the target crop, realizing the deduction from historical morphological sequences to future growth trends.
[0049] It should be noted that the Segformer encoder containing the CBAM module, the Segformer decoder based on the lightweight feature pyramid L-FPN structure, the convolutional neural network, and the long short-term memory network LSTM described in the embodiments of the present invention mainly define the flow of data and the processing logic. Therefore, the above model structure can refer to the network to be optimized in the model training stage, or to the finalized network after training.
[0050] During the training phase, the aforementioned network structure can receive labeled sample data. By calculating the loss function between the predicted result and the true label, it continuously adjusts the weight parameters within the encoder, decoder, and LSTM using the backpropagation algorithm until the model converges. During the actual prediction or application phase, the network structure can load pre-trained fixed-parameter weights and directly perform forward inference on newly collected, unlabeled target crop input data, thereby outputting a prediction of the future growth state. This means that regardless of whether the internal parameters of the model are fixed, any technical solution that uses the aforementioned connection method and hierarchical structure for feature extraction, semantic fusion, and primary temporal processing can be understood as being included within the scope of this application.
[0051] According to the crop growth prediction method provided by the present invention, a multi-level semantic fusion is performed on multi-scale encoded feature maps using a Segformer decoder based on an L-FPN structure to generate a semantic segmentation map sequence for characterizing crop morphological structure, including: Multi-scale encoded feature maps are unified by 1×1 convolution to obtain multi-level standardized feature maps; The highest-level standardized feature map is used as the initial fusion feature. For each level of standardized feature map other than the highest level, the fusion feature of the previous level and the standardized feature map of the current level are added pixel by pixel through nearest neighbor upsampling to obtain the fusion feature of the current level, until a multi-level fusion feature containing the lowest level information is generated.
[0052] Based on multi-level fusion features, a sequence of semantic segmentation maps is generated to characterize the morphological structure of crops.
[0053] Specifically, in order to solve the problem of inconsistent spatial resolution and number of channels in the feature maps output by the Segformer encoder, in this embodiment of the invention, in order to adapt to the significant morphological changes of target crop plants at different growth stages, the system can process all the multi-scale encoded feature maps output by the Segformer encoder through a 1×1 convolutional layer.
[0054] This operation allows you to uniformly set the number of output channels for all levels to a specific value, such as 256 channels, thereby obtaining a standardized feature map.
[0055] For example, the four-level feature maps output by the SegFormer encoder, corresponding to different spatial resolutions. All layers are processed using a 1×1 convolutional layer, with a uniform output channel count of 256. The resulting standardized feature map is then obtained. The specific calculation process can be expressed as follows: After obtaining the standardized feature maps, the system can operate at the highest semantic level (i.e., the lowest resolution). Starting with the standardized feature map, we use it as the initial fusion feature; for each subsequent level (in order...), we... ), all of which will be the level above (i.e. Fusion characteristics of layers Nearest neighbor upsampling is performed to make the resolution of the fused features from the previous level match the normalized features of the current level. Figure 1 Then, compare it with the standardized feature map of the current level. Perform a pixel-by-pixel channel addition operation.
[0056] Through this cascading method, high-level semantic information is injected into the detailed features of the current level without loss. The resulting new fused features contain both the texture details of the current layer and inherit the semantic accumulation of all previous high-level layers, until they are finally fused with the lowest level.
[0057] For example, this cyclic transfer formula can be expressed as: in,i This indicates a hierarchical index. This mechanism ensures that shallow features, while preserving details such as leaf texture grayscale gradients and edge pixel abrupt changes, deeply incorporate high-level semantic information containing the overall morphology of the plant.
[0058] It should be noted that in this embodiment of the invention, the 3×3 smoothing convolution operation commonly used after traditional FPN fusion can be removed. This is because the local smoothing properties of convolution may blur high-frequency detail features such as leaf edges and textures of the target crop, which are key to distinguishing adjacent plants in densely planted target crops and identifying overlapping leaf areas. By removing this smoothing convolution, the smoothing loss of high-frequency details caused by the convolution operation can be avoided, and the computational cost of feature fusion can be reduced by about 10%, allowing high-level semantic features to be injected into low-level features without information loss.
[0059] Finally, the system can generate a sequence of semantic segmentation maps to characterize crop morphological structures based on multi-level fusion features.
[0060] Through the aforementioned iterative transmission process, each layer of features receives constraints from higher-level semantics, resulting in fused features that combine both high-level semantics and low-level details. This fusion mechanism resolves the contradiction between weak semantics in shallow features and limited detail in deep features, ensuring that when identifying overlapping leaf regions, the model can determine the target crop category based on high-level semantics while simultaneously distinguishing specific leaf edges and overlapping boundaries based on low-level details. The semantic segmentation map sequence generated in this way can significantly improve the ability to discriminate subtle features of the target crop and reduce the missegmentation rate in densely planted scenarios, thus providing a high-precision morphological representation foundation for subsequent extraction of crop morphological spatial features and prediction of growth status.
[0061] According to a crop growth prediction method provided by the present invention, based on multi-level fusion features, a semantic segmentation map sequence for characterizing crop morphological structure is generated, including: The multi-level fused features are locally optimized through 3×3 convolutional layers to obtain multiple feature maps; Unify all feature maps to the same scale by upsampling the nearest neighbor; Multiple feature maps, after being unified to the same scale, are spliced along the channel dimension to form a globally fused feature. Based on global fusion features, a sequence of semantic segmentation maps is generated to characterize the morphological structure of crops.
[0062] Specifically, the system can feed the multi-level fusion features obtained in the aforementioned steps into 3×3 convolutional layers. This operation mainly utilizes the local receptive field of the 3×3 convolutional kernel to perform neighborhood calibration on the fusion features. On the one hand, it can correct the pixel position shift that may be caused by the upsampling operation and eliminate the feature aliasing effect during the fusion process. On the other hand, through the weight learning of the convolutional kernel, it can effectively filter effective information and suppress background noise such as soil and weeds, thereby enhancing the expression of key local features such as leaf texture and veins of the target crop.
[0063] In addition, the use of a 3×3 small convolution kernel ensures optimization while introducing only a small number of parameters, which is consistent with SegFormer's overall lightweight design philosophy.
[0064] Subsequently, the system can unify all locally optimized feature maps to a specific scale through nearest neighbor upsampling, and then stitch these multi-scale features together along the channel dimension. In this way, the resolution differences between features at different levels are eliminated, while the unique information of each level is fully preserved.
[0065] For example, the feature maps of the four levels are respectively Among them, high-level characteristics It can preserve the overall morphology and global semantic information of the plant, mid-level features It can preserve the distribution structure information of leaf clusters and fine-grained features. It can preserve the outline information of a single blade, while retaining microscopic details. This way, the texture and edge information of the leaves can be preserved.
[0066] Finally, based on the globally fused features, a sequence of semantic segmentation maps is generated to characterize the crop's morphological structure. The SegFormer decoder can ultimately output a segmentation probability map of the same size as the input image. ,in The number of categories represents the probability that each pixel belongs to each category, thus clearly presenting the boundary and outline region of a single plant in each frame of the target crop image, providing a foundation for subsequent growth feature parameter extraction and modeling analysis.
[0067] In some implementations, to optimize the generation results, a pixel-level cross-entropy loss function can be used during the SegFormer decoder training process. Its formula can be expressed as: in, Represents the total number of pixels. For real labels, To predict probabilities.
[0068] By minimizing this loss, the model can learn accurate segmentation capabilities and output high-quality semantic segmentation graph sequences.
[0069] According to a crop growth prediction method provided by the present invention, the CBAM module includes a channel attention unit and a spatial attention unit connected in series. The channel attention unit is used to perform global pooling on the input features to generate channel attention weights, and then multiply the channel attention weights with the input features channel by channel to obtain a channel-weighted feature map. The spatial attention unit is used to perform channel-dimensional pooling on the channel-weighted feature map to generate a spatial attention weight map. The spatial attention weight map is then multiplied pixel-by-pixel with the channel-weighted feature map to output the final encoded feature map.
[0070] Specifically, the CBAM module is composed of a channel attention mechanism and a spatial attention mechanism connected in series, and this structure is embedded in the TransformerBlock structure of the SegFormer encoder.
[0071] The channel attention unit is first used to perform global pooling on the input features to generate channel attention weights, and then multiplies the channel attention weights with the input features channel by channel to obtain a channel-weighted feature map.
[0072] Channel attention units can be used to highlight semantic channels closely related to crop growth (such as leaf color and head texture). Let the input feature map be... Channel descriptors can be obtained through Global Average Pooling (GAP) and Global Max Pooling (GMP): The descriptors are then fed into a shared multi-layer perceptron (MLP), a process represented by the following formula: in, For channel attention weights, This is the Sigmoid function. The input features are finally weighted using the following formula: in This represents channel-by-channel multiplication, thereby completing feature enhancement in the channel dimension.
[0073] After channel weighting, the spatial attention unit performs channel-dimensional pooling on the channel-weighted feature map to generate a spatial attention weight map. This spatial attention weight map is then multiplied pixel-by-pixel with the channel-weighted feature map to output the final encoded feature map. This step is primarily used to capture the spatial location information of key components.
[0074] Spatial attention units can process channel-weighted features Max pooling and average pooling are performed along the channel direction to obtain two two-dimensional feature maps: The two can then be concatenated, and a spatial attention map can be obtained using convolutional layers, such as 7×7 convolutional kernels. Its calculation formula can be expressed as: Ultimately, it can be achieved through the formula Output the final encoded feature map.
[0075] According to the crop growth prediction method provided by the present invention, crop morphological spatial features are extracted from semantic segmentation map sequences through a convolutional neural network, and the crop morphological spatial features are input into an LSTM to output the prediction result of the future growth state of the target crop, including: By using a convolutional neural network to extract features from the semantic segmentation map sequence, a spatial feature vector sequence representing the crop crown shape and leaf distribution is generated. The spatial feature vector sequence is input into the LSTM to obtain the prediction results of the future growth status of the target crop; the prediction results of the future growth status include the crop canopy parameters and / or growth level at future time.
[0076] Specifically, a convolutional neural network can be used as the spatial feature extraction module, with its input being the semantic segmentation map sequence obtained in the preceding steps. Through convolutional neural network processing, the system can extract key morphological features of the target crop from semantic segmentation image sequences and transform this high-dimensional image information into a sequence of spatial feature vectors that can characterize the state of the crop at each time step, for example... The spatial feature vector at time step is This effectively transforms the visual distribution and morphological structure of leaves into numerical feature representations. Subsequently, the spatial feature vector sequence can be input into the LSTM to obtain the prediction results of the future growth status of the target crop. This process mainly utilizes LSTM for time series modeling to capture the changing trends and evolutionary patterns of plant growth characteristics over time.
[0077] LSTM processes the input spatial feature vector through a gating mechanism. The specific recursive calculation process can be achieved through the following formula: in, These are the input gate, forget gate, and output gate, respectively. In cellular state, In hidden state, These are the weights and bias parameters.
[0078] Through this iterative process, LSTM can effectively memorize long-term growth dependencies.
[0079] Ultimately, the future growth status prediction output by this step can specifically include crop canopy parameters and / or growth level at future times.
[0080] In some implementations, the model's output can be represented as a future... Growth parameter prediction vector at time step These prediction vectors correspond to the future canopy shape and overall growth of the target crop.
[0081] To ensure prediction accuracy, mean squared error (MSE) can be used as the loss function during LSTM training. Its calculation formula is as follows: in, This represents the dimension of the prediction parameters. By minimizing this loss, the system can achieve dynamic and accurate predictions of cabbage growth trends.
[0082] The crop growth prediction method provided by the present invention will be further illustrated below through specific application scenarios.
[0083] Figure 2 This is a schematic flowchart illustrating the image-based vision-based crop growth dynamic prediction method provided by the present invention. Figure 2 As shown, the crop growth dynamic prediction method based on image vision proposed in this invention, taking cabbage as an example, mainly includes the following steps: Step 1: Establish time-series image acquisition standards for cabbage crops and construct image sequence data with temporal continuity.
[0084] Step 2: Perform image enhancement and distortion correction on the acquired image sequences, expand the sample size using technical strategies, and perform annotation processing to construct a high-quality dataset for growth prediction.
[0085] Step 3: Construct a Segformer encoder that integrates the CBAM attention mechanism. By jointly modeling image channel features and spatial features, the semantic segmentation model can achieve spatial perception of key regions in cabbage images.
[0086] Step 4: Design a Segformer decoder based on the L-FPN structure to improve the multi-scale semantic information fusion capability.
[0087] Step 5: Construct a prediction network that integrates image spatial semantics and time series dynamic modeling to achieve crop state estimation under multi-temporal image input.
[0088] Step 6: Develop a greenhouse crop growth dynamic prediction system to achieve linkage between image acquisition, model inference, parameter display and remote control.
[0089] Furthermore, step 1 specifically involves establishing standardized image acquisition specifications, including shooting angle, shooting interval, image resolution, and acquisition device parameters, to achieve dynamic modeling of the cabbage growth process. The image acquisition device is a handheld camera, used in greenhouses or field cabbage growing areas. Fixed shooting angles and heights are set, and images are continuously acquired throughout the growing season (once every two days). Each image must contain a whole cabbage plant, constructing a multi-temporal image sequence dataset with temporal continuity and spatial consistency. The handheld camera has functions such as automatic exposure and white balance locking to ensure image clarity and consistency. Timestamps and region numbers are embedded in the image naming rules for easy time-series processing.
[0090] Further, step 2 specifically involves batch preprocessing the original image sequence obtained in step 1, including illumination correction, color normalization, noise suppression, and format unification. Adaptive histogram equalization (such as CLAHE) is used to improve the quality of low-light images, and color space conversion (RGB to HSV) is applied to enhance the contrast of green plant areas. Simultaneously, excessively blurred, overexposed, or target-missing images acquired during the acquisition process are removed. To improve the model's generalization ability, image flipping, rotation, brightness adjustment, and noise reduction strategies are further introduced to expand the sample size. Subsequently, an image annotation system is constructed, and keyframe images are annotated using the LabelMe tool to form an image-label pair time-series dataset, which serves as the input basis for the semantic segmentation and prediction model.
[0091] Furthermore, Figure 3 This is a schematic diagram of the structure of the Segformer encoder with integrated CBAM provided by the present invention. Figure 3As shown, step 3 specifically involves redesigning the encoder part based on the SegFormer model framework and introducing the CBAM module to enhance the model's spatial perception ability of key regions in cabbage images. The CBAM module consists of a channel attention mechanism and a spatial attention mechanism connected in series, which are used to highlight semantic channels closely related to crop growth (leaf color, leaf head center texture) and capture the spatial location information of key parts, respectively.
[0092] The formula for calculating the channel attention mechanism is: Let the input feature map be Channel descriptors are obtained through global average pooling and global max pooling: Then input the shared multilayer perceptron (MLP): in, For channel attention weights, This is the Sigmoid function. Finally, the input features are weighted: in This indicates channel-by-channel multiplication.
[0093] The computational process of the spatial attention mechanism is as follows: Channel-weighted features Perform max pooling and average pooling along the channel direction to obtain two two-dimensional feature maps: After concatenating the two, a spatial attention map is obtained using a convolutional layer: in This represents a 7×7 convolution kernel. Final output: This module is embedded after each level of feature extraction units in the TransformerBlock structure. During the encoding process, it enhances the model's ability to express fine features such as cabbage leaf structure and edge shape, providing support for subsequent high-precision semantic segmentation.
[0094] Furthermore, Figure 4 This is a schematic diagram of the Segformer decoder based on the L-FPN structure provided by the present invention. Figure 4As shown, step 4 specifically involves, to address the significant morphological changes in cabbage plants at different growth stages, an innovative L-FPN structure is introduced into the Segformer decoder. Through a three-stage feature fusion strategy, efficient fusion of multi-layer feature maps output by the encoder is achieved, significantly improving the recognition performance of cabbage plants at different scales. The specific implementation is divided into the following three stages: Phase 1: Feature Channel Standardization Compared to the multi-branch convolutional structure of traditional FPN designed to adapt to different backbone features, this paper uses the 4-level feature map output by the SegFormer encoder. (For different spatial resolutions) All layers use a 1×1 convolutional layer, resulting in a uniform output of 256 channels. This operation effectively eliminates channel dimension inconsistencies while maintaining the differences in feature resolution across layers. It simplifies the cross-scale feature fusion process, lays the foundation for direct interaction between features, and significantly reduces parameter redundancy caused by traditional multi-branch structures. The processed result is a standardized feature map. ,in: Phase Two: Top-Down Semantic Enhancement Delivery The second stage employs a top-down semantic enhancement delivery approach, using the highest-level features... Starting with nearest neighbor upsampling and second-highest level features, Perform a pixel-by-pixel channel addition operation to generate enhanced features, and then continue to pass them down; repeat this process until the lowest-level features are reached. Fusion. Traditional FPN introduces a 3×3 smooth convolution after feature fusion, with the core purpose of eliminating the grid effect and feature aliasing caused by upsampling. However, this operation has two major drawbacks: first, the 3×3 convolution introduces additional parameters and computational overhead, which contradicts the lightweight design philosophy of SegFormer; second, the local smoothing property of convolution can blur high-frequency details such as the edges and textures of cabbage leaves, which are key to distinguishing adjacent plants in densely planted cabbage and identifying overlapping leaf areas. Therefore, this design removes the 3×3 smooth convolution after fusion in traditional FPN. Through a recurrent mechanism, shallow features retain details such as leaf edges and textures while deeply integrating high-level semantic information, enhancing the ability to discriminate subtle features such as cabbage edges and textures.
[0095] By removing the 3×3 smoothed convolution after traditional FPN fusion, the smoothing loss of high-frequency details such as cabbage leaf edges and textures caused by convolution operations is avoided, while reducing the feature fusion computation by about 10%. A direct fusion method of nearest neighbor upsampling and pixel-wise channel addition is adopted, allowing high-level semantic features to be injected into low-level features without information loss. This fully preserves subtle features such as gray-level gradients and edge pixel abrupt changes in cabbage leaf texture, providing core evidence for distinguishing adjacent plants in densely planted cabbage and identifying overlapping leaf areas. Simultaneously, a formula-based cyclic propagation link allows high-level semantic features containing the overall morphology of the cabbage plant to gradually permeate to low-level features, resolving the contradiction between weak semantics in shallow features and limited detail in deep features. This mechanism allows each layer of features to receive high-level semantic constraints multiple times, ensuring that when identifying overlapping leaf areas, the model can both rely on high-level semantics to determine the cabbage plant category and rely on low-level details to distinguish specific leaf edges and overlapping boundaries, significantly improving the ability to discriminate subtle features of cabbage and reducing the missegmentation rate in densely planted scenarios.
[0096] The specific formula is as follows: Phase 3: Global Feature Refinement To inherit Segformer's efficient design philosophy, a lightweight refining module is introduced after feature fusion: First, the four-level fusion features are... Local feature optimization is performed through 3×3 convolutional layers. The local receptive fields of these layers are used to perform neighborhood calibration on the fused features, correcting the pixel position shift caused by upsampling and eliminating the feature aliasing effect during the fusion process. At the same time, effective information is filtered through convolutional kernel weight learning, and background noise such as soil and weeds is suppressed, which enhances the expression of key local features such as cabbage leaf texture and veins. The 3×3 small convolutional kernel introduces only a small number of parameters while ensuring the optimization effect, which is in line with the lightweight design concept of SegFormer.
[0097] Subsequently, nearest neighbor upsampling was used to unify all feature maps to a scale of 128×128. Finally, the multi-scale features were concatenated along the channel dimension to obtain a global fusion feature with dimensions of 128×128×(256×4). This step optimizes local features and integrates global information through channel concatenation using 3×3 convolution, eliminating resolution differences between different levels of features while fully preserving the unique information of each level. Global semantic preservation of overall plant morphological information The middle layer structure retains information on the distribution of leaf clusters. The fine-grained structure preserves the outline information of individual blades. The microscopic details retain leaf texture and edge information, forming a full-dimensional feature expression of semantics, structure, and detail, further improving the completeness and accuracy of feature expression.
[0098] The decoder ultimately outputs a segmentation probability map of the same size as the input image. ,in The number of categories represents the probability that each pixel belongs to any of the categories.
[0099] Training is performed using a pixel-level cross-entropy loss function: in Total number of pixels For real labels, To predict probabilities.
[0100] The output image is the pixel-level segmentation result of each frame of the cabbage image, which can clearly show the boundary and outline region of a single cabbage plant, facilitating subsequent extraction of growth feature parameters and modeling analysis.
[0101] Furthermore, Figure 5 The flowchart of the prediction network that integrates image spatial semantics and time series dynamic modeling provided by this invention is shown. Figure 5 As shown, step 5 specifically involves constructing an end-to-end deep learning network that combines image spatial feature extraction and temporal modeling capabilities to achieve dynamic prediction of cabbage growth trends. The segmentation map sequence obtained in step 4 is input into the CNN-LSTM temporal prediction network. The spatial part uses a convolutional neural network to extract plant morphological features (crown shape), while the temporal part uses an LSTM model to capture the changing trends and evolutionary patterns of plant features over time.
[0102] Spatial feature extraction uses CNN to extract morphological features of cabbage, with the input being the feature map sequence from the segmentation results in step 4. .
[0103] Temporal modeling employs LSTM to capture the temporal dependencies of growth features. Let the spatial feature vector at each time step be... The LSTM recursive formula is: in, These are the input gate, forget gate, and output gate, respectively. In cellular state, In hidden state, These are the weights and bias parameters.
[0104] Output for the Future Growth parameter prediction vector at time step ,..., This includes predicting the bulb diameter and growth status: The training loss uses MSE: in, For the dimensions of the prediction parameters.
[0105] Furthermore, step 6 forms a cabbage crop growth dynamic prediction system, which displays the segmentation results of a single cabbage plant through an image visualization interface, and outputs multi-temporal growth prediction images for management personnel reference.
[0106] The crop growth prediction device provided by the present invention is described below. The crop growth prediction device described below can be referred to in correspondence with the crop growth prediction method described above.
[0107] Figure 6 This is a schematic diagram of the structure of the crop growth prediction device provided by the present invention, as shown below. Figure 6 As shown, the device includes the following modules: The acquisition module 600 is used to acquire the original image sequence of the target crop at different growth stages, preprocess the original image sequence to obtain input data; Extraction module 610 is used to input the input data into the Segformer encoder of the integrated channel and spatial attention mechanism CBAM module to extract multi-scale coded feature maps; The fusion module 620 is used to perform multi-level semantic fusion on multi-scale encoded feature maps through the Segformer decoder based on the lightweight feature pyramid L-FPN structure, and generate a semantic segmentation map sequence for characterizing crop morphological structure. The prediction module 630 is used to extract crop morphological spatial features from the semantic segmentation map sequence using a convolutional neural network, input the crop morphological spatial features into a long short-term memory network LSTM, and output the prediction result of the future growth status of the target crop.
[0108] According to the present invention, a crop growth prediction device performs multi-level semantic fusion on multi-scale encoded feature maps using a Segformer decoder based on an L-FPN structure to generate a semantic segmentation map sequence for characterizing crop morphological structure, including: Multi-scale encoded feature maps are unified by 1×1 convolution to obtain multi-level standardized feature maps; The highest-level standardized feature map is used as the initial fusion feature. For each level of standardized feature map other than the highest level, the fusion feature of the previous level and the standardized feature map of the current level are added pixel by pixel through nearest neighbor upsampling to obtain the fusion feature of the current level, until a multi-level fusion feature containing the lowest level information is generated. Based on multi-level fusion features, a sequence of semantic segmentation maps is generated to characterize the morphological structure of crops.
[0109] According to the present invention, a crop growth prediction device generates a semantic segmentation map sequence for characterizing crop morphological structure based on multi-level fusion features, including: The multi-level fused features are locally optimized through 3×3 convolutional layers to obtain multiple feature maps; Unify all feature maps to the same scale by upsampling the nearest neighbor; Multiple feature maps, after being unified to the same scale, are spliced along the channel dimension to form a globally fused feature. Based on global fusion features, a sequence of semantic segmentation maps is generated to characterize the morphological structure of crops.
[0110] According to the crop growth prediction device provided by the present invention, the original image sequence is preprocessed to obtain input data, including: An adaptive histogram equalization algorithm is used to process the original image sequence to improve the image contrast in low-light areas; and the processed image is converted from the RGB color space to the HSV color space. The excessively blurred or missing images in the original image sequence are removed, and the remaining image sequence is unified to a standard resolution format to obtain the input data.
[0111] According to the crop growth prediction device provided by the present invention, the CBAM module includes a channel attention unit and a spatial attention unit connected in series; The channel attention unit is used to perform global pooling on the input features to generate channel attention weights, and then multiply the channel attention weights with the input features channel by channel to obtain a channel-weighted feature map. The spatial attention unit is used to perform channel-dimensional pooling on the channel-weighted feature map to generate a spatial attention weight map. The spatial attention weight map is then multiplied pixel-by-pixel with the channel-weighted feature map to output the final encoded feature map.
[0112] According to the present invention, a crop growth prediction device extracts crop morphological spatial features from a semantic segmentation map sequence using a convolutional neural network, inputs the crop morphological spatial features into an LSTM, and outputs a prediction result of the future growth state of the target crop, including: By using a convolutional neural network to extract features from the semantic segmentation map sequence, a spatial feature vector sequence representing the crop crown shape and leaf distribution is generated. The spatial feature vector sequence is input into the LSTM to obtain the prediction results of the future growth status of the target crop; the prediction results of the future growth status include the crop canopy parameters and / or growth level at future time.
[0113] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 7 As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute a crop growth prediction method, which includes: Obtain the original image sequences of the target crop at different growth stages, preprocess the original image sequences to obtain the input data; The input data is fed into the Segformer encoder, which includes the channel and spatial attention mechanism CBAM module, to extract multi-scale encoded feature maps. By using the Segformer decoder based on the lightweight feature pyramid L-FPN structure, multi-level semantic fusion is performed on the multi-scale encoded feature maps to generate a semantic segmentation map sequence for characterizing crop morphological structure. The crop morphological spatial features are extracted from the semantic segmentation map sequence by a convolutional neural network, and then input into a long short-term memory network (LSTM) to output the prediction results of the future growth status of the target crop.
[0114] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0115] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is able to execute the crop growth prediction method provided by the above methods, the method comprising: Obtain the original image sequences of the target crop at different growth stages, preprocess the original image sequences to obtain the input data; The input data is fed into the Segformer encoder, which includes the channel and spatial attention mechanism CBAM module, to extract multi-scale encoded feature maps. By using the Segformer decoder based on the lightweight feature pyramid L-FPN structure, multi-level semantic fusion is performed on the multi-scale encoded feature maps to generate a semantic segmentation map sequence for characterizing crop morphological structure. The crop morphological spatial features are extracted from the semantic segmentation map sequence by a convolutional neural network, and then input into a long short-term memory network (LSTM) to output the prediction results of the future growth status of the target crop.
[0116] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the crop growth prediction methods provided by the methods described above, the method comprising: Obtain the original image sequences of the target crop at different growth stages, preprocess the original image sequences to obtain the input data; The input data is fed into the Segformer encoder, which includes the channel and spatial attention mechanism CBAM module, to extract multi-scale encoded feature maps. By using the Segformer decoder based on the lightweight feature pyramid L-FPN structure, multi-level semantic fusion is performed on the multi-scale encoded feature maps to generate a semantic segmentation map sequence for characterizing crop morphological structure. The crop morphological spatial features are extracted from the semantic segmentation map sequence by a convolutional neural network, and then input into a long short-term memory network (LSTM) to output the prediction results of the future growth status of the target crop.
[0117] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0118] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting crop growth, characterized in that, include: Obtain the original image sequence of the target crop at different growth stages, and preprocess the original image sequence to obtain input data; The input data is fed into a Segformer encoder that includes a channel and spatial attention mechanism CBAM module to extract multi-scale encoded feature maps. The Segformer decoder, based on the lightweight feature pyramid L-FPN structure, performs multi-level semantic fusion on the multi-scale encoded feature map to generate a semantic segmentation map sequence for characterizing crop morphological structure. The crop morphological spatial features in the semantic segmentation map sequence are extracted by a convolutional neural network, and the crop morphological spatial features are input into a long short-term memory network LSTM to output the prediction result of the future growth status of the target crop. The step involves performing multi-level semantic fusion on the multi-scale encoded feature maps using a Segformer decoder based on an L-FPN structure to generate a semantic segmentation map sequence for characterizing crop morphological structure, including: The multi-scale encoded feature map is unified by a 1×1 convolution to obtain a multi-level standardized feature map; The highest-level standardized feature map is used as the initial fusion feature. For each level of standardized feature map other than the highest level, the fusion feature of the previous level and the standardized feature map of the current level are added pixel by pixel through nearest neighbor upsampling to obtain the fusion feature of the current level, until a multi-level fusion feature containing the lowest level information is generated. Based on the multi-level fusion features, a semantic segmentation map sequence is generated to characterize the morphological structure of crops.
2. The crop growth prediction method according to claim 1, characterized in that, The step of generating a semantic segmentation map sequence for characterizing crop morphological structure based on the multi-level fusion features includes: The multi-level fused features are each optimized locally through a 3×3 convolutional layer to obtain multiple feature maps; Unify all feature maps to the same scale by upsampling the nearest neighbor; Multiple feature maps, after being unified to the same scale, are spliced along the channel dimension to form a globally fused feature. Based on the global fusion features, a semantic segmentation map sequence is generated to characterize the morphological structure of crops.
3. The crop growth prediction method according to claim 1, characterized in that, The preprocessing of the original image sequence to obtain input data includes: An adaptive histogram equalization algorithm is used to process the original image sequence to improve the image contrast in low-light areas; and the processed image is converted from the RGB color space to the HSV color space. The excessively blurred or missing images in the original image sequence are removed, and the remaining image sequence is unified to a standard resolution format to obtain the input data.
4. The crop growth prediction method according to claim 1, characterized in that, The CBAM module includes a channel attention unit and a spatial attention unit connected in series. The channel attention unit is used to perform global pooling on the input features to generate channel attention weights, and then multiply the channel attention weights with the input features channel by channel to obtain a channel-weighted feature map. The spatial attention unit is used to perform channel-dimensional pooling on the channel-weighted feature map to generate a spatial attention weight map, and then multiply the spatial attention weight map with the channel-weighted feature map pixel by pixel to output the final encoded feature map.
5. The crop growth prediction method according to claim 1, characterized in that, The step of extracting crop morphological spatial features from the semantic segmentation map sequence using a convolutional neural network, inputting the crop morphological spatial features into an LSTM, and outputting a prediction result of the future growth state of the target crop includes: The semantic segmentation map sequence is used to extract features by a convolutional neural network to generate a spatial feature vector sequence that represents the shape of the crop crown and the distribution of leaves. The spatial feature vector sequence is input into an LSTM to obtain the prediction result of the future growth status of the target crop; the prediction result of the future growth status includes the crop canopy width parameter and / or growth level at future time.
6. A crop growth prediction device, characterized in that, include: The acquisition module is used to acquire the original image sequence of the target crop at different growth stages, and to preprocess the original image sequence to obtain input data; The extraction module is used to input the input data into the Segformer encoder of the integrated channel and spatial attention mechanism CBAM module to extract multi-scale coded feature maps; The fusion module is used to perform multi-level semantic fusion on the multi-scale encoded feature map through the Segformer decoder based on the lightweight feature pyramid L-FPN structure, and generate a semantic segmentation map sequence for characterizing crop morphological structure. The prediction module is used to extract crop morphological spatial features from the semantic segmentation map sequence using a convolutional neural network, input the crop morphological spatial features into a long short-term memory network (LSTM), and output the prediction result of the future growth state of the target crop. The step involves performing multi-level semantic fusion on the multi-scale encoded feature maps using a Segformer decoder based on an L-FPN structure to generate a semantic segmentation map sequence for characterizing crop morphological structure, including: The multi-scale encoded feature map is unified by a 1×1 convolution to obtain a multi-level standardized feature map; The highest-level standardized feature map is used as the initial fusion feature. For each level of standardized feature map other than the highest level, the fusion feature of the previous level and the standardized feature map of the current level are added pixel by pixel through nearest neighbor upsampling to obtain the fusion feature of the current level, until a multi-level fusion feature containing the lowest level information is generated. Based on the multi-level fusion features, a semantic segmentation map sequence is generated to characterize the morphological structure of crops.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the crop growth prediction method as described in any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the crop growth prediction method as described in any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the crop growth prediction method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
SegFormer optimization-based rice particle and impurity segmentation method
CN118762174A
Farmland forest network extraction method and system based on SegFormer model
CN120411776A