Miao grass identification and precision target weed control method based on transformer architecture
Patent Information
- Application Number
- CN202611110498.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-10-27
AI Technical Summary
[0016]本申请的技术方案,采用基于Transformer架构的预设杂草识别模型对采集到的图像进行识别,以准确获取农田区域内杂草的种类信息、杂草位置和杂草生长阶段,然后将危害权重大于预设权重阈值的杂草作为优先处理的即时处理杂草,对即时处理杂草进行聚类以得到多个待处理杂草簇,并生成每个待处理杂草簇的喷头控制策略,以使每个喷头控制策略与其对应待处理杂草簇中的杂草位置和杂草生长阶段相匹配,提高农田区域的除草精度。接着采用预设作业评分函数对候选除草作业路径进行评价,以得到作业评分值最高的最优除草作业路径;最后将最优除草作业路径与每个待处理杂草簇的喷头控制策略相结合,以得到农田区域的除草作业策略,使该除草作业策略兼顾了除草作业路径的优越性和对杂草进行除草作业的精确性,从而实现对农田区域的精准对靶除草,达到提高对农田区域除草作业高效性和可靠性的目的。
Smart Images

Figure REF-OBJ-1777257030139-000004 
Figure REF-OBJ-1777257030139-000005 
Figure REF-OBJ-1777257030139-000012
Abstract
Description
Technical Field
[0001] This application relates to the field of weed control technology, and in particular to a method for seedling and weed identification and precise targeted weed control based on the Transformer architecture. Background Technology
[0002] A pesticide sprayer is an agricultural plant protection machine that can evenly spray pesticides in the form of droplets onto the surface of crops to control pests and diseases and remove weeds. The pesticide sprayer can capture images of the weeding area, use image recognition technology to identify and locate weeds in the images, and then generate a weeding control strategy based on the location of the weeds to control the nozzle movement. Following this strategy, the sprayer moves the nozzle to the location of the weeds to spray herbicide, thus weeding the area.
[0003] Accurate identification of weed locations is crucial for reducing herbicide usage, protecting crops, and preventing environmental pollution during weed control operations. However, existing pesticide sprayers rely on static image recognition of weed locations, while the sprayers themselves are in motion. This mismatch between the generated weed control strategy and the actual weed control area impacts the reliability of weed control.
[0004] Therefore, how to generate an orderly and precise weeding sequence based on the characteristics of weeds in farmland and the status of pesticide sprayers is a technical problem that needs to be addressed to ensure the efficiency and reliability of weeding operations in farmland. Summary of the Invention
[0005] This application provides a method for seedling and weed identification and precise target weed control based on the Transformer architecture, which is used to improve the efficiency and reliability of weeding operations in farmland areas.
[0006] Specifically, to at least solve the above-mentioned technical problems, this application provides a method for seedling and weed identification and precise targeted weed control based on the Transformer architecture, including: Images of farmland areas are acquired, and a preset weed recognition model based on the Transformer architecture is used to identify the type, location, and growth stage of weeds in the farmland area from the images. The hazard weight of each weed is obtained based on the species information and the weed growth stage. Weeds with a hazard weight greater than a preset weight threshold are treated as weeds for immediate treatment. The weeds for immediate treatment are clustered according to their location to obtain multiple weed clusters to be treated. The weed density and cluster center location of each weed cluster to be treated are obtained. Based on the location and growth stage of the weeds to be treated in each cluster of weeds, a nozzle control strategy is generated for each cluster of weeds to be treated. A preset job scoring function is obtained, and multiple candidate weeding job paths are generated based on the cluster center position of each of the weeds to be treated. The preset job scoring function is then used to calculate the job score value of each candidate weeding job path based on the weed density of each of the weeds to be treated and the nozzle response speed of the pesticide sprayer. The candidate weeding operation path with the highest operation score is selected as the optimal weeding operation path. A weeding operation strategy for the farmland area is generated based on the optimal weeding operation path and the nozzle control strategy, and the weeding control strategy is sent to the pesticide sprayer.
[0007] Furthermore, before obtaining the weed density and cluster center location of each of the weed clusters to be treated, the method further includes: Obtain a preset operating area threshold and the weeding operating area of each of the weed clusters to be treated, identify the weed clusters to be treated whose weeding operating area is greater than the operating area threshold and split them to update the weed clusters to be treated.
[0008] Further, obtaining the preset operating area threshold and the weeding operating area of each of the weed clumps to be treated includes: The maximum nozzle rotation angle of the pesticide sprayer is obtained, and the working area threshold is obtained based on the maximum nozzle rotation angle.
[0009] Furthermore, the step of sending the weed control strategy to the pesticide sprayer also includes: Obtain the current wind speed in the farmland area and determine whether the current wind speed is greater than a preset wind speed threshold; If so, obtain the meteorological forecast information of the farmland area, obtain the time period when the wind speed is less than the preset wind speed threshold based on the meteorological forecast information, and send the weeding control strategy to the pesticide sprayer during the time period.
[0010] Furthermore, after determining whether the current wind speed is greater than a preset wind speed threshold, the method further includes: If the current wind speed is less than the preset wind speed threshold, the control strategy for each nozzle is modified according to the current wind speed to optimize the weeding control strategy, and the weeding control strategy is sent to the pesticide sprayer.
[0011] Further, the step of clustering the weeds for immediate treatment based on their location to obtain multiple clusters of weeds to be treated includes: Calculate the distance between adjacent immediate-processing weeds based on their location, and merge adjacent immediate-processing weeds whose distance is less than a preset distance threshold into the same immediate-processing weed group. Obtain the cluster center location of each of the immediate-processing weed groups, and cluster the immediate-processing weed groups according to the cluster center location to obtain multiple weed clusters to be processed.
[0012] Furthermore, before identifying the species, location, and growth stage of weeds within the farmland area from the image using a preset weed recognition model based on the Transformer architecture, the method further includes: The topographic information of the farmland area is obtained, and the image is corrected based on the topographic information.
[0013] Furthermore, after obtaining the hazard weight of each weed based on the species information and the weed growth stage, the method further includes: Weeds with a hazard weight less than the preset weight threshold are designated as weeds for delayed treatment. Obtain the historical resource utilization rate of the system, and obtain the predicted resource utilization rate of the system based on the historical resource utilization rate; The time period during which the predicted resource utilization rate is less than a preset utilization rate threshold is obtained, and the weeding operation strategy for delayed weed treatment is generated during this time period.
[0014] Furthermore, after classifying weeds with a hazard weight greater than a preset weight threshold as weeds to be treated immediately, the method further includes: The herbicide ratio for the farmland area is determined based on the quantity of each weed species in the real-time weed treatment, and the herbicide ratio is sent to the user terminal.
[0015] Further, the step of generating a nozzle control strategy for each of the weed clusters to be treated based on the location and growth stage of the weeds to be treated in real time within each cluster includes: Based on the location and growth stage of the weeds to be treated in each cluster of weeds, a spraying strategy is generated for each cluster of weeds to be treated. The spraying volume error and rotation angle error of the pesticide sprayer are obtained. Each spraying strategy is corrected based on the spraying volume error and rotation angle error. A nozzle control strategy for the corresponding weed cluster is generated based on each spraying strategy.
[0016] The technical solution of this application employs a preset weed recognition model based on the Transformer architecture to identify the acquired images, accurately obtaining information on the type, location, and growth stage of weeds within the farmland area. Weeds with a hazard weight greater than a preset weight threshold are then prioritized for immediate treatment. These immediate-treatment weeds are clustered to obtain multiple weed clusters to be treated, and a nozzle control strategy is generated for each cluster. This ensures that each nozzle control strategy matches the location and growth stage of the weeds within its corresponding cluster, improving the weeding accuracy in the farmland area. Next, a preset job scoring function is used to evaluate candidate weeding operation paths to obtain the optimal path with the highest job score. Finally, the optimal weeding operation path is combined with the nozzle control strategy for each weed cluster to obtain a weeding operation strategy for the farmland area. This strategy balances the advantages of the weeding operation path with the accuracy of weed removal, achieving precise targeted weeding in the farmland area and improving the efficiency and reliability of weeding operations. Attached Figure Description
[0017] Figure 1 This is a schematic flowchart of a seedling and weed identification and precise targeted weed control method based on the Transformer architecture, which is an embodiment of this application. Figure 2 This is a schematic flowchart illustrating the clustering of weeds in a weed control method according to an embodiment of this application. Figure 3 This is a schematic flowchart illustrating the nozzle control strategy for generating weed clumps to be treated in a weed control method according to an embodiment of this application. Detailed Implementation
[0018] To enable those skilled in the art to better understand the technical solution, the present application will be described in detail below with reference to the embodiments. The description in this section is only exemplary and explanatory, and should not be used to limit the scope of protection of the present application in any way.
[0019] In the description of this embodiment, the terms "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0020] Reference Figure 1 , Figure 1This application describes a method for seedling and weed identification and precise targeted weed control based on the Transformer architecture. The method runs on a farmland management system and can first acquire an image of the farmland area, use image recognition technology to identify the weeds in the image, and obtain the location of the weeds in the farmland area based on the recognition results. Then, a weed control strategy is generated based on the location of the weeds, and a pesticide sprayer is controlled according to the weed control strategy to carry out weed treatment on the farmland area.
[0021] Specifically, the seedling and weed identification and precise target weed control method based on the Transformer architecture in this embodiment includes the following steps: Step S101: Obtain an image of the farmland area, and use a preset weed recognition model based on the Transformer architecture to identify the type, location, and growth stage of weeds in the farmland area from the image. Step S102: Obtain the hazard weight of each weed according to its weed type and growth stage, and treat weeds with a hazard weight greater than a preset weight threshold as weeds to be treated immediately. Step S103: Cluster the weeds according to the location of each weed to be treated to obtain multiple weed clusters to be treated, and obtain the weed density and cluster center location of each weed cluster to be treated. Step S104: Based on the location and growth stage of the weeds in each weed cluster to be treated, generate a nozzle control strategy for each weed cluster to be treated. Step S105: Obtain a preset job scoring function, generate multiple candidate weeding job paths based on the cluster center position of each weed cluster to be treated, and use the preset job scoring function to calculate the job score value of each candidate weeding job path based on the weed density of each weed cluster to be treated and the nozzle response speed of the pesticide sprayer. Step S106: Select the candidate weeding operation path with the highest operation score as the optimal weeding operation path, and generate a weeding operation strategy for the farmland area based on the optimal weeding operation path and the nozzle strategy for each weed cluster to be treated. Step S107: Send the weeding operation strategy for the farmland area to the pesticide sprayer.
[0022] In step S101 above, a high-resolution camera can be mounted on the drone, and the camera can capture images of the farmland area at a frequency of 30 frames per second to obtain farmland images with a resolution of 1920x1080, which are then sent to a cloud server. The farmland management system is connected to the cloud server and can send image request information to the cloud server to obtain images of the farmland area from the cloud server.
[0023] Specifically, in this embodiment, 5,000 farmland image samples can be pre-acquired. Weeds in each farmland image sample are labeled, and training data and validation datasets are constructed based on the labeled farmland image samples. The labeling of the farmland image samples includes the location of the weeds, the weed species, and the weed growth stage. The weed location is the position of the center of the weed. The weed species include, but are not limited to, foxtail grass and barnyard grass. The weed growth stage includes the seedling stage, the growth stage, and the maturity stage. Furthermore, the weed growth cycle can be identified from each farmland image sample based on color.
[0024] Then, a neural network model based on the Transformer architecture is constructed. The neural network model is trained using the constructed training dataset, and the accuracy of the neural network model is verified using the validation dataset. Training ends when the accuracy is greater than 85%, and the trained neural network model is used as the preset weed recognition model.
[0025] In this embodiment, the neural network model based on the Transformer architecture refers to a neural network model composed of an encoder and a decoder. Each encoder is composed of multiple identical encoder layers stacked together. Each encoder layer includes two sub-layers: a multi-head self-attention layer and a feedforward neural network. Each sub-layer is followed by a residual layer and a normalization layer. The decoder is composed of multiple identical decoder layers stacked together. Each decoder layer includes three sub-layers: a masked multi-head self-attention layer, an encoder-decoder attention layer, and a feedforward neural network. Each sub-layer is followed by a residual layer and a normalization layer.
[0026] The neural network model based on the Transformer architecture constructed in this embodiment takes a 1920x1080 pixel RGB image as input. This neural network model divides the input image into multiple 16×16 pixel image blocks, resulting in 8100 image blocks. These blocks are then sorted according to their positions within the input image to generate an input sequence. Positional encoding is added to each image block, and the positionally encoded input sequence is fed into the encoder. The encoder's multi-head self-attention and feedforward neural networks extract global features from the input sequence, outputting a semantically rich feature map. The decoder interacts with the feature map output by the encoder to generate a prediction result. The target query is a learnable vector that can be gradually optimized during the training of the neural network model, representing the potential weed locations and weed categories in the feature map. The prediction result output by the decoder includes the bounding box coordinates of the weeds and the weed category.
[0027] In this embodiment, the position encoding can be either absolute position encoding or learnable position encoding. Absolute position encoding is generated using a sine or cosine function, while learnable position encoding involves gradually optimizing parameters during the training of the neural network model.
[0028] Let the position code generated in the i-th dimension of the image patch at position pos using the sine function be... The position encoding of the i-th dimension of the image patch at position pos, generated using the cosine function, is: ,but:
[0029]
[0030] in, For the embedding dimension, since the image patch size is 16×16 pixels, therefore in this embodiment... It is 256.
[0031] Because the Transformer architecture relies solely on the attention mechanism to process sequential data, it achieves higher parallelism and faster training speed. The self-attention mechanism allows the neural network to dynamically assign different weights to each position when processing a sequence, thereby capturing the dependencies between any two positions in the sequence. Therefore, this embodiment uses a pre-defined weed recognition model based on the Transformer architecture, which can ensure the accuracy and reliability of weed recognition in images.
[0032] In this embodiment, after obtaining an image of the farmland area, the image is input into a preset weed model so that the weeds in the farmland area can be identified from the image through the preset weed model, as well as the type information, location and growth stage of each weed.
[0033] In step S102 above, a weed weight table can be pre-constructed, and the hazard weight of each preset weed type at each preset growth stage can be obtained based on experience. Then, the preset hazard weights of all preset weed types at all preset growth stages are stored in the weed weight table. After obtaining the weed type and growth stage of each weed, the weed weight table is queried according to the weed type and growth stage to obtain the growth stage of each weed.
[0034] In this embodiment, the preset weight threshold can be a pre-set value or a dynamic value obtained based on the weed density within the farmland area. For example, assuming the total area of the farmland area is... The number of weeds is That is, to identify weeds from images of farmland areas using a pre-set weed recognition model. There are [number] weeds, and the weed density in this farmland area is [number]. ,but
[0035] Due to the limitations of the pesticide sprayer's rated capacity, if the weed density in the farmland area is too high, it is impossible to remove all the weeds in one operation. Therefore, in this embodiment, the weed density in the farmland area is limited. If the weed density is less than or equal to a preset density threshold, the preset weight threshold is set to 0; for weed density in farmland areas... If the density exceeds a preset threshold, set the preset weight threshold to... ,and
[0036] Where a is the preset density weight coefficient and b is the preset weight compensation value, and both a and b are positive numbers.
[0037] The aforementioned preset density threshold is determined based on the rated capacity of the pesticide spraying equipment. The larger the rated capacity of the pesticide spraying equipment, the smaller the preset density threshold. Let the rated capacity of the pesticide spraying machine be... The preset density threshold is ,but
[0038] In the above formula, The preset capacity factor, The preset density compensation coefficient, and negative numbers It is a positive number.
[0039] In this embodiment, weeds with a hazard weight greater than a preset weight threshold are considered as weeds that need to be treated first, while weeds with a hazard weight less than a preset weight threshold are considered as weeds that can be treated later. Therefore, weeds with a hazard weight greater than a preset weight threshold are considered as weeds to be treated immediately, while weeds with a hazard weight less than a preset weight threshold are considered as weeds to be treated later.
[0040] In step S103 above, the distance between every two immediate-processing weeds can be calculated based on the location of each weed. This distance is the straight-line distance between the two immediate-processing weeds. The immediate-processing weeds are then clustered based on this distance to group the immediate-processing weeds that are close to each other into the same cluster of weeds to be processed. Then, the weed density and cluster center location of each cluster of weeds to be processed are obtained based on the location of each weed in each cluster of weeds to be processed.
[0041] Taking one of the weed clusters to be treated as an example, the weed position of each weed to be treated in the cluster is obtained, and the smallest circular area that can cover all the weeds to be treated in the cluster is obtained based on the weed position. Then, the center of the smallest circular area is taken as the cluster center of the weed cluster, and the area of the smallest circular area is taken as the weeding operation area of the weed cluster.
[0042] For example, if there is only one immediate-treatment weed in the weed cluster to be treated, the location of that immediate-treatment weed is taken as the cluster center, and the weeding area of the cluster is set as a predetermined area threshold. If there is only one immediate-treatment weed in the weed cluster to be treated, the center of both immediate-treatment weeds is taken as the cluster center, and the area of the circular region with the distance between the two immediate-treatment weeds as its diameter is taken as the weeding area of the cluster, set as a predetermined area threshold. If there are two or more immediate-treatment weeds in the weed cluster to be treated, the smallest polygon that can cover all immediate-treatment weeds in the cluster is determined based on the location of each immediate-treatment weed, and the area corresponding to the circumcircle of this smallest polygon is taken as the weeding area of the cluster.
[0043] After obtaining the weeding area of the weed cluster to be treated, the total number of weeds to be treated in the cluster is obtained, and the ratio of the total number to the weeding area of the cluster to be treated is taken as the weed density of the cluster.
[0044] In step S104 above, a spraying amount storage table can be pre-built, and then the amount of spraying required for each type of weed at each growth stage can be obtained based on experience and stored in the spraying amount storage table.
[0045] The nozzle control strategy in this embodiment includes nozzle rotation angle, nozzle opening, and spraying duration. Taking one weed clump to be treated as an example, the method for obtaining the nozzle control strategy for the weed clump to be treated includes: The preset spraying amount storage table is queried according to the weed type and growth stage of each weed in the weed cluster to be treated, so as to obtain the spraying amount of each weed. Based on the spraying amount and the nozzle control parameters of the pesticide sprayer, the nozzle opening and spraying time corresponding to each weed are obtained. Obtain the relative position between each immediate-treatment weed and the center of the cluster, and obtain the nozzle rotation angle corresponding to each immediate-treatment weed based on the relative position. The nozzle rotation angle refers to the angle of the nozzle relative to the vertical downward direction when spraying herbicide on the immediate-treatment weeds.
[0046] In this embodiment, multiple spray volume ranges can be preset, each spray volume range corresponding to a preset nozzle opening, and each preset nozzle opening corresponding to a spraying speed. Taking an immediate-treatment weed in the weed clump to be treated as an example, after obtaining the spray volume of the immediate-treatment weed, let the spray volume be G, and obtain the spray volume range in which the spray volume is located. The preset nozzle opening corresponding to the spray volume range is taken as the nozzle opening corresponding to the immediate-treatment weed. Let the spraying speed at this nozzle opening be g, then the spraying time corresponding to the immediate-treatment weed is... .
[0047] Taking a single weed in a clump of weeds as an example, during the weeding operation, the pesticide sprayer's nozzle is positioned directly above the center of the clump, and the distance between the nozzle and the ground is... Let the horizontal distance between the center of the weeds being treated and the center of the weeds to be treated be . And the rotation angle of the nozzle corresponding to the instant weed treatment is ,but
[0048] In step S105 above, multiple candidate weeding operation paths can be generated based on the cluster center position of each weed cluster to be treated. Then, the operation cost of each candidate weeding operation path is calculated using a preset operation evaluation function, and the candidate operation path with the lowest operation cost is taken as the optimal weeding operation path.
[0049] Taking one of the candidate weeding paths as an example, assuming there are M weed clumps to be treated in this candidate weeding path, we designate a point h above the center of each weed clump as a weeding point, thus obtaining M weeding points. Let the weed clump corresponding to the i-th weeding point contain... There are 100 weeds that can be processed immediately, where the weight of the j-th weed is 1. And the average weight of the weed clump to be treated is ,but
[0050] In this embodiment, multiple preset priority scores can be set in advance, and each preset priority score corresponds to a weight range; the average weight of the i-th weed cluster to be treated is obtained. Next, obtain the average weight. The weight range in which the i-th weed cluster is located is used as the preset priority corresponding to that weight range, and this priority is used as the processing priority score for the i-th weed cluster to be processed. .
[0051] Let the path length between the i-th weeding operation point and the (i-1)-th weeding operation point be . The straight-line distance between the i-th weeding point and the (i-1)-th weeding point can be used; let the speed of the pesticide sprayer be... The task score for the i-th weeding site is ,but
[0052] In the above formula, This refers to the nozzle response time of the pesticide sprayer, which is an inherent parameter of the pesticide sprayer. Let be the capacity adjustment coefficient corresponding to the i-th weeding operation point, and
[0053] In the above formula, This represents the remaining herbicide dosage of the pesticide sprayer when operation begins at the i-th weeding site. This refers to the rated capacity of the herbicide sprayer.
[0054] Then, using a preset job scoring function, the job score of the candidate weeding job path is obtained based on the job scores of all weeding job points in the candidate weeding job path. Let the job score be... Then the preset assignment scoring function is:
[0055] In step S106 above, the generated optimal weeding operation strategy includes the weeding operation sequence determined according to the optimal weeding operation path, and the nozzle control strategy at each weeding operation point.
[0056] In step S107 above, after the optimal weeding operation strategy is sent to the pesticide sprayer, the pesticide sprayer can move to the weeding operation point in sequence according to the optimal weeding operation path, and execute the corresponding nozzle control strategy at each weeding operation point to weed the weeds in each weed cluster to be treated, thereby removing all weeds in the farmland area.
[0057] As described above, this embodiment employs a pre-defined weed identification model based on the Transformer architecture to identify the acquired images, accurately obtaining information on weed species, location, and growth stage within the farmland area. Weeds with a hazard weight greater than a pre-defined weight threshold are then prioritized for immediate treatment. These immediate-treatment weeds are clustered to obtain multiple weed clusters to be treated, and a nozzle control strategy is generated for each cluster. This ensures that each nozzle control strategy matches the location and growth stage of the weeds within its corresponding cluster, improving weed control accuracy in the farmland area. Next, a pre-defined job scoring function is used to evaluate candidate weeding operation paths, obtaining the optimal path with the highest score. Finally, the optimal weeding operation path is combined with the nozzle control strategy for each weed cluster to obtain a weeding operation strategy for the farmland area. This strategy balances the advantages of the weeding operation path with the precision of weed control, achieving precise targeted weed control in the farmland area and improving the efficiency and reliability of weed control operations.
[0058] In some embodiments of this application, before generating the weeding control strategy for the weed clusters to be treated, step S104 further includes: obtaining a preset operating area threshold, determining whether the weeding operating area of each weed cluster to be treated is greater than the operating area threshold, and then splitting the weed clusters to be treated that have an operating area greater than the operating area threshold to update the weed clusters to be treated.
[0059] In this embodiment, if the area of the weeding operation of a clump of weeds to be treated is greater than the preset operation area threshold, it can be determined that the area of the weeding operation of the clump of weeds to be treated is too large, and the pesticide sprayer cannot remove all the weeds in the clump of weeds to be treated immediately. Therefore, it is necessary to split the clump of weeds to be treated.
[0060] Specifically, in this embodiment, after identifying a cluster of weeds to be treated where the area of weeding operation is greater than the threshold of the operation area, all the weeds to be treated immediately in the cluster are obtained, and each weed to be treated immediately is treated as a new cluster of weeds to be treated, thereby realizing the splitting and processing of the cluster of weeds to be split.
[0061] This embodiment splits the weed clumps to be treated that have a weeding area greater than the threshold of the treatment area, which can ensure that the weeding area of each weed clump to be treated is within the operating capacity of the pesticide sprayer, thereby improving the reliability of weeding operations in farmland areas.
[0062] In some embodiments of this application, the method for obtaining a preset operating area threshold includes: obtaining the maximum rotation angle of the pesticide sprayer nozzle, determining the maximum coverage area of the pesticide sprayer nozzle based on the maximum rotation angle, and using the maximum coverage area as the operating area threshold.
[0063] In this embodiment, the maximum rotation angle of the pesticide sprayer nozzle is an inherent parameter of the pesticide sprayer, and this maximum rotation angle is set as follows: The maximum rotation angle refers to the angle relative to the vertically downward direction after the nozzle has rotated to its limit position in any direction; when the pesticide sprayer is performing weeding operations, the height between the nozzle and the ground is h, and the maximum coverage area of the pesticide sprayer nozzle is assumed to be... ,but
[0064] In this embodiment, the operating area threshold is determined based on the maximum rotation angle of the pesticide sprayer nozzle. This ensures that the operating area threshold matches the operating capacity of the pesticide sprayer, so that the weeding area of each weed clump to be treated is within the operating capacity range of the pesticide sprayer, thus ensuring the reliability of the weeding operation on the weed clumps to be treated.
[0065] In some embodiments of this application, before sending the weeding strategy for the farmland area to the pesticide sprayer in step S107, the method further includes: Obtain the current wind speed in the farmland area and determine whether the current wind speed is greater than a preset wind speed threshold; If it is not greater than, then proceed to step S107 to send the weeding operation strategy for the farmland area to the pesticide sprayer; If the wind speed is greater than the preset wind speed threshold, the meteorological forecast information of the farmland area is obtained. Based on the meteorological forecast information, the time period during which the wind speed in the farmland area is less than the preset wind speed threshold is obtained, and step S107 is executed during the time period to send the weeding operation strategy of the farmland area to the pesticide spraying machine.
[0066] In this embodiment, wind speed detection equipment can be installed in the farmland area to detect the current wind speed; or meteorological information of the area where the farmland is located can be obtained, and the current wind speed of the farmland area can be determined based on the meteorological information. If the current wind speed in the farmland area is greater than a preset wind speed threshold, it can be considered that the current wind speed will affect the accuracy of pesticide spraying in the farmland area. Therefore, instead of immediately controlling the pesticide sprayer to perform weeding operations in the farmland area, weeding operations are performed during the period when the wind speed is less than the preset wind speed threshold, thereby reducing the impact of environmental wind speed on weeding operations and achieving the goal of improving the accuracy of weeding operations.
[0067] In some embodiments of this application, if the current wind speed in the farmland area is less than a preset wind speed threshold, before executing step S107, the method further includes: modifying the nozzle control strategy for each weed cluster to be treated based on the current wind speed in the farmland area, so as to optimize the weeding operation strategy in the farmland area.
[0068] The preset wind speed threshold can be determined based on the spraying force of the herbicide sprayer. Regardless of the nozzle opening, the spraying force of the herbicide remains constant. The wind force corresponding to the preset wind speed threshold is less than the spraying force. For example, in this embodiment, the wind force corresponding to the preset wind speed threshold can be half of the spraying force.
[0069] Taking one immediate-treatment weed from a cluster of weeds as an example, the current wind speed and direction can be obtained, with a higher wind speed indicating a stronger wind. Then, based on the principle of force composition, the corrected nozzle rotation angle of the pesticide sprayer is obtained, so that the combined direction of the spraying force, current wind force, and gravity at this nozzle rotation angle is the direction from the weeding operation point of the cluster of weeds to the immediate-treatment weed.
[0070] In this embodiment, by modifying the nozzle control strategy for each weed clump to be treated, the influence of ambient wind speed on nozzle application can be reduced, thereby further improving the accuracy of weed control in farmland areas.
[0071] In some embodiments of this application, the method for clustering weeds in step S103 according to the location of each weed to be treated to obtain multiple clusters of weeds is as follows: Figure 2 As shown, it includes the following steps: Step S201: Obtain the distance between adjacent instant-processed weeds based on the location of each instant-processed weed, and merge adjacent instant-processed weeds with a distance less than a preset distance threshold into the same instant-processed weed group. Step S202: Obtain the cluster center position of each weed group to be treated immediately, and cluster the weed groups to be treated immediately based on the cluster center position to obtain multiple weed clusters to be treated.
[0072] In step S201 above, if there are no other immediate-processing weeds between two immediate-processing weeds, then these two immediate-processing weeds are adjacent immediate-processing weeds; if the distance between adjacent immediate-processing weeds is less than a preset distance threshold, then the adjacent immediate-processing weeds are merged into an immediate-processing weed group, and the center position of the two adjacent immediate-processing weeds is taken as the group center position of the immediate-processing weed group.
[0073] Since clustering is required after merging adjacent instant-treatment weeds into an instant-treatment weed group, adjacent instant-treatment weeds in the instant-treatment weed group should be within the maximum coverage area of the pesticide sprayer. Furthermore, in this embodiment, the preset distance threshold is set to... .
[0074] In step S202 above, the Euclidean distance between the center positions of every two immediate-processing weed groups is calculated sequentially, and the immediate-processing weed groups whose Euclidean distance is less than the preset inter-group threshold are classified into the same weed cluster to be processed, so as to cluster the immediate-processing weed groups.
[0075] For example, in this embodiment, a group of weeds requiring immediate treatment can be randomly selected. The Euclidean distance between the center position of other weed groups requiring immediate treatment and the center position of this group can be calculated. Other weed groups requiring immediate treatment whose Euclidean distance is less than a preset inter-group threshold, along with this group, can be grouped into the same weed cluster to be treated. Then, a remaining group of weeds requiring immediate treatment can be randomly selected, and the Euclidean distance between the center position of other remaining weed groups requiring immediate treatment and the center position of this group can be calculated. Other weed groups requiring immediate treatment whose Euclidean distance is less than a preset inter-group threshold, along with this group, can be grouped into the same weed cluster to be treated. This process is repeated to complete the clustering of all weed clusters requiring immediate treatment.
[0076] In this embodiment, weeds are first grouped according to the distance between them to obtain multiple weed groups. Then, they are clustered according to the Euclidean distance between the weed groups, thereby reducing the number of clustered objects and improving the efficiency of clustering weeds.
[0077] In some embodiments of this application, before identifying the type, location and growth stage of weeds in the farmland area in step S101, the method further includes: acquiring the topographic information of the farmland area and correcting the image of the farmland area based on the topographic information.
[0078] Specifically, in this embodiment, multiple ground control points can be selected in the image of the farmland area, and the ground coordinates of each ground control point in the ground coordinate system can be obtained according to the topographic information of the farmland area. Then, a polynomial model is established, and the coefficients in the polynomial model are fitted by the least squares method according to the ground coordinates of each ground control point in the ground coordinate system and the image coordinates in the image of the farmland area. Thus, a polynomial model is obtained to describe the relationship between pixel coordinates and ground coordinates, thereby realizing the correction processing of the image of the farmland area.
[0079] In this embodiment, terrain information is used to correct the image of the farmland area, so that the image can reflect the topographic undulation of the farmland area. Then, weeds in the farmland area can be identified through the image, which can ensure the accuracy of the identification results.
[0080] In some embodiments of this application, after obtaining the hazard weight of each weed based on its species information and growth stage, step S102 further includes: obtaining the historical resource utilization rate of the system, and obtaining the predicted resource utilization rate of the system based on the historical resource utilization rate; obtaining the time period in which the predicted resource utilization rate is less than a preset utilization rate threshold, and generating a weeding operation strategy for delayed treatment of weeds during the time period.
[0081] In this embodiment, the resource utilization rate refers to the utilization rate of the processing core of the farmland management system. The preset utilization rate threshold is determined based on the performance of the processing core of the farmland management system. Furthermore, if the temperature of the processing core of the farmland management system exceeds 80°C when the utilization rate is at the preset utilization rate threshold, it will affect the service life of the processing core of the farmland management system. For example, the preset utilization rate threshold in this embodiment is 75%.
[0082] In this embodiment, Fourier transform can be used to perform frequency analysis on the historical resource utilization rate of the system to obtain the resource utilization rate change cycle and the trend of resource utilization rate change within each cycle. Then, based on the current resource utilization rate and the resource utilization rate change cycle, the system's resource utilization rate for a future set time period is obtained, which is the predicted resource utilization rate of the system. Then, based on the time period where the resource utilization rate is less than a set utilization rate threshold, this time period is used as the delayed weeding time. During this weeding time, a delayed weeding operation strategy is generated, and the method for obtaining the strategy is the same as that for obtaining the immediate weeding operation strategy.
[0083] In this embodiment, when the resource utilization rate is less than a preset utilization rate threshold, the system generates a weeding strategy for delayed weed treatment, which can make reasonable use of the load resources and ensure the reliability of system operation.
[0084] In some embodiments of this application, after classifying weeds with a hazard weight greater than a preset weight threshold as weeds to be treated immediately in step S102, the method further includes: determining the herbicide ratio for the farmland area based on the quantity of each type of weed in the weeds to be treated immediately, and sending the herbicide ratio to the user terminal.
[0085] In this embodiment, the total number of weeds to be processed immediately is set to... The number of weeds of type i is Then, the proportion of the i-th type of weed in the immediate treatment of weeds is: And the herbicide formulation for the i-th type of weeds is as follows: .
[0086] In this embodiment, the herbicide ratio for the farmland area is determined based on the quantity of each type of weed in the immediate treatment. This allows the efficacy of the herbicide to match the types of weeds in the farmland area, thereby further improving the accuracy of weed control in the farmland area.
[0087] In some embodiments of this application, step S104 includes a method for generating a nozzle control strategy for each weed clump to be treated, such as... Figure 3 As shown, it includes the following steps: Step S301: Based on the location and growth stage of the weeds to be treated in each weed cluster, generate a spraying strategy for each weed cluster to be treated. Step S302: Obtain the spraying amount error and nozzle rotation error of the pesticide sprayer, and correct the spraying strategy for each weed clump to be treated based on the spraying amount error and nozzle rotation error. Step S303: Obtain the nozzle control strategy for each weed cluster to be treated according to the modified spraying strategy.
[0088] In this embodiment, the spraying strategy for the weed clump to be treated includes the nozzle rotation angle and spray volume corresponding to each immediate-treatment weed in the clump. Taking one weed clump as an example, assuming the nozzle rotation angle corresponding to the i-th immediate-treatment weed in the clump is... The amount of pesticide sprayed is And after correction, the nozzle rotation angle corresponding to the i-th immediate weed in the weed clump to be treated is . The amount of pesticide sprayed is ,but
[0089]
[0090] In the above formula, This is due to the spraying error of the pesticide sprayer. This refers to the nozzle rotation error, and both the spray volume error and the nozzle rotation error can be obtained from the historical usage records of the pesticide sprayer.
[0091] For example, suppose the historical usage data of the pesticide sprayer shows that the actual historical spraying volume of the pesticide sprayer is... The theoretical historical spraying volume is The actual historical nozzle rotation angle was The theoretical historical nozzle rotation angle is ,but
[0092]
[0093] In this embodiment, the spraying amount error and nozzle rotation error of the pesticide sprayer are introduced into the nozzle control strategy for generating the weed clusters to be treated. This can ensure the accuracy and reliability of the generated nozzle control strategy, thereby improving the precision and reliability of weeding in farmland areas.
[0094] It should be noted that, in this document, the terms "comprising," "including," and any other variations are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Specific examples have been used in this document to illustrate the principles and implementation methods of the technical solutions of this application. The above examples are only for the purpose of helping to understand the core ideas of the method and processor of this application. The above descriptions are merely preferred embodiments of this application. It should be pointed out that, due to the limitations of written expression and the objective existence of infinite specific structures, those skilled in the art can make several improvements, modifications, or changes without departing from the principles of this application, and can also combine the above technical features in an appropriate manner; these improvements, modifications, changes, or combinations, or the direct application of the concept and technical solutions of this application to other situations without modification, should all be considered within the scope of protection of this application.
Claims
1. A method for seedling and weed identification and precise targeted weed control based on Transformer architecture, characterized in that, include: Images of farmland areas are acquired, and a preset weed recognition model based on the Transformer architecture is used to identify the type, location, and growth stage of weeds in the farmland area from the images. The hazard weight of each weed is obtained based on the species information and the weed growth stage. Weeds with a hazard weight greater than a preset weight threshold are treated as weeds for immediate treatment. The weeds for immediate treatment are clustered according to their location to obtain multiple weed clusters to be treated. The weed density and cluster center location of each weed cluster to be treated are obtained. Based on the location and growth stage of the weeds to be treated in each cluster of weeds, a nozzle control strategy is generated for each cluster of weeds to be treated. A preset job scoring function is obtained, and multiple candidate weeding job paths are generated based on the cluster center position of each of the weeds to be treated. The preset job scoring function is then used to calculate the job score value of each candidate weeding job path based on the weed density of each of the weeds to be treated and the nozzle response speed of the pesticide sprayer. The candidate weeding operation path with the highest operation score is selected as the optimal weeding operation path. A weeding operation strategy for the farmland area is generated based on the optimal weeding operation path and the nozzle control strategy, and the weeding control strategy is sent to the pesticide sprayer.
2. The weed control method according to claim 1, characterized in that, Before obtaining the weed density and cluster center location of each of the weed clusters to be treated, the method further includes: Obtain a preset operating area threshold and the weeding operating area of each of the weed clusters to be treated, identify the weed clusters to be treated whose weeding operating area is greater than the operating area threshold and split them to update the weed clusters to be treated.
3. The weed control method according to claim 2, characterized in that, The process of obtaining the preset operating area threshold and the weeding operating area of each of the weed clumps to be treated includes: The maximum nozzle rotation angle of the pesticide sprayer is obtained, and the working area threshold is obtained based on the maximum nozzle rotation angle.
4. The weed control method according to claim 1, characterized in that, Sending the weeding control strategy to the pesticide sprayer further includes: Obtain the current wind speed in the farmland area and determine whether the current wind speed is greater than a preset wind speed threshold; If so, obtain the meteorological forecast information of the farmland area, obtain the time period when the wind speed is less than the preset wind speed threshold based on the meteorological forecast information, and send the weeding control strategy to the pesticide sprayer during the time period.
5. The weed control method according to claim 4, characterized in that, After determining whether the current wind speed is greater than a preset wind speed threshold, the method further includes: If the current wind speed is less than the preset wind speed threshold, the control strategy for each nozzle is modified according to the current wind speed to optimize the weeding control strategy, and the weeding control strategy is sent to the pesticide sprayer.
6. The weed control method according to claim 1, characterized in that, The step of clustering the weeds for immediate treatment based on their location to obtain multiple clusters of weeds to be treated includes: Calculate the distance between adjacent immediate-processing weeds based on their location, and merge adjacent immediate-processing weeds whose distance is less than a preset distance threshold into the same immediate-processing weed group. Obtain the cluster center location of each of the immediate-processing weed groups, and cluster the immediate-processing weed groups according to the cluster center location to obtain multiple weed clusters to be processed.
7. The weed control method according to claim 1, characterized in that, Before the preset weed recognition model based on the Transformer architecture is used to identify the species, location, and growth stage of weeds in the farmland area from the image, the method further includes: The topographic information of the farmland area is obtained, and the image is corrected based on the topographic information.
8. The weed control method according to claim 1, characterized in that, After obtaining the hazard weight of each weed based on the species information and the weed growth stage, the method further includes: Weeds with a hazard weight less than the preset weight threshold are designated as weeds for delayed treatment. Obtain the historical resource utilization rate of the system, and obtain the predicted resource utilization rate of the system based on the historical resource utilization rate; The time period during which the predicted resource utilization rate is less than a preset utilization rate threshold is obtained, and the weeding operation strategy for delayed weed treatment is generated during this time period.
9. The weed control method according to claim 1, characterized in that, After classifying weeds with a hazard weight greater than a preset weight threshold as weeds to be treated immediately, the method further includes: The herbicide ratio for the farmland area is determined based on the quantity of each weed species in the real-time weed treatment, and the herbicide ratio is sent to the user terminal.
10. The weed control method according to claim 1, characterized in that, The process involves generating a nozzle control strategy for each weed cluster based on the location and growth stage of the weeds to be treated in each cluster, including: Based on the location and growth stage of the weeds to be treated in each cluster of weeds, a spraying strategy is generated for each cluster of weeds to be treated. The spraying volume error and rotation angle error of the pesticide sprayer are obtained. Each spraying strategy is corrected based on the spraying volume error and rotation angle error. A nozzle control strategy for the corresponding weed cluster is generated based on each spraying strategy.