Single-head garlic planting specification recommendation method and device based on crop growth process recognition

CN122656793APending Publication Date: 2026-08-28CHINA AGRI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510227324.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

[0004]本发明提供一种基于作物生长过程识别的独头蒜种植规范推荐方法及装置,用以解决现有技术中根据独头蒜的生长周期结合专家经验结合提供独头蒜在当前生长周期的独头蒜种植规范数据时,受独头蒜在不同种植环境下生长状态不同以及专家经验容易出错的影响,导致独头蒜种植规范推荐结果准确率低的缺陷,提高了独头蒜种植规范推荐结果准确率

Benefits of technology

[0015]The present invention provides a method and apparatus for recommending planting standards for single-clove garlic based on crop growth process identification. This method processes the image of the single-clove garlic to be identified using a growth stage classification model determined by the Swin Transformer module, the Spatial Path Attention and Residual Transform Aggregation SPARTA module or the FreqFusion module, obtaining a growth stage classification result. Then, it processes the image using a leaf detection model determined by the YOLO architecture, LSKA attention mechanism, shallow detail fusion module, and attention mechanism-based Head module, obtaining a leaf detection result. Finally, it uses a planting standard recommendation model to predict the recommended planting standards for single-clove garlic based on the growth stage classification result, the leaf detection result, and various planting factors. This effectively improves the detection accuracy of the model under diverse leaf numbers and growth states, increases the accuracy of the recommended planting standards for single-clove garlic, and achieves multi-dimensional environmental perception and precise agricultural operation suggestions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122656793A_ABST
    Figure CN122656793A_ABST
Patent Text Reader

Abstract

The application provides a single-head garlic planting specification recommendation method and device based on crop growth process recognition, which comprises the following steps: processing a to-be-recognized single-head garlic image based on a growth period classification model to obtain a growth period classification result; processing the to-be-recognized single-head garlic image based on a leaf detection model to obtain a leaf detection result; processing the growth period classification result and the leaf detection result based on a planting specification recommendation model constructed by taking a sample growth period classification result and a sample leaf detection result as input and a sample planting specification recommendation result determined based on a mapping relationship between a plurality of sample growth period classification results, a plurality of sample leaf detection results and a plurality of planting factors as output to obtain a target planting specification recommendation result. The method provided by the application effectively improves the detection accuracy of the model under diversified leaf quantity and growth state, and improves the accuracy of the single-head garlic planting specification recommendation result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method and apparatus for recommending planting standards for single-clove garlic based on crop growth process identification. Background Technology

[0002] Currently, agricultural producers mainly rely on visual observation and personal experience to determine when to perform agricultural operations such as fertilization, watering, and weeding, as well as the specific types and amounts of fertilizers or pesticides to apply. This approach lacks scientific basis and precise data support, easily leading to resource waste, low production efficiency, and improper crop management. Improper agricultural practices and incorrect use of fertilizers and pesticides will result in reduced yields and quality of single-clove garlic, increased costs for disease and pest control, and ultimately, economic losses.

[0003] In related technologies, existing technologies use relevant detection models to detect the growth cycle of crops and combine expert experience to provide planting specifications for single-clove garlic suitable for the current growth cycle. In reality, single-clove garlic exhibits significant differences in growth status under different planting environments. For example, the leaves of the plants overlap and have different shapes. This leads to inaccurate planting specifications for single-clove garlic derived from expert experience based on the crop growth cycle. In addition, expert experience has a certain degree of subjectivity. When the scale of single-clove garlic planting data to be recommended is large, the recommendations obtained from expert experience are prone to errors, resulting in low accuracy of the recommended planting specifications for single-clove garlic, which in turn affects the planting and management of single-clove garlic. Summary of the Invention

[0004] This invention provides a method and apparatus for recommending planting standards for single-clove garlic based on crop growth process identification. This addresses the shortcomings of existing technologies that, when providing planting standard data for single-clove garlic at the current growth stage based on the growth cycle of single-clove garlic combined with expert experience, suffer from low accuracy due to the varying growth status of single-clove garlic under different planting environments and the susceptibility of errors in expert experience. This invention improves the accuracy of the recommended planting standards for single-clove garlic.

[0005] This invention provides a method for recommending planting standards for single-clove garlic based on crop growth process identification, including: The image of the single-clove garlic to be identified is processed based on the growth stage classification model to obtain the growth stage classification result; the image of the single-clove garlic to be identified is processed based on the leaf detection model to obtain the leaf detection result; wherein, the growth stage classification model is determined based on the Swing Transformer module, the Spatial Path Attention and Residual Transform Aggregation SPARTA module or the FreqFusion module; the leaf detection model is determined based on at least one of the Largely Separable Kernel Attention LSKA mechanism and the Shallow Details Fusion module, the YOLO architecture and the Head module based on the attention mechanism; The target planting standard recommendation result is obtained by processing the growth period classification result and the leaf detection result based on the planting standard recommendation model. The planting standard recommendation model is obtained by constructing a mathematical model with the sample growth period classification result and the sample leaf detection result as input and the sample planting standard recommendation result as output. The sample planting standard recommendation result is determined based on the mapping relationship between multiple sample growth period classification results, multiple sample leaf detection results and multiple planting factors. The multiple planting factors include at least one of soil moisture, air temperature, wind force and weather forecast information.

[0006] According to the present invention, a method for recommending planting standards for single-clove garlic based on crop growth process identification is provided, wherein the growth period classification model includes the Swin Transformer module, and the Swin Transformer module includes multiple Swin Transformer blocks; The growth period classification model is obtained through the following steps: The images of single-clove garlic at different growth stages are divided into blocks, and the features of the block images are embedded through a linear layer to obtain the initial feature representation; For each Swing Transformer block, the initial feature representation is processed by alternating local window self-attention and sliding window self-attention operations to obtain local features and cross-window features. Patch Merging pooling operation is then performed on the local features and the cross-window features to obtain the first multi-scale semantic features. The target classification model is iteratively trained using the first multi-scale semantic features as input features to obtain the growth-stage classification model.

[0007] According to the present invention, a method for recommending single-clove garlic planting specifications based on crop growth process identification is provided, wherein the Swin Transformer module includes multiple Swin Transformer blocks and a SPARTA module; The growth period classification model is also obtained through the following steps: For each Swing Transformer block, the local features and the cross-window features are obtained through the Swing Transformer block based on the initial feature representation; The SPARTA module employs a spatial path attention mechanism to process the local features and the cross-window features, resulting in new local features and new cross-window features. Patch Merging pooling is performed on the local features and the cross-window features to obtain the second multi-scale semantic features; The target classification model is iteratively trained using the second multi-scale semantic features as input features to obtain the growth-stage classification model.

[0008] According to the method for recommending planting standards for single-clove garlic based on crop growth process identification provided by the present invention, the growth period classification model further includes the FreqFusion module; After obtaining the second multi-scale semantic features, the method further includes: Based on the FreqFusion module, the second multi-scale semantic features are decomposed and reconstructed using a frequency domain transformation combined with a feature selection mechanism to obtain fourth-scale semantic features, thereby enabling iterative training of the target classification model.

[0009] According to the present invention, a method for recommending single-clove garlic planting standards based on crop growth process identification is provided. The leaf detection model includes a YOLOv11 architecture and a Head module based on the attention mechanism. The YOLOv11 architecture includes a spatial pyramid pooling SPPF structure determined based on the LSKA mechanism. The blade detection model is obtained through the following steps: The YOLOv11 architecture backbone network is used to perform convolution calculations on the sample single-clove garlic leaf images to obtain multi-scale feature maps. Multi-scale images are fused using an SPPF structure based on the LSKA attention mechanism to obtain fused features; The target detection model is iteratively trained using the fused features as input features. The model loss is calculated by dynamic convolution through the attention-based Head module. The blade detection model is obtained when the model loss is lower than the loss threshold or when the model reaches the maximum number of iterations.

[0010] According to the present invention, a method for recommending single-clove garlic planting specifications based on crop growth process identification is provided. The YOLOv11 architecture further includes a shallow detail fusion module; the SPPF structure based on the LSKA mechanism, the shallow detail fusion module, and the head module based on the attention mechanism are connected in sequence. After obtaining the fusion features, the method further includes; The shallow detail fusion module collects contextual information from different receptive fields corresponding to the fusion feature from multiple branches, and then fuses the contextual information from the different receptive fields to obtain a new fusion feature.

[0011] This invention also provides a single-clove garlic planting standard recommendation system based on crop growth process identification, comprising: The image classification and detection module is used to process the image of the single-clove garlic to be identified based on the growth stage classification model to obtain the growth stage classification result; and to process the image of the single-clove garlic to be identified based on the leaf detection model to obtain the leaf detection result. The growth stage classification model is determined based on the Swing Transformer module, the Spatial Path Attention and Residual Transform Aggregation (SPARTA) module, or the FreqFusion module. The leaf detection model is determined based on at least one of the Largely Separable Kernel Attention (LSKA) mechanism and the Shallow Details Fusion module, the YOLO architecture, and the Head module based on the attention mechanism. The recommendation module is used to process the growth period classification results and the leaf detection results based on the planting standard recommendation model to obtain the target planting standard recommendation result. The planting standard recommendation model is obtained by constructing a mathematical model with the sample growth period classification results and sample leaf detection results as inputs and the sample planting standard recommendation result as the output. The sample planting standard recommendation result is determined based on the mapping relationship between at least one of multiple sample growth period classification results and multiple sample leaf detection results and multiple planting factors. The multiple planting factors include at least one of soil moisture, air temperature, wind force, and weather forecast information.

[0012] 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 single-clove garlic planting standard recommendation method based on crop growth process identification as described above.

[0013] 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 method for recommending single-clove garlic planting specifications based on crop growth process identification as described above.

[0014] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the single-clove garlic planting standard recommendation method based on crop growth process identification as described above.

[0015] The present invention provides a method and apparatus for recommending planting standards for single-clove garlic based on crop growth process identification. This method processes the image of the single-clove garlic to be identified using a growth stage classification model determined by the Swin Transformer module, the Spatial Path Attention and Residual Transform Aggregation SPARTA module or the FreqFusion module, obtaining a growth stage classification result. Then, it processes the image using a leaf detection model determined by the YOLO architecture, LSKA attention mechanism, shallow detail fusion module, and attention mechanism-based Head module, obtaining a leaf detection result. Finally, it uses a planting standard recommendation model to predict the recommended planting standards for single-clove garlic based on the growth stage classification result, the leaf detection result, and various planting factors. This effectively improves the detection accuracy of the model under diverse leaf numbers and growth states, increases the accuracy of the recommended planting standards for single-clove garlic, and achieves multi-dimensional environmental perception and precise agricultural operation suggestions. Attached Figure Description

[0016] 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.

[0017] Figure 1 This is one of the flowcharts of the method for recommending single-clove garlic planting standards based on crop growth process identification provided by the present invention.

[0018] Figure 2 This is a schematic diagram of the structure of the Swing Transformer module provided by the present invention.

[0019] Figure 3 This is a schematic diagram of the SPARTA module provided by the present invention.

[0020] Figure 4 This is a schematic diagram of the FreqFusion module provided by the present invention.

[0021] Figure 5 This is a schematic diagram of the SPPF structure based on the LSKA mechanism provided by the present invention.

[0022] Figure 6 This is a schematic diagram of the structure of the Head module based on the attention mechanism provided by the present invention.

[0023] Figure 7 This is a schematic diagram of the SDFM module provided by the present invention.

[0024] Figure 8This is the second flowchart illustrating the method for recommending planting standards for single-clove garlic based on crop growth process identification provided by this invention.

[0025] Figure 9 This is a schematic diagram of the device for recommending single-clove garlic planting standards based on crop growth process identification provided by the present invention.

[0026] Figure 10 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0027] 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.

[0028] The following is combined Figures 1-8 This invention describes the method and apparatus for recommending single-clove garlic planting standards based on crop growth process identification.

[0029] Figure 1 This is one of the flowcharts illustrating the method for recommending planting standards for single-clove garlic based on crop growth process identification provided by this invention. Figure 1 As shown, the method includes the following steps: Step 110: Process the image of the single-clove garlic to be identified based on the growth period classification model to obtain the growth period classification result; process the image of the single-clove garlic to be identified based on the leaf detection model to obtain the leaf detection result; wherein, the growth period classification model is determined based on the Swin Transformer module, the Spatial Path Attention and Residual Transform Aggregation SPARTA module or the FreqFusion module; the leaf detection model is determined based on at least one of the Large Separable Kernel Attention LSKA mechanism and the Shallow Details Fusion module, the YOLO architecture and the Head module based on the attention mechanism.

[0030] In this step, the image of the single-clove garlic to be identified can be obtained from a single-clove garlic image database or captured in real time.

[0031] In this step, the basic architecture of the growth-stage classification model can be trained based on the Swin Transformer module, or it can be determined by multiple cascaded Swin Transformer blocks and a SPARTA (PARTA (Spatial Path Attention and Residual Transformer Aggregation) module), or it can be determined by the Swin Transformer module (including the Swin Transformer block and the SPARTA module) and the FreqFusion module.

[0032] In this embodiment, the growth period of single-clove garlic is divided into three categories: seedling stage, differentiation stage, and expansion stage. In the classification process of single-clove garlic growth period, the growth period classification model in this embodiment is based on the Swing Transformer model. By introducing the SPARTA module, the ability to extract and process high-level features is improved. Combined with the FreqFusion module, multiple feature maps output by the backbone network of the model are fused at multiple levels, which effectively strengthens the model's ability to model global key features.

[0033] In this step, the basic architecture of the leaf detection model can be determined by the YOLO architecture (e.g., the YOLOv11 network), the spatial pyramid pooling SPPF structure based on the large separable kernel attention LSKA mechanism, and the head module based on the attention mechanism; or it can be determined by the spatial pyramid pooling SPPF structure based on the LSKA mechanism, the shallow detail fusion module, and the head module based on the attention mechanism.

[0034] In this embodiment, the leaf types of single-clove garlic include those with one stamen and multiple leaves, such as 7 leaves and 1 stamen, 6 leaves and 1 stamen, 8 leaves, or 0 leaves and 1 stamen. The leaf detection model in this embodiment is based on the YOLOv11 model and improved through experiments. First, the LSKA attention mechanism is introduced to optimize the SPPF module in the backbone, enhancing the ability to express multi-scale features. Then, the shallow detail fusion module (SDFM) of PSFusion is introduced at the neck tail to effectively fuse shallow and deep features and improve detection accuracy. Finally, the DyHead target detection module based on the attention mechanism is added to the head part to improve the detection performance and robustness of the model.

[0035] Step 120: Process the growth period classification results and leaf detection results based on the planting standard recommendation model to obtain the target planting standard recommendation results; wherein, the planting standard recommendation model is obtained by constructing a mathematical model with the sample growth period classification results and sample leaf detection results as input and the sample planting standard recommendation results as output; the sample planting standard recommendation results are determined based on the mapping relationship between multiple sample growth period classification results, multiple sample leaf detection results and multiple planting factors; multiple planting factors include at least one of soil moisture, air temperature, wind force and weather forecast information.

[0036] In this step, the weather forecast information includes the precipitation amount for the target area in the coming days, for example, the rainfall amount for the area in the next three days.

[0037] In this embodiment, an environmental perception-based decision support method is adopted: based on the growth period classification results output by the growth period classification model and the leaf detection results output by the leaf detection model, combined with environmental data collected in real time by IoT devices such as soil stations and weather stations (including but not limited to key indicators such as weather conditions, soil temperature, soil moisture, wind force and rainfall in the next three days), a rule-based planting standard recommendation method is constructed.

[0038] In this embodiment, multi-dimensional decision rules are set according to different growth stages and environmental conditions. Logical reasoning is used to generate precise agricultural operation suggestions, such as fertilization, watering, and pest and disease control, suitable for the current growth stage and planting environment. The specific settings are as follows: (1) Environmental data (corresponding to various planting factors) are collected by the Internet of Things devices of meteorological station and soil station; key data in the planting environment include but are not limited to multi-source data such as weather, temperature, soil moisture, wind and rainfall. After preprocessing, these multi-source data are used to analyze the impact of different environmental factors on the growth stages of single garlic, so as to determine the range of suitable environmental conditions.

[0039] (2) Determine the mapping relationship between plant growth period, leaf type, multiple planting factors and relevant agricultural operation rules (corresponding to the recommended content of planting specifications); for example, by deeply mining historical planting data and communicating with professional agricultural technicians, the correlation pattern between key environmental variables and planting management measures can be identified, providing data support for the formulation and optimization of rules; the data analysis process not only helps to build an efficient rule base, but also provides a basis for further intelligent planting strategies.

[0040] In this embodiment, the rule base is established by performing correlation analysis on growth period, environmental data, and agricultural operation requirements to set specific management rules for dynamically recommending suitable planting specifications. The main fields in the rule base include growth period, number of plant leaves, soil moisture, temperature, wind force, weather conditions, and rainfall in the next three days. These fields serve as the basis for rule triggering conditions and provide a basis for recommending agricultural operations such as fertilization, watering, and pest and disease control.

[0041] Specifically, the rule base can be built using the following settings: (1) Field settings; key fields include growth period (provided by growth period classification results), number of plant leaves (provided by leaf detection results), soil moisture, temperature, wind force and weather forecast information; the mapping relationship between each field and the corresponding planting specification recommendation results is set as follows: 1) Growth period: The growth process of single-clove garlic is divided into multiple stages (seedling stage, differentiation stage and expansion stage), and corresponding agricultural operation rules are designed for the different needs of each stage.

[0042] 2) Number of plant leaves: The number of plant leaves is obtained through image detection technology, and the growth status of the plant is judged in combination with the growth period to further optimize planting suggestions.

[0043] 3) Soil Moisture: Soil moisture is set in three ranges: below 40% (drought), 40%-70% (suitable), and above 70% (overly wet). Different ranges trigger different irrigation suggestions: When soil moisture is below 40%, the system suggests immediate irrigation to prevent drought from affecting plant growth; when soil moisture is between 40% and 70%, the system indicates that soil moisture is suitable and irrigation is not necessary; when soil moisture is above 70%, the system suggests stopping irrigation and reminds the user to pay attention to drainage to avoid root waterlogging.

[0044] 4) Temperature settings; Temperature rules include: Below 5℃: The system prompts to take cold protection measures, such as covering with mulch or using a cold protection shed; Above or equal to 5℃: The system determines whether further operation is needed based on other environmental parameters, and no special cold protection treatment is required.

[0045] 5) Wind setting: When the wind force is below level 3, the system prompts that it is appropriate to carry out routine agricultural operations; when the wind force is greater than or equal to level 3, the system prompts to suspend operations such as spraying to prevent pesticide loss, and to take wind protection measures if necessary.

[0046] 6) Weather conditions settings: Weather conditions include two states: "rain" and "no rain". If there is no rain, determine whether to carry out irrigation operations based on other parameters. If there is rain, determine whether to carry out watering, pesticide application or other agricultural operations based on other parameters such as wind force, soil moisture, and rainfall in the next three days.

[0047] 7) Setting the rainfall forecast for the next three days; when the rainfall forecast for the next three days is less than 10mm, the system will prompt the grower to carry out irrigation and fertilization operations as normal; when the rainfall forecast for the next three days is greater than or equal to 10mm, the system will suggest reducing or suspending irrigation and prompt the user to fertilize in advance or take drainage measures to cope with possible continuous rainfall.

[0048] In this embodiment, a rule base is constructed by refining the above fields and setting logical rules, and appropriate planting and management suggestions are dynamically given under different growth stages and environmental conditions of single-clove garlic based on the input information of the planting specification recommendation model.

[0049] For example, during the seedling stage, when the plant has two leaves, if the soil moisture is below 40%, the temperature is above 5℃, and the cumulative rainfall over the next three days is less than 10mm, the system will recommend that the user irrigate as soon as possible. Similarly, during the seedling stage, when the plant has five leaves, if the daytime wind force is below level 3 today, the weather is rainy today, and the daytime wind force is below level 3 tomorrow with no rain tomorrow, the system will suggest carrying out the first stage of pest and disease control operations tomorrow, controlling garlic leaf spot, blight, thrips, and controlling garlic stem borers (dosage per acre). Control Drug Program 1: 100-150g / mu of 65% zineb powder + 150-200ml / mu of 4.9% high-chloride abamectin microemulsion (Jinma) + 50-60ml / mu of dry leaf balance, diluted with 45kg of water for foliar spraying; Control Drug Remedy 2: 40% difenoconazole suspension 10-15 ml / mu + 22% spirodiclofen suspension 30-45 ml / mu + Butanezoa 90-120 ml / mu, diluted with 45 kg of water for foliar spraying; In this embodiment, the planting specification recommendation model ensures that the planting specifications recommended by the system can dynamically adapt to environmental changes by setting a rule base, and at the same time provides scientific and reasonable planting management solutions in combination with agricultural operation needs, thus providing strong support for the intelligent management of single-clove garlic planting.

[0050] This invention provides a method for recommending planting guidelines for single-clove garlic based on crop growth process identification. The method processes the single-clove garlic image to be identified using a growth stage classification model determined by the Swin Transformer module, the Spatial Path Attention and Residual Transform Aggregation SPARTA module, or the FreqFusion module. This yields a growth stage classification result. The image is then processed using a leaf detection model determined by the YOLO architecture, the LSKA attention mechanism, the Shallow Details Fusion module, or the Head module based on an attention mechanism. This yields a leaf detection result. Finally, a planting guidelines recommendation model is used to predict the recommended planting guidelines for single-clove garlic based on the growth stage classification result, the leaf detection result, and various planting factors. This effectively improves the model's detection accuracy under diverse leaf numbers and growth states, increases the accuracy of the recommended planting guidelines, and achieves multi-dimensional environmental perception and precise agricultural operation suggestions.

[0051] In some embodiments, the growth phase classification model includes a Swin Transformer module, which includes multiple Swin Transformer blocks; the growth phase classification model is obtained through the following steps: The images of single-clove garlic at different growth stages are divided into blocks, and the features of the block images are embedded through a linear layer to obtain the initial feature representation; For each Swing Transformer block, the initial feature representation is processed by alternating operations of local window self-attention and sliding window self-attention to obtain local features and cross-window features. Patch Merging pooling operation is then performed on the local features and cross-window features to obtain the first multi-scale semantic features. The target classification model is iteratively trained using the first multi-scale semantic features as input features to obtain the growth-stage classification model.

[0052] Figure 2 This is a schematic diagram of the structure of the Swing Transformer module provided by the present invention. Figure 2 In the illustrated embodiment, the Swin Transformer module includes four Swin Transformer blocks (corresponding to Swin TransformerBlocks); firstly, the input image (corresponding to a size of H×W×3) is divided into blocks and flattened using the Patch Partition unit of the Swin Transformer module; in the first stage (Stage 1), the block-shaped image (corresponding to a size of H×W×3) is flattened using a linear layer (LinearEmbedding module). × The initial feature representation is obtained by embedding features (×48). The first-stage Swing Transformer Block consists of two blocks, which are used to alternately perform local window self-attention and sliding window self-attention operations on the initial features. The size of the output feature map in the first stage is... × ×C (C is the number of channels); the second stage (Stage 2) of the Swing Transformer Block consists of 2 blocks, and the size of the output feature map of the second stage is... × ×2C; The third stage (Stage 3) of the Swin Transformer Block consists of 6 blocks, and the size of the output feature map of the third stage is [size missing]. × ×4C; The fourth stage (Stage 4) of the Swin Transformer Block consists of two blocks, and the size of the output feature map of the fourth stage is [size missing]. × ×8C.

[0053] In this embodiment, the entire network adopts a hierarchical structure, with the Swin Transformer module comprising four stages (Stages 1-4), each consisting of a Swin Transformer Block. Within each stage, local and cross-window features are captured through alternating operations of Window-based Multi-head Self-Attention (W-MSA) and Shifted Window MSA (SW-MSA). Simultaneously, at the end of each stage, a Patch Merging operation is used to downsample the feature map, merging adjacent blocks into a new block to reduce the feature map resolution and increase the number of channels, thereby progressively extracting deeper multi-scale semantic features. Finally, the backbone network outputs a feature map containing rich multi-scale information, which can be used for subsequent classification, object detection, or segmentation tasks, ensuring good accuracy and robustness when handling targets of different sizes and complex backgrounds.

[0054] In this embodiment, the first multi-scale semantic features are extracted from the input sample single-clove garlic image by the Swin Transformer module, and the network loss is calculated based on the first multi-scale semantic features by a preset loss function. When the network loss is lower than the preset loss threshold, or when the network training times reach the maximum, the trained growth-stage classification model is obtained.

[0055] This invention provides a method for recommending planting standards for single-clove garlic based on crop growth process identification. The method involves segmenting sample images of single-clove garlic at different growth stages into blocks, embedding features into the segmented images using a linear layer, and then processing the initial feature representation for each Swing Transformer block using alternating local window self-attention and sliding window self-attention operations to obtain local and cross-window features. Patch Merging pooling is then performed on the local and cross-window features to obtain the first multi-scale semantic features. Finally, the first multi-scale semantic features are used as input features to iteratively train the target classification model, resulting in a growth stage classification model. This method can extract deeper multi-scale semantic features from sample single-clove garlic images, improving feature representation capabilities and thus enhancing the classification accuracy of the growth stage classification model.

[0056] In some embodiments, the Swin Transformer module includes multiple Swin Transformer blocks and a SPARTA module; the growth-stage classification model is also obtained through the following steps: For each Swing Transformer block, local features and cross-window features are obtained based on the initial feature representation. The SPARTA module employs a spatial path attention mechanism to process local and cross-window features, resulting in new local and cross-window features. Patch Merging pooling is performed on local features and cross-window features to obtain second multi-scale semantic features. The target classification model is iteratively trained using the second multi-scale semantic features as input features to obtain the growth-stage classification model.

[0057] In this embodiment, the Swin Transformer module includes three Swin Transformer blocks (corresponding to Swin Transformer Blocks), which are used to perform local window self-attention operations and sliding window self-attention operations on the corresponding features of the input image in the first three stages (Stage 1-3); and in the fourth stage, a new Swin Transformer module is obtained by using the Swin Transformer Block in the fourth stage (Stage 4) of the PARTA module.

[0058] In this embodiment, the SPARTA module captures long-distance dependencies by combining spatial path attention and residual transformation mechanisms, enhancing the growth-stage classification model's ability to model global features and compensating for the limitation of sliding window self-attention to local scope. It should be noted that the residual transformation and aggregation strategy of the SPARTA module can efficiently fuse information between feature maps of different scales, thereby improving the growth-stage classification model's adaptability to multi-scale targets. Thus, the growth-stage classification model can perform more accurately when dealing with complex backgrounds and targets with diverse shapes.

[0059] In this embodiment, by replacing the SPARTA module with the SPARTA module in Stage 4 of the new Swin Transformer module, the model is comprehensively enhanced in terms of global information perception and detailed feature extraction, improving the classification accuracy of single-clove garlic plants at different growth stages. Simultaneously, SPARTA also offers advantages in computational efficiency. Through an optimized attention mechanism and lightweight design, it effectively reduces computational overhead while improving performance, resulting in an improved model that is not only more accurate but also faster inference, making it more suitable for rapid classification and decision-making tasks in real-world applications. Ultimately, this replacement strategy provides more reliable technical support for the accurate classification and intelligent management of single-clove garlic plants during their growth stages.

[0060] Figure 3 This is a schematic diagram of the SPARTA module provided by the present invention. Figure 3 In the illustrated embodiment, based on the image information and the problem description, the structural diagram of the PARTA module in the new Swin Transformer module includes the following sub-modules: (1) Transformer Block (N×, indicating N identical Transformer Blocks) is used to capture long-range dependencies in sequence data; (2) SparseToken Converter is used for sparsification processing, converting dense tokens into sparse tokens. It is used for token conversion at different stages to reduce the amount of computation. (3) Linear Block (linear transformation layer), used to perform linear mapping on features; (4) Convolutional Block, used to extract local features; (5) MLP (Multi-Layer Perceptron, normalized layer), used to accelerate training and stabilize the model; (6) MSA (Multi-Head Self-Attention) is used to capture feature relationships in different subspaces. The above sub-modules together constitute the PARTA module. Through the collaboration of components such as sparsification, Transformer module, convolution operation and multilayer perceptron, effective feature extraction and sequence modeling are achieved.

[0061] The proposed method for recommending single-clove garlic planting standards based on crop growth process identification in this invention provides a method that uses a Swing Transformer module comprising multiple Swing Transformer blocks and a SPARTA module. The multiple Swing Transformer blocks acquire local and cross-window features based on an initial feature representation. The SPARTA module then processes these local and cross-window features using a spatial path attention mechanism to obtain new local and cross-window features, followed by Patch Merging pooling to obtain second multi-scale semantic features. Finally, the second multi-scale semantic features are used as input features to obtain a growth stage classification model. The residual transformation and aggregation strategies of the SPARTA module enable efficient information fusion between feature maps of different scales, further improving the adaptability and classification accuracy of the growth stage classification model to multi-scale targets.

[0062] In some embodiments, the growth period classification model further includes a FreqFusion module; after obtaining the second multi-scale semantic features, the method for recommending single-clove garlic planting specifications based on crop growth process identification also includes: The FreqFusion module employs frequency domain transformation combined with feature selection mechanism to decompose and reconstruct the second multi-scale semantic features, thereby obtaining the fourth-scale semantic features, in order to achieve iterative training of the target classification model.

[0063] In this embodiment, the FreqFusion module can improve the model's ability to extract and express multi-frequency features by decomposing and reconstructing information of different frequencies. Specifically, the FreqFusion module can capture high-frequency detail features (such as edges and textures) and low-frequency global features (such as contours and backgrounds) in images, thereby enhancing the model's performance when dealing with complex and diverse targets.

[0064] In this embodiment, the FreqFusion module uses a frequency domain transformation combined with a feature selection mechanism to adaptively allocate weights to high and low frequency information, making the model more flexible and accurate in dealing with targets of different scales and morphological changes.

[0065] In this embodiment, after introducing the FreqFusion module into the original model, multi-level feature fusion of the four feature maps output by the backbone network can improve the global perception and detail capture capabilities of the growth-stage classification model, and improve the problem of insufficient information expression of different frequency features in multi-level feature maps.

[0066] Figure 4 This is a structural schematic diagram of the FreqFusion module provided by the present invention. Figure 4 In the illustrated embodiment, the FreqFusion module includes the following sub-modules: (1) Conv (Conv Layer), used to extract and transform features from the input image through convolution operations, thereby enhancing the expressive power of the features; (2) ALPF Generator (Adaptive Low-Pass Filter Generator) is used to generate an adaptive low-pass filter to remove high-frequency noise from the initial feature representation.

[0067] (3) Pixel Shuffle: This operation rearranges the feature map, mapping high-dimensional features to a low-dimensional pixel space.

[0068] (4) Pixel UnShuffle (pixel reorganization inverse operation): rearranges the feature map to map low-dimensional features to high-dimensional pixel space.

[0069] (5) Initial Fusion is used to initially fuse feature maps from different sources to provide comprehensive features for subsequent processing.

[0070] (6) Offset Generator is used to generate pixel offsets for pixel-level offset operations in order to better align features.

[0071] (7) AHPF Generator (Adaptive High-Pass Filter Generator) is used to generate an adaptive high-pass filter to extract high-frequency information from the feature map.

[0072] (8) Resamp (re-sampling process) is used to resample the feature map, adjust its size and resolution for subsequent processing or fusion.

[0073] (9) Pixel-wise add + Convolve (pixel-level addition and convolution operation) is used to perform pixel-level addition operations on the feature map and further fuse the features through convolution to obtain the final output. The above sub-modules work together to extract and fuse features at multiple scales to process and synthesize the low-frequency and high-frequency components of the image features separately, thereby outputting the enhanced image features, namely the fourth-scale semantic features. The target classification model is then iteratively trained with the fourth-scale semantic features to obtain the corresponding growth-stage classification model.

[0074] The single-clove garlic planting standard recommendation method based on crop growth process identification provided in this invention enhances the robustness of the growth period classification model under complex backgrounds, subtle features, and multi-scale targets by introducing the FreqFusion module into the native long-term classification model. It also further improves the accuracy of single-clove garlic plant growth period classification, enabling it to have higher recognition ability when facing different morphological features during the growth period, while ensuring the efficiency of the model, making it suitable for rapid identification and decision-making in actual agricultural scenarios.

[0075] In some embodiments, the blade detection model includes a YOLOv11 architecture and an attention-based Head module. The YOLOv11 architecture includes a spatial pyramid pooling SPPF structure determined based on the LSKA mechanism. The blade detection model is obtained through the following steps: The YOLOv11 backbone network is used to perform convolution calculations on the sample single-clove garlic leaf images to obtain multi-scale feature maps. Multi-scale images are fused using an SPPF structure based on the LSKA attention mechanism to obtain fused features; The target detection model is iteratively trained using fused features as input features. The model loss is calculated by dynamic convolution through the Head module based on the attention mechanism. The leaf detection model is obtained when the model loss is lower than the loss threshold or when the model reaches the maximum number of iterations.

[0076] In this embodiment, the YOLOv11 architecture is used as the initial network architecture for the blade detection model. The working mechanism of the YOLOv11 architecture is as follows: (1) The image is first scaled to a fixed size and input into the YOLOv11 architecture backbone network for feature extraction; the backbone includes multiple convolutional layers and C3k2 modules. The C3k2 modules can choose to use the ordinary Bottleneck or C3 modules to enhance flexibility as needed. (2) In the neck network part of the YOLOv11 architecture, the point spatial attention mechanism is combined by introducing the C2PSA module, and the SPPF (spatial pyramid pooling focus) module is used to enhance feature fusion and multi-scale representation.

[0077] (3) Entering the head stage, the sampling depth separable convolution reduces computational complexity while improving efficiency, while the classification and regression tasks are completed by the cv2 and cv3 branches respectively.

[0078] (4) The YOLOv11 architecture generates prediction results at multiple scales. Each scale corresponds to a set of bounding box coordinates, confidence scores and class probabilities. Then, non-maximum suppression (NMS) is used to remove redundant detection boxes to ensure that the output is the most likely target location and class information.

[0079] Figure 5 This is a schematic diagram of the SPPF structure based on the LSKA mechanism provided by the present invention. Figure 5 In the illustrated embodiment, the SPPF structure based on the LSKA attention mechanism includes the following sub-modules: (1) Conv (Conv Layer), used to perform convolution operations with a 1x1 convolution kernel (k=1), stride (s=1) of 1, padding (p=0) of 0. Used to extract features from the input feature map.

[0080] (2) MaxPool2d (two-dimensional max pooling layer) is used to downsample the input feature map, extract the maximum value, reduce the size of the feature map and enhance the features.

[0081] (3) Concat (connection layer) is used to stitch multiple feature maps together in the channel dimension, increase the number of channels, and fuse different features.

[0082] (4) LSKA is used to recalibrate features through the LSKA attention mechanism, enhance important features, and suppress unimportant features. These modules are combined together, features are extracted through convolutional layers, downsampled through max pooling layers, fused through concatenation layers, and finally enhanced through the LSKA attention module to form an effective feature representation.

[0083] It should be noted that LSKA (Large-Scale Kernel Attention) is an advanced attention mechanism designed to capture broader dependencies in images; the Spatial Pyramid Pooling SPPF structure (hereinafter referred to as "LSKA-SPPF structure") is based on the LSKA mechanism; the working mechanism of the LSKA-SPPF structure is as follows: (1) The LSKA-SPPF structure first reduces computational complexity by using depthwise separable convolution, and then gradually expands the receptive field of each position by using dilated convolution or dilated convolution, thereby simulating the effect of large-scale convolution kernels without increasing the amount of computation. (2) The LSKA structure integrates multi-scale feature maps to enrich local feature representation and enhance the model's understanding of information at different scales; (3) The LSKA-SPPF structure is also used to adjust the weights at different positions, so that the blade detection model can dynamically focus on important regions according to the context and improve its ability to understand global information.

[0084] In this embodiment, the YOLOv11 architecture includes an optimized SPPF module (i.e., the LSKA-SPPF structure), which improves the accuracy of the leaf detection model in detecting small targets and its ability to recognize objects in complex scenes. It also improves the quality of feature representation, generates more discriminative feature descriptions, and thus improves classification accuracy. In addition, the LSKA-SPPF structure can enhance background suppression, which helps to more accurately locate target bounding boxes. Therefore, the leaf detection model can maintain high performance when facing different resolution inputs and diverse application scenarios, while ensuring that the efficiency and speed of the model are not affected.

[0085] In this embodiment, an attention-based target detection module DyHead is added to the Head section to obtain an attention-based Head (Dynamic Head, DyHead) module.

[0086] In this embodiment, the DyHead module addresses the inconsistent performance of traditional fixed-structure detection heads on targets of different scales and categories through a dynamically adjusted detection head design. The DyHead module utilizes a dynamic convolution mechanism to adaptively generate convolution kernel weights based on the input feature map, thereby achieving targeted processing for different tasks or targets of different scales.

[0087] Specifically, the DyHead module contains multiple parallel branches, each responsible for learning a specific type of feature transformation. These branches first adjust the number of channels through 1x1 convolutional layers, then apply dynamic convolutions to capture spatial information, and finally output the prediction results through 3x3 convolutional layers. In addition, DyHead introduces a feature recalibration mechanism, which uses the idea of ​​SENet (Squeeze-and-Excitation Networks) to weight features in the channel dimension, further enhancing the model's expressive power.

[0088] Figure 6 This is a schematic diagram of the structure of the Head module based on the attention mechanism provided by the present invention. Figure 6In the illustrated embodiment, the DyHead module includes the following sub-modules: (1) The hard sigmoid module is used to implement the hard sigmoid activation function, which compresses the input values ​​to between 0 and 1, and is used to generate attention weights.

[0089] (2) The ReLU module is used to implement the ReLU (Rectified Linear Unit) activation function, which performs nonlinear transformation on the input to avoid the gradient vanishing problem.

[0090] (3) The conv (1x1 kernel size) module is used to perform convolution operations with a 1x1 kernel for dimensionality reduction or dimensionality increase, while fusing features.

[0091] (4) avg Pool module, used to perform average pooling operation, reduce the dimensionality of features, and extract important features.

[0092] (5) The conv (3x3 kernel size) module is used to perform convolution operations with a 3x3 kernel to extract local features and enhance feature expression capabilities.

[0093] (6) The index module is used for indexing operations to select specific feature information.

[0094] (7) The offset module is used to adjust the offset of the output of the Sigmoid module to make the attention weights more accurate.

[0095] (8) The sigmoid module is used to implement the sigmoid activation function and output attention weights, which are in the range of 0 to 1.

[0096] (9) The normalize module is used to perform normalization operations to make features have the same scale, thereby accelerating model convergence.

[0097] (10) fc (fully connected layer) module, used to implement fully connected layer operations, usually used for feature transformation and classification; these sub-modules together constitute the Dynamic Head structure, which dynamically adjusts feature weights through attention mechanism to improve the accuracy and efficiency of object detection.

[0098] The single-clove garlic planting standard recommendation method based on crop growth process identification provided in this invention improves the spatial invariance and multi-scale feature extraction capability of the YOLOv11 architecture by introducing LSKA into the SPPF module of the YOLOv11 architecture, thereby enhancing the leaf detection model's ability to handle long-distance dependencies and complex scenarios.

[0099] In some embodiments, the YOLOv11 architecture further includes a shallow detail fusion module; the SPPF structure based on the LSKA mechanism, the shallow detail fusion module, and the Head module based on the attention mechanism are connected in sequence; after obtaining the fused features, the single-clove garlic planting specification recommendation method based on crop growth process identification also includes; The shallow detail fusion module collects contextual information from different receptive fields corresponding to the fusion features from multiple branches, and then fuses the contextual information from different receptive fields to obtain new fusion features.

[0100] In this embodiment, a Shallow Details Fusion (SDFM) module of the PSFusion module is introduced at the Neck tail of the YOLOv11 architecture. The PSFusion module is a technique focused on multi-scale feature fusion, which is used to improve the performance of the model by integrating feature maps from different levels. The PSFusion module combines information from shallow and deep networks, so the YOLOv11 architecture can utilize both low-level detail features and high-level semantic features.

[0101] In this embodiment, the PSFusion module typically includes a series of operations, such as upsampling, downsampling, and convolution, to adjust the spatial dimensions of the feature maps and combine the adjusted feature maps together to ensure the complementarity of features at different scales, thereby improving the accuracy in detection and recognition tasks.

[0102] Figure 7 This is a schematic diagram of the SDFM module provided by the present invention. Figure 7 In the embodiment shown, the structural diagram of the Shallow Detail Blending (SDFM) module can be divided into two parts, left and right. The SDFM module includes the following sub-modules: CAP (Channel Attention Module) is used to enhance important features and suppress unimportant features.

[0103] The Sign (Sign Module) is used to process symbolic information of features.

[0104] Convolutional layers (Conv) are used to perform convolution operations and extract features.

[0105] Batch Normalization (BN) is used for batch normalization, which speeds up the training process and improves the stability of the model.

[0106] PW-Conv (Point-wise Convolution) is used to perform pointwise convolution on feature maps to transform channel dimensions.

[0107] The addition operation is used to add the results from the left and right sides to achieve feature fusion; where C is the number of channels in the feature map, H is the height of the feature map, and W is the width of the feature map; the above sub-modules together form the Shallow Details Fusion (SDFM) module, which achieves effective feature extraction and fusion through the collaborative work of different sub-modules.

[0108] It should be noted that the SDFM module in this embodiment is used to preserve and enhance fine-grained information in the image. Specifically, the SDFM structure contains multiple parallel branches, each responsible for processing feature maps at a specific scale. These branches first reduce the number of channels through 1x1 convolutional layers to reduce computational complexity, and then use dilated or dilated convolutions of different sizes to capture contextual information under different receptive fields. Next, the results of all branches are fused through simple element-wise addition or a more complex attention mechanism. Finally, the fused feature map is passed through an additional convolutional layer to further optimize the feature representation and prepare it for transmission to the subsequent detection head.

[0109] The single-clove garlic planting standard recommendation method based on crop growth process identification provided in this invention improves the model's ability to capture detailed features by integrating the SDFM module into the neck network of YOLOv11. This ensures that the multi-scale features extracted from the backbone network are fully fused and optimized before entering the detection head, which not only enhances the model's sensitivity to small targets and complex backgrounds but also improves the overall detection accuracy. The YOLOv11 network with the SDFM module can retain the detailed information of the original image, which helps to improve the model's performance under high-resolution input. Furthermore, it can provide richer and more accurate feature representations for downstream tasks without increasing the computational burden, thereby improving the detection accuracy of the leaf detection model.

[0110] Figure 8 This is the second flowchart illustrating the method for recommending planting standards for single-clove garlic based on crop growth process identification provided by this invention. Figure 8 In the illustrated embodiment, the method for recommending single-clove garlic planting standards based on crop growth process identification is further implemented through the following steps: (1) Research methods: Determine the research background and significance, and conduct literature analysis, practical surveys and experimental verification related to the recommendation of single-clove garlic planting; (2) Dataset acquisition and preprocessing; First, construct a single-clove garlic image dataset, which includes: image acquisition, data processing and annotation, data augmentation and dataset partitioning; (3) Image recognition model construction; using the above-mentioned single-clove garlic image dataset to identify the growth stage of single-clove garlic; specifically including: constructing a single-clove garlic plant growth stage classification model based on Freq-Swin Transformer, specifically using the SparTa module to replace the Swin Transformer Block in stage4, and then introducing the FreqFusion module for multi-level feature fusion; then performing sequential model training and model evaluation to obtain the optimal model (corresponding to the growth stage classification model); constructing a single-clove garlic plant target detection model based on LSKA-SDFM-YOLOv11, specifically by introducing the LSKA attention mechanism to optimize the SPPF module in the Backbone, introducing the Shallow Detail Fusion (SDFM) module of the PSFusion module to optimize the Neck, and finally using DyHead to replace the Head (detection head), then performing sequential model training and model evaluation to obtain the optimal model (corresponding to the leaf detection model). (4) Decision support method based on environmental perception; use the output results of the two types of models in (3) to perform quantitative processing of production environment data, and combine planting factors such as weather, temperature, soil moisture, wind force and rainfall in the next 3 days to perform quantitative analysis of production environment data, so as to construct a rule-based planting standard recommendation method; (5) System design and development; Based on the above rule-based planting standard recommendation method, design and develop a single-clove garlic planting standard recommendation system, specifically including requirements analysis, system design and system implementation.

[0111] In this embodiment, the single-clove garlic image dataset is constructed through the following steps: Images of single-clove garlic plants were obtained through field surveys and direct photography in region A, totaling 2040 images. These images underwent cleaning, annotation, and data augmentation to construct two main experimental datasets. The single-clove garlic plant image classification dataset was used for growth stage classification tasks, primarily including images of the seedling, differentiation, and swelling stages. The single-clove garlic plant object detection dataset focused on object detection tasks, used to identify the number of leaves in single-clove garlic plants in images, further refining the identification of growth stages. Finally, the datasets were divided into training, validation, and test sets in an 8:1:1 ratio.

[0112] In this embodiment, in order to achieve accurate identification of the growth process of single-clove garlic plants, two datasets were created: a single-clove garlic plant growth period classification dataset and a single-clove garlic plant target detection dataset. This embodiment uses images of the actual collected single-clove garlic plant growth process as the basic data, and constructs a diverse and high-quality dataset through scientific and reasonable annotation and classification.

[0113] Specifically, in this embodiment, the self-built single-clove garlic plant growth period classification dataset is named garlicClassificationDataset. Under the professional guidance of technicians, and referring to the growth cycle of single-clove garlic, the collected images are classified according to specific growth stages to ensure the accuracy and scientific nature of the data annotation. Specifically, the growth period classification criteria for single-clove garlic include typical growth stages such as seedling stage, differentiation stage, and swelling stage. Image samples at each stage have been strictly screened and classified to ensure the representativeness and diversity of the samples.

[0114] This embodiment uses the LabelMe image data annotation tool to annotate the images. The dataset annotation format is YOLO. To ensure data accuracy and effective model training, polygons are used to annotate the plants in the images. The annotations are placed close to the edges of the single-clove garlic plant leaves to minimize overlap between the annotated area and the background, ensuring complete coverage of the plant. The labeling results are saved after annotation is complete.

[0115] It should be noted that in practical applications, single-clove garlic plant image data often exhibits diversity, such as variations in lighting, viewpoint shifts, and noise interference. Directly using the raw data for training may not cover all possible situations, leading to unstable model performance on new data. This embodiment uses data augmentation to generate more single-clove garlic plant samples, simulating various real-world scenarios. This helps the model learn features more comprehensively, improves its generalization ability, reduces overfitting, and enhances robustness in different environments and scenarios. Furthermore, data augmentation can effectively alleviate the problem of insufficient training data, improve the model's training effect, and ultimately enhance its accuracy and stability on test data.

[0116] This embodiment performs data augmentation operations on the training set, including: (1) Adjust brightness. Adjust the image brightness with an 80% probability, with a variation factor set between 0.6 and 1.4, covering both brightness reduction and enhancement.

[0117] (2) Image flipping. The image is flipped horizontally with an 80% probability.

[0118] (3) Image rotation. The image is rotated with an 80% probability. The rotation angle is set between -30 degrees and 30 degrees, that is, rotated 30 degrees to the left and 30 degrees to the right.

[0119] (4) Add Gaussian noise. Add noise to the image with an 80% probability to simulate the interference situation when the picture is taken.

[0120] In this embodiment, through the above operations, the number of training images in the original single-clove garlic plant growth period classification and object detection dataset has been expanded to 8160; this increases the diversity of the dataset and improves the model's generalization ability and robustness.

[0121] The following describes the single-clove garlic planting standard recommendation device based on crop growth process identification provided by the present invention. The single-clove garlic planting standard recommendation device based on crop growth process identification described below can be referred to in correspondence with the single-clove garlic planting standard recommendation method based on crop growth process identification described above.

[0122] Figure 9 This is a schematic diagram of the device for recommending single-clove garlic planting standards based on crop growth process identification provided by the present invention. Figure 9 As shown, the single-clove garlic planting standard recommendation system based on crop growth process identification includes: an image classification and detection module 910 and a recommendation module 920.

[0123] The image classification and detection module 910 is used to process the image of the single-clove garlic to be identified based on the growth period classification model to obtain the growth period classification result; and to process the image of the single-clove garlic to be identified based on the leaf detection model to obtain the leaf detection result. The growth period classification model is determined based on the Swing Transformer module, the Spatial Path Attention and Residual Transform Aggregation SPARTA module or the FreqFusion module; the leaf detection model is determined based on at least one of the Largely Separable Kernel Attention LSKA mechanism and the Shallow Details Fusion module, the YOLO architecture and the Head module based on the attention mechanism. The recommendation module 920 is used to process the growth period classification results and leaf detection results based on the planting standard recommendation model to obtain the target planting standard recommendation result. The planting standard recommendation model is obtained by constructing a mathematical model with the sample growth period classification results and sample leaf detection results as inputs and the sample planting standard recommendation result as output. The sample planting standard recommendation result is determined based on the mapping relationship between multiple sample growth period classification results, multiple sample leaf detection results and multiple planting factors. Multiple planting factors include at least one of soil moisture, air temperature, wind force and weather forecast information.

[0124] This invention provides a single-clove garlic planting standard recommendation device based on crop growth process identification. It processes the single-clove garlic image to be identified using a growth stage classification model determined by the Swin Transformer module, the Spatial Path Attention and Residual Transform Aggregation SPARTA module, or the FreqFusion module to obtain a growth stage classification result. Then, it processes the image using a leaf detection model determined by the YOLO architecture, LSKA attention mechanism, shallow detail fusion module, or the attention mechanism-based Head module to obtain a leaf detection result. Finally, it uses a planting standard recommendation model to predict the recommended planting standard for single-clove garlic based on the growth stage classification result, the leaf detection result, and various planting factors. This effectively improves the model's detection accuracy under diverse leaf numbers and growth states, increases the accuracy of the single-clove garlic planting standard recommendation result, and achieves multi-dimensional environmental perception and precise agricultural operation suggestions.

[0125] Figure 10 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 10 As shown, the electronic device may include: a processor 1010, a communications interface 1020, a memory 1030, and a communication bus 1040. The processor 1010, communications interface 1020, and memory 1030 communicate with each other via the communication bus 1040. The processor 1010 can call logical instructions in the memory 1030 to execute a method for recommending single-clove garlic planting standards based on crop growth process identification. This method includes: processing the image of the single-clove garlic to be identified based on a growth period classification model to obtain a growth period classification result; and processing the image of the single-clove garlic to be identified based on a leaf detection model to obtain a leaf detection result. The growth period classification model is based on Swin... The Transformer module, Spatial Path Attention and Residual Transform Aggregation SPARTA module or FreqFusion module are used to determine the leaf detection model. The model is determined based on at least one of the Largely Separable Kernel Attention (LSKA) mechanism and Shallow Details Fusion module, the YOLO architecture, and the Head module based on the attention mechanism. The target planting specification recommendation result is obtained by processing the growth period classification results and leaf detection results based on the planting specification recommendation model. The planting specification recommendation model is obtained by constructing a mathematical model with the sample growth period classification results and sample leaf detection results as inputs and the sample planting specification recommendation result as output. The sample planting specification recommendation result is determined based on the mapping relationship between multiple sample growth period classification results, multiple sample leaf detection results, and multiple planting factors. Multiple planting factors include at least one of soil moisture, air temperature, wind force, and weather forecast information.

[0126] Furthermore, the logical instructions in the aforementioned memory 1030 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, in essence, 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.

[0127] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the method for recommending single-clove garlic planting specifications based on crop growth process identification provided by the above methods. This method includes: processing the image of the single-clove garlic to be identified based on a growth period classification model to obtain a growth period classification result; and processing the image of the single-clove garlic to be identified based on a leaf detection model to obtain a leaf detection result; wherein, the growth period classification model is based on Swing. The Transformer module, Spatial Path Attention and Residual Transform Aggregation SPARTA module or FreqFusion module are used to determine the leaf detection model. The model is determined based on at least one of the Largely Separable Kernel Attention (LSKA) mechanism and Shallow Details Fusion module, the YOLO architecture, and the Head module based on the attention mechanism. The target planting specification recommendation result is obtained by processing the growth period classification results and leaf detection results based on the planting specification recommendation model. The planting specification recommendation model is obtained by constructing a mathematical model with the sample growth period classification results and sample leaf detection results as inputs and the sample planting specification recommendation result as output. The sample planting specification recommendation result is determined based on the mapping relationship between multiple sample growth period classification results, multiple sample leaf detection results, and multiple planting factors. Multiple planting factors include at least one of soil moisture, air temperature, wind force, and weather forecast information.

[0128] Furthermore, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program implements the method for recommending single-clove garlic planting standards based on crop growth process identification provided by the methods described above. This method includes: processing an image of the single-clove garlic to be identified based on a growth period classification model to obtain a growth period classification result; and processing the image of the single-clove garlic to be identified based on a leaf detection model to obtain a leaf detection result; wherein the growth period classification model is based on Swing... The Transformer module, Spatial Path Attention and Residual Transform Aggregation SPARTA module or FreqFusion module are used to determine the leaf detection model. The model is determined based on at least one of the Largely Separable Kernel Attention (LSKA) mechanism and Shallow Details Fusion module, the YOLO architecture, and the Head module based on the attention mechanism. The target planting specification recommendation result is obtained by processing the growth period classification results and leaf detection results based on the planting specification recommendation model. The planting specification recommendation model is obtained by constructing a mathematical model with the sample growth period classification results and sample leaf detection results as inputs and the sample planting specification recommendation result as output. The sample planting specification recommendation result is determined based on the mapping relationship between multiple sample growth period classification results, multiple sample leaf detection results, and multiple planting factors. Multiple planting factors include at least one of soil moisture, air temperature, wind force, and weather forecast information.

[0129] 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.

[0130] 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.

[0131] 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 recommending planting standards for single-clove garlic based on crop growth process identification, characterized in that, include: The images of single-clove garlic to be identified are processed based on the growth period classification model to obtain the growth period classification results; The image of the single-clove garlic to be identified is processed based on the leaf detection model to obtain the leaf detection result; wherein, the growth period classification model is determined based on the Swing Transformer module, the Spatial Path Attention and Residual Transform Aggregation SPARTA module or the FreqFusion module; the leaf detection model is determined based on at least one of the Large Separable Kernel Attention LSKA mechanism and the Shallow Details Fusion module, the YOLO architecture and the Head module based on the attention mechanism; The target planting standard recommendation result is obtained by processing the growth period classification result and the leaf detection result based on the planting standard recommendation model. The planting standard recommendation model is obtained by constructing a mathematical model with the sample growth period classification result and the sample leaf detection result as input and the sample planting standard recommendation result as output. The sample planting standard recommendation result is determined based on the mapping relationship between multiple sample growth period classification results, multiple sample leaf detection results and multiple planting factors. The multiple planting factors include at least one of soil moisture, air temperature, wind force and weather forecast information.

2. The method for recommending planting standards for single-clove garlic based on crop growth process identification according to claim 1, characterized in that, The growth period classification model includes the Swin Transformer module, which includes multiple Swin Transformer blocks; The growth period classification model is obtained through the following steps: The images of single-clove garlic at different growth stages are divided into blocks, and the features of the block images are embedded through a linear layer to obtain the initial feature representation; For each Swing Transformer block, the initial feature representation is processed by alternating local window self-attention and sliding window self-attention operations to obtain local features and cross-window features. Patch Merging pooling operation is then performed on the local features and the cross-window features to obtain the first multi-scale semantic features. The target classification model is iteratively trained using the first multi-scale semantic features as input features to obtain the growth-stage classification model.

3. The method for recommending planting standards for single-clove garlic based on crop growth process identification according to claim 2, characterized in that, The Swin Transformer module includes multiple Swin Transformer blocks and a SPARTA module. The growth period classification model is also obtained through the following steps: For each Swing Transformer block, the local features and the cross-window features are obtained through the Swing Transformer block based on the initial feature representation; The SPARTA module employs a spatial path attention mechanism to process the local features and the cross-window features, resulting in new local features and new cross-window features. Patch Merging pooling is performed on the local features and the cross-window features to obtain the second multi-scale semantic features; The target classification model is iteratively trained using the second multi-scale semantic features as input features to obtain the growth-stage classification model.

4. The method for recommending planting standards for single-clove garlic based on crop growth process identification according to claim 3, characterized in that, The growth period classification model also includes the FreqFusion module; After obtaining the second multi-scale semantic features, the method further includes: Based on the FreqFusion module, the second multi-scale semantic features are decomposed and reconstructed using a frequency domain transformation combined with a feature selection mechanism to obtain fourth-scale semantic features, thereby enabling iterative training of the target classification model.

5. The method for recommending planting standards for single-clove garlic based on crop growth process identification according to claim 1, characterized in that, The blade detection model includes the YOLOv11 architecture and the attention-based Head module. The YOLOv11 architecture includes the determination of the spatial pyramid pooling SPPF structure based on the LSKA mechanism. The blade detection model is obtained through the following steps: The YOLOv11 architecture backbone network is used to perform convolution calculations on the sample single-clove garlic leaf images to obtain multi-scale feature maps. Multi-scale images are fused using an SPPF structure based on the LSKA attention mechanism to obtain fused features; The target detection model is iteratively trained using the fused features as input features. The model loss is calculated by dynamic convolution through the attention-based Head module. The blade detection model is obtained when the model loss is lower than the loss threshold or the model reaches the maximum number of iterations.

6. The method for recommending planting standards for single-clove garlic based on crop growth process identification according to claim 5, characterized in that, The YOLOv11 architecture also includes a shallow detail fusion module; the SPPF structure based on the LSKA mechanism, the shallow detail fusion module, and the attention-based Head module are connected in sequence; After obtaining the fusion features, the method further includes; The shallow detail fusion module collects contextual information from different receptive fields corresponding to the fusion feature from multiple branches, and then fuses the contextual information from the different receptive fields to obtain a new fusion feature.

7. A recommendation system for single-clove garlic planting standards based on crop growth process identification, characterized in that, include: The image classification and detection module is used to process the images of single-clove garlic to be identified based on the growth period classification model to obtain the growth period classification results; The image of the single-clove garlic to be identified is processed based on the leaf detection model to obtain the leaf detection result; wherein, the growth period classification model is determined based on the Swing Transformer module, the Spatial Path Attention and Residual Transform Aggregation SPARTA module or the FreqFusion module; the leaf detection model is determined based on at least one of the Large Separable Kernel Attention LSKA mechanism and the Shallow Details Fusion module, the YOLO architecture and the Head module based on the attention mechanism; The recommendation module is used to process the growth period classification results and the leaf detection results based on the planting standard recommendation model to obtain the target planting standard recommendation result. The planting standard recommendation model is obtained by constructing a mathematical model with the sample growth period classification results and sample leaf detection results as inputs and the sample planting standard recommendation result as the output. The sample planting standard recommendation result is determined based on the mapping relationship between multiple sample growth period classification results, multiple sample leaf detection results, and multiple planting factors. The multiple planting factors include at least one of soil moisture, air temperature, wind force, and weather forecast information.

8. 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 method for recommending single-clove garlic planting standards based on crop growth process identification as described in any one of claims 1 to 6.

9. 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 method for recommending single-clove garlic planting specifications based on crop growth process identification as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for recommending single-clove garlic planting specifications based on crop growth process identification as described in any one of claims 1 to 6.