A grass pest identification method and system based on a target identification model

CN120564052BActive Publication Date: 2026-10-09JIANGSU SANSSAN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511051591.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-29
Publication Date
2026-10-09
Estimated Expiration
2045-07-29

AI Technical Summary

Technical Problem

首先,现有的图像识别系统通常需要大量的标注数据进行训练,而高质量的标注数据获取成本高且耗时长

Benefits of technology

本发明针对现有技术的不足,通过构建水稻幼苗期和分蘖期的三元组特征库并利用自动标注模型对水稻叶脉、叶舌绒毛等细微特征进行强化标注,显著提升了对水稻生长状态及形态特征的表征精度;通过图像相似度匹配算法与多尺度差异注意力机制,在杂草增强识别子模型中分层提取水稻与恶性杂草的纹理、颜色及结构特征,并结合多级下采样与上采样的动态特征融合策略,有效区分了形态相似的水稻与恶性杂草;针对虫害识别,通过卷叶与非卷叶虫的特征解耦标注及差异注意力子层,分别捕获卷曲叶片的局部白斑特征与非卷叶虫的咬痕纹理,结合分层编码结构增强了隐蔽性害虫的识别鲁棒性;此外,采用网格化聚类算法将监测区域划分为多个子单元,结合专家经验库中的危害得分权重,实现了对恶性杂草密度、害虫分布热点的精准量化评估,从而支持分区靶向施药;同时,草-虫一体化识别模型通过双路径动态调用机制,在保证杂草与害虫特征独立提取的基础上,利用轻量解码层与损失优化策略降低计算复杂度,兼顾了高精度识别与实时性需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120564052B_ABST
    Figure CN120564052B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of model identification, and particularly relates to a grass and pest damage identification method and system based on a target identification model, which comprises the following steps: first, image data of rice seedling stage and tillering stage are acquired, and rice and different types of weeds are enhanced and labeled, and pest image is enhanced and classified and labeled to generate a weed identification sequence and a pest identification sequence; second, the above sequences are respectively input into a weed enhanced identification sub-model and a pest enhanced identification sub-model in a grass-pest integrated identification model to realize double identification of weeds and pests; third, a grid algorithm and a clustering algorithm are used to determine the types and quantities of malignant and non-malignant weeds and the quantities of different types of pests in each region; finally, in combination with the grass-pest damage score in an expert experience database, the grass-pest damage degree and the overall comprehensive damage degree of each region of a monitored plot are obtained through an evaluation algorithm; the method realizes accurate and rapid identification and damage degree evaluation of grass and pest damage in farmland.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of model recognition technology, and in particular relates to a method and system for identifying weed pests based on a target recognition model. Background Technology

[0002] With the development of modern agriculture, the identification and diagnosis of weeds and pests has become an important task in agricultural production. Traditional methods for identifying weeds and pests mainly rely on manual observation and experience-based judgment. This method is not only time-consuming and labor-intensive, but also easily affected by human factors, resulting in low identification accuracy. In recent years, image processing and machine learning technologies have been widely used in the agricultural field, but existing methods for identifying weeds and pests still have some shortcomings. First, existing image recognition systems usually require a large amount of labeled data for training, and obtaining high-quality labeled data is costly and time-consuming. Second, existing methods have low identification accuracy in complex backgrounds, especially under conditions of large variations in lighting and poor image quality, where the identification effect is poor. In addition, existing systems often lack real-time performance and automation, failing to meet the needs of large-scale farmland monitoring.

[0003] The existing technologies have the following problems: Although existing technologies can only identify weed types with significant differences and exposed pests, there are many weeds in rice-growing fields that are very similar to rice, especially barnyard grass and other noxious weeds such as Echinochloa crus-galli in the seedling and tillering stages. This makes the existing identification methods prone to errors. Although existing technologies can use hyperspectral imaging systems to identify barnyard grass, single spectral features are difficult to distinguish between barnyard grass and rice. Furthermore, hyperspectral imaging is sensitive to weather and brightness, and the equipment is expensive and should not be widely adopted. Moreover, during the rice growth period, many pests are inside the rice plants or wrapped in rice leaves, making it impossible to identify the corresponding pests and causing losses to rice growth. Therefore, this invention provides a weed and pest identification method and system based on a target recognition model. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention proposes a method and system for identifying weeds and pests based on a target recognition model. The method includes: first, acquiring image data of rice seedlings and tillering stages; enhancing the annotation of rice and different types of weeds; and enhancing the classification annotation of pest images to generate weed identification pairs and pest identification sequences. Second, inputting these sequences into the weed enhanced identification sub-model and pest enhanced identification sub-model of the integrated weed-pest identification model to achieve dual identification of weeds and pests. Third, using grid algorithms and clustering algorithms, determining the types and quantities of malignant and non-malignant weeds and the quantities of different types of pests in each area. Finally, combining the weed-pest damage scores from an expert experience database, and through an evaluation algorithm, determining the degree of weed-pest damage in each area of ​​the monitored plot and the overall comprehensive damage level. This method achieves accurate and rapid identification and damage assessment of weeds and pests in farmland.

[0005] To achieve the above objectives, the present invention provides the following technical solution: A method for identifying weed pests based on a target recognition model, comprising the following steps: S1. Acquire images of rice seedlings and tillering stages, images of different types of weeds and pests at the corresponding stages of the monitored plot, and perform first-stage enhanced annotation on rice and different types of weeds, while performing enhanced classification annotation on pest images to obtain enhanced weed identification pair sequences and pest identification sequences. S2. Input the enhanced weed recognition sequence into the weed enhanced recognition sub-model in the configured integrated weed-insect recognition model for dual weed recognition training. At the same time, input the pest recognition sequence into the pest enhanced recognition sub-model in the integrated weed-insect recognition model for pest enhanced classification and recognition training. Obtain the trained integrated weed-insect recognition model and output different weed types and pest types. S3. Based on the different weed and pest types obtained, the grid algorithm combined with the clustering algorithm is used to obtain the data and quantity of malignant weed types and non-malignant weed types and the number of leaf-rolling and non-leaf-rolling pests in each region. S4. Based on the data and quantity of malignant weeds and non-malignant weeds in each area, the number of leaf-rolling and non-leaf-rolling pests, and the pre-saved damage scores for each type of weed and insect, the evaluation algorithm is used to obtain the degree of weed-insect damage in each area of ​​the monitored plot and the overall degree of weed-insect damage in the monitored plot.

[0006] Specifically, the steps in S1 to obtain the enhanced weed identification pair sequence and the pest identification sequence include: S101. Obtain rice plant attribute information and images of rice seedling and tillering stages in the early, middle and late periods. Based on the rice plant attribute information, construct a ternary feature library of rice in the seedling and tillering stages using natural language. S102. Based on the feature library of rice ternary groups during the seedling and tillering stages, configure the trained automatic annotation model to perform enhanced feature annotation on leaf veins, leaf edges, auricles, ligules and fine hairs on the ligules in the images of rice seedlings and tillering stages, and obtain annotated images of rice seedlings and tillering stages. S103. Based on images of different types of weeds during the rice seedling and tillering stages, a primary classification of weed types is performed using an image similarity matching algorithm to obtain malignant similar weed types and broadleaf weed types. S104. Based on the text feature information of malignant similar weeds, the first enhanced feature annotation and type annotation of malignant weeds are carried out through the automatic annotation model, and the weed type annotation of broadleaf weeds is carried out to obtain the annotated enhanced malignant weed type and broadleaf weed type. S105. Construct an enhanced weed identification pair sequence based on the labeled rice seedling and tillering stage images and the labeled enhanced malignant weed type images, and construct a common weed identification sequence by combining the labeled broadleaf weed type images and the seedling and tillering stage images labeled only with rice type labels.

[0007] Specifically, the steps in S1 to obtain the enhanced weed identification pair sequence and the pest identification sequence further include: S106. Perform preliminary classification on the pest image data to obtain images of leafrollers and non-leafrollers; S107. Based on the white spot characteristics and leaf curling characteristics of leaf rollers, enhance the features and label the pest type of leaf roller images. Based on the yellow spot characteristics and pest type characteristics of non-leaf roller images, label the non-leaf roller images to obtain enhanced leaf rolling and non-leaf roller recognition sequences.

[0008] Specifically, the steps for training dual weed recognition include: S201. Input the enhanced weed identification pair sequence and the ordinary weed identification sequence into the background segmentation layer of the weed enhancement identification sub-model to perform background and size segmentation, and obtain the enhanced weed identification pair sequence and the ordinary weed identification pair sequence with the same input size; S202. The segmented enhanced weed identification pair sequence and ordinary weed identification pair sequence are randomly sorted through a random sorting layer to obtain a comprehensive weed identification pair sequence. S203. Input the rice image in the integrated weed identification pair sequence into the first coding sub-layer of the first coding layer to obtain the rice leaf texture, color, and label semantics and rice structural features corresponding to the rice enhanced annotation. At the same time, input the weed image corresponding to the rice image into the second coding sub-layer of the first coding layer to obtain the weed leaf texture, color, and label semantics and weed structural features corresponding to the weed enhanced annotation. S204. Input the rice leaf texture, color, and the label semantics and structural features corresponding to the enhanced annotation of rice, as well as the weed leaf texture, color, and the label semantics and structural features corresponding to the enhanced annotation of weeds, into the first multi-scale differential attention sub-layer in the first coding layer. Through the matching similarity function and similarity threshold built into the first multi-scale differential attention sub-layer, obtain the similarity value of the multi-scale features of rice and weeds in the comprehensive weed identification pair.

[0009] Specifically, the steps for training dual weed recognition also include: S205. Filter out the features whose similarity values ​​of multi-scale features of rice and weeds are greater than the similarity threshold to obtain the first multi-scale difference feature space and the first filtering loss. S206. Repeat S203 and S204, simultaneously inputting the first multi-scale difference feature space into the first and second coding sub-layers of the second coding layer for half-sampling, and inputting the output into the second multi-scale difference attention sub-layer of the second coding layer for similar feature filtering, to obtain the second multi-scale difference feature space and the second filtering loss. S207. Repeat S206 to perform quarter-downsampling and similar feature filtering and one-eighth-downsampling and similar feature filtering on the second multi-scale difference feature space, and obtain the third multi-scale difference feature space and the third filtering loss and the fourth multi-scale difference feature space and the fourth filtering loss in turn. S208. Input the first multi-scale difference feature space, the second multi-scale difference feature space, the third multi-scale difference feature space and the fourth multi-scale difference feature space into the upsampling layer, perform upsampling and map the channel dimension of the corresponding multi-scale difference feature space to the same channel dimension as the image in the integrated weed identification pair sequence in S202. S209. Input the upsampled first multi-scale difference feature space, second multi-scale difference feature space, third multi-scale difference feature space and fourth multi-scale difference feature space into the feature fusion layer, and stitch them together through the corresponding channel dimensions to obtain the comprehensive multi-scale difference feature space.

[0010] Specifically, the steps for training dual weed recognition also include: S210. Input the comprehensive multi-scale differential feature space into the lightweight decoding layer to obtain the types of rice and each type of malignant and broadleaf weed and their corresponding classification loss. S211. Set the loss threshold and early stopping threshold, and construct the comprehensive training loss based on the first filtering loss, the second filtering loss, the third filtering loss, the fourth filtering loss and the classification loss. S212. When the comprehensive training loss corresponding to the consecutive early stopping threshold training cycles is less than the loss threshold, the trained weed enhancement recognition sub-model is obtained.

[0011] Specifically, the training steps for the pest enhancement recognition sub-model include: S213. The image in the enhanced leafroller identification sequence is segmented into the same size as the weed identification pair and input into the first coding sub-layer of the first coding layer in the S203 process to obtain the leafroller body type features and the color, texture and curling features of the leaves damaged by the leafroller. At the same time, the non-leafroller identification sequence is segmented into the same size as the weed identification pair and input into the second coding sub-layer of the first coding layer in the S203 process to obtain the non-leafroller body type features and the color, texture and bite mark features of the leaves damaged by the non-leafroller. S214. Input the body type features of leafrollers and the color, texture and curling features of leaves damaged by leafrollers, as well as the body type features of non-leafrollers and the color, texture and bite marks of leaves damaged by non-leafrollers, into the first multi-scale differential attention sublayer in the first coding layer in S204 to obtain the differential feature space of the first leafroller and non-leafroller pests and the fifth filter loss. S215. Repeat the process of S214 and input the differential feature space between the first leaf-rolling type and the non-leaf-rolling type pests into the second encoding layer of the process of S206 to obtain the differential feature space between the second leaf-rolling type and the non-leaf-rolling type pests and the sixth filtering loss. S216. Input the difference feature space between the first leaf-rolling and non-leaf-rolling pests and the difference feature space between the second leaf-rolling and non-leaf-rolling pests into the second feature fusion layer and the second lightweight decoding layer in the pest enhancement recognition sub-model in sequence to obtain each pest type in leaf-rolling insects and its corresponding classification loss, and each pest type in non-leaf-rolling insects and its corresponding classification loss. S217. Based on the fifth filtering loss, the sixth filtering loss, the classification loss corresponding to leafrollers and the classification loss corresponding to non-leafrollers, construct the second comprehensive training loss, and repeat S212 to obtain the trained pest enhancement recognition sub-model.

[0012] Specifically, the construction steps of the grass-insect integrated recognition model include: S218. Set the process corresponding to S201 to S212 as the first identification selection path, and the process corresponding to S213 to S217 as the second identification selection path. Based on the first identification selection path and the second identification selection path, integrate the layers and sub-layers corresponding to the weed enhanced identification sub-model and the pest enhanced identification sub-model to obtain the integrated weed-insect identification model. S219. When the object to be identified is weeds, the first identification selection path corresponding process is called for identification. When the object to be identified is pests, the second identification selection path corresponding process is called for identification to obtain the corresponding weed and pest type identification results.

[0013] A pest and weed identification system based on a target recognition model includes: a data processing module, a pest and weed identification module, a region clustering module, and a comprehensive evaluation module; The data processing module includes a data acquisition unit and an enhancement annotation unit. The data acquisition unit is used to acquire images of rice seedlings and tillering stages, as well as images of different types of weeds and pests at the corresponding stages of the monitored plot. The enhancement annotation unit performs first enhancement annotation on rice attributes and attributes of different types of weeds, and performs enhanced classification annotation on pest images for leaf rollers and non-leaf rollers, obtaining enhanced weed identification pairs and pest identification sequences. The weed and insect identification module includes a weed identification unit, a pest identification unit, and a path selection unit. The weed identification unit performs dual weed identification based on the enhanced weed identification pair sequence and uses the weed enhanced identification sub-model in the configured integrated weed-insect identification model to obtain different weed types. The pest identification unit performs enhanced pest classification identification based on the pest identification sequence and uses the pest enhanced identification sub-model in the integrated weed-insect identification model to obtain different pest types. The path selection unit constructs a first identification selection path and a second identification selection path based on the identification processes of the weed and pest identification units, and selects the corresponding identification selection path based on whether the identification object is a weed or a pest.

[0014] Specifically, the region clustering module includes partitioning clustering units and measurement units; The clustering units are divided, and based on the different weed and pest types obtained, the grid algorithm combined with the clustering algorithm is used to obtain the data of malignant and non-malignant weed types and different types of pests for each region. The measurement unit is used to automatically count the number of malignant and non-malignant weed types and the number of pests in each region after the clustering unit is divided into clusters, and to obtain the corresponding number of each type of weed and leaf-rolling and non-leaf-rolling pests in each region. The comprehensive assessment module, based on the quantity of each type of weeds and pests in each area of ​​the monitored plot and the pre-saved damage scores for each type of weed and pest, obtains the degree of weed-pest damage for each area of ​​the monitored plot and the overall degree of weed-pest damage for the monitored plot through an assessment algorithm.

[0015] Compared with the prior art, the beneficial effects of the present invention are: This invention addresses the shortcomings of existing technologies by constructing a triplet feature library for rice seedlings and tillering stages and using an automatic annotation model to enhance the annotation of subtle features such as leaf veins and ligule hairs, significantly improving the accuracy of characterizing rice growth status and morphological features. Through image similarity matching algorithms and multi-scale differential attention mechanisms, the invention extracts texture, color, and structural features of rice and noxious weeds hierarchically in the weed enhancement identification sub-model. Combined with a dynamic feature fusion strategy of multi-level downsampling and upsampling, it effectively distinguishes morphologically similar rice from noxious weeds. For pest identification, it uses feature decoupling annotation and differential attention between leaf-rolling and non-leaf-rolling insects. The force layer captures local white spot features of curled leaves and bite marks of non-leaf-rolling insects, respectively. Combined with a hierarchical coding structure, it enhances the robustness of identifying concealed pests. In addition, a gridded clustering algorithm is used to divide the monitoring area into multiple sub-units. Combined with the hazard score weights in the expert experience base, it achieves accurate quantitative assessment of the density of noxious weeds and the hotspots of pest distribution, thereby supporting zoned targeted pesticide application. At the same time, the integrated weed-insect identification model uses a dual-path dynamic calling mechanism to ensure independent extraction of weed and pest features. It also uses a lightweight decoding layer and loss optimization strategy to reduce computational complexity, balancing high-precision identification with real-time requirements. Attached Figure Description

[0016] Figure 1 This is a flowchart of a grass and insect pest identification method based on a target recognition model according to Embodiment 1 of the present invention; Figure 2 This is a diagram of the integrated grass-insect recognition model architecture of Embodiment 1 of the present invention; Figure 3 This is a module diagram of a grass and insect pest identification system based on a target recognition model, according to Embodiment 2 of the present invention. Detailed Implementation

[0017] Example 1

[0018] Please see Figure 1 The present invention provides an embodiment of a method for identifying weed pests based on a target recognition model. In this embodiment, the target recognition model is applied to the identification and diagnosis of weed and insect pests, specifically the integrated weed-insect recognition model. The steps include: S1. Acquire images of rice seedlings and tillering stages, images of different types of weeds and pests at the corresponding stages of the monitored plot, and perform first-stage enhanced annotation on rice and different types of weeds, while performing enhanced classification annotation on pest images to obtain enhanced weed identification pair sequences and pest identification sequences. Furthermore, in this embodiment, the steps for obtaining the enhanced weed identification pair sequence and the pest identification sequence include: S101. Obtain rice plant attribute information and images of rice seedling and tillering stages in the early, middle and late periods. Based on the rice plant attribute information, construct a ternary feature library of rice in the seedling and tillering stages using natural language. S102. Based on the feature library of rice ternary groups during the seedling and tillering stages, configure the trained automatic annotation model to perform enhanced feature annotation on leaf veins, leaf edges, auricles, ligules and fine hairs on the ligules in the images of rice seedlings and tillering stages, and obtain annotated images of rice seedlings and tillering stages. S103. Based on images of different types of weeds during the rice seedling and tillering stages, a primary classification of weed types is performed using an image similarity matching algorithm to obtain malignant similar weed types and broadleaf weed types. Furthermore, in this embodiment, the types of malignant similar weeds include barnyard grass and Echinochloa crus-galli, which are long-leaved weeds similar to rice and are difficult to distinguish at a glance. In this embodiment, an information database of malignant weeds is constructed by combining expert experience algorithms with a graph database to store textual feature information of malignant similar weeds for the judgment and identification of malignant weeds in this embodiment. S104. Based on the text feature information of malignant similar weeds, the first enhanced feature annotation and type annotation of malignant weeds are carried out through the automatic annotation model, and the weed type annotation of broadleaf weeds is carried out to obtain the annotated enhanced malignant weed type and broadleaf weed type. S105. Construct an enhanced weed identification pair sequence based on the labeled rice seedling and tillering stage images and the labeled enhanced malignant weed type images, and construct a common weed identification sequence by combining the labeled broadleaf weed type images and the seedling and tillering stage images labeled only with rice type labels.

[0019] S106. Perform preliminary classification on the pest image data to obtain images of leafrollers and non-leafrollers; S107. Based on the white spot characteristics and leaf curling characteristics of leaf rollers, enhance the features and label the pest type of leaf roller images. Based on the yellow spot characteristics and pest type characteristics of non-leaf roller images, label the non-leaf roller images to obtain enhanced leaf rolling and non-leaf roller recognition sequences.

[0020] This process constructs a triplet feature library from images of rice at different growth stages and enhances the annotation of rice features using an automatic annotation model, ensuring accurate identification of rice health status. Secondly, it uses an image similarity matching algorithm to initially classify weed types and further implements targeted enhanced feature annotation for malignant similar weeds and broadleaf weeds. This not only improves the accuracy of weed identification but also effectively distinguishes malignant weeds similar to crops, reducing the false positive rate. Finally, it performs a preliminary classification of pest images based on whether they cause leaf curling and performs feature enhancement annotation on both types of pests, enhancing the detection capability of concealed pests. The enhanced weed identification pairs and pest identification sequences generated by this series of steps greatly improve the timeliness and accuracy of agricultural pest and disease control, reducing risks in agricultural production.

[0021] S2. Input the enhanced weed recognition sequence into the weed enhanced recognition sub-model in the configured integrated weed-insect recognition model for dual weed recognition training. At the same time, input the pest recognition sequence into the pest enhanced recognition sub-model in the integrated weed-insect recognition model for pest enhanced classification and recognition training. Obtain the trained integrated weed-insect recognition model and output different weed types and pest types. Further, please refer to Figure 2 In this embodiment, the construction steps of the grass-insect integrated recognition model include: S201. Input the enhanced weed identification pair sequence and the ordinary weed identification sequence into the background segmentation layer of the weed enhancement identification sub-model to perform background and size segmentation, and obtain the enhanced weed identification pair sequence and the ordinary weed identification pair sequence with the same input size; S202. The segmented enhanced weed identification pair sequence and ordinary weed identification pair sequence are randomly sorted through a random sorting layer to obtain a comprehensive weed identification pair sequence. S203. Input the rice image in the integrated weed identification pair sequence into the first coding sub-layer of the first coding layer to obtain the rice leaf texture, color, and label semantics and rice structural features corresponding to the rice enhanced annotation. At the same time, input the weed image corresponding to the rice image into the second coding sub-layer of the first coding layer to obtain the weed leaf texture, color, and label semantics and weed structural features corresponding to the weed enhanced annotation. Furthermore, in this embodiment, the first and second coding sub-layers corresponding to the first, second, third, and fourth coding layers are all constructed using the stacked 3-layer encoders in the original ViT (Vision-Transformer). S204. Input the rice leaf texture, color, and the label semantics and structural features corresponding to the enhanced annotation of rice, as well as the weed leaf texture, color, and the label semantics and structural features corresponding to the enhanced annotation of weeds, into the first multi-scale differential attention sub-layer in the first coding layer. Through the matching similarity function and similarity threshold built into the first multi-scale differential attention sub-layer, obtain the similarity value of the multi-scale features of rice and weeds in the comprehensive weed identification pair. Furthermore, in this embodiment, the first multi-scale differential attention sub-layer, the second multi-scale differential attention sub-layer, the third multi-scale differential attention sub-layer, and the fourth multi-scale differential attention sub-layer are all constructed using convolutional attention networks; S205. Filter out the features whose similarity values ​​of multi-scale features of rice and weeds are greater than the similarity threshold to obtain the first multi-scale difference feature space and the first filtering loss. S206. Repeat S203 and S204, simultaneously inputting the first multi-scale difference feature space into the first and second coding sub-layers of the second coding layer for half-sampling, and inputting the output into the second multi-scale difference attention sub-layer of the second coding layer for similar feature filtering, to obtain the second multi-scale difference feature space and the second filtering loss. S207. Repeat S206 to perform quarter-downsampling and similar feature filtering and one-eighth-downsampling and similar feature filtering on the second multi-scale difference feature space, and obtain the third multi-scale difference feature space and the third filtering loss and the fourth multi-scale difference feature space and the fourth filtering loss in turn. Furthermore, in this embodiment, the third multi-scale difference feature space is obtained through the third coding layer, which includes a first coding sub-layer, a second coding sub-layer, and a third multi-scale difference attention sub-layer; the fourth multi-scale difference feature space is obtained through the fourth coding layer, which includes a first coding sub-layer, a second coding sub-layer, and a fourth multi-scale difference attention sub-layer. S208. Input the first multi-scale difference feature space, the second multi-scale difference feature space, the third multi-scale difference feature space and the fourth multi-scale difference feature space into the upsampling layer, perform upsampling and map the channel dimension of the corresponding multi-scale difference feature space to the same channel dimension as the image in the integrated weed identification pair sequence in S202. Furthermore, in this embodiment, the upsampling layer is constructed through a first MLP sublayer, a second MLP sublayer, a third MLP sublayer, and a fourth MLP sublayer, wherein the first multi-scale difference feature space corresponds to the first MLP sublayer, the second multi-scale difference feature space corresponds to the second MLP sublayer, the third multi-scale difference feature space corresponds to the third MLP sublayer, and the fourth multi-scale difference feature space corresponds to the fourth MLP sublayer. S209. Input the upsampled first multi-scale difference feature space, second multi-scale difference feature space, third multi-scale difference feature space and fourth multi-scale difference feature space into the feature fusion layer, and stitch them together through the corresponding channel dimensions to obtain the comprehensive multi-scale difference feature space. Furthermore, in this embodiment, the feature fusion layer obtains a differential feature space containing different scales by cascading the channel dimensions of the first multi-scale differential feature space, the second multi-scale differential feature space, the third multi-scale differential feature space, and the fourth multi-scale differential feature space. S210. Input the comprehensive multi-scale differential feature space into the lightweight decoding layer to obtain the types of rice and each type of malignant and broadleaf weed and their corresponding classification loss. Furthermore, in this embodiment, the lightweight decoding layer maps the fused features to the target weed type using a classification linear function; S211. Set the loss threshold and early stopping threshold, and construct the comprehensive training loss based on the first filtering loss, the second filtering loss, the third filtering loss, the fourth filtering loss and the classification loss. S212. When the comprehensive training loss corresponding to the consecutive early stopping threshold training cycles is less than the loss threshold, the trained weed enhancement recognition sub-model is obtained. S213. The image in the enhanced leafroller identification sequence is segmented into the same size as the weed identification pair and input into the first coding sub-layer of the first coding layer in the S203 process to obtain the leafroller body type features and the color, texture and curling features of the leaves damaged by the leafroller. At the same time, the non-leafroller identification sequence is segmented into the same size as the weed identification pair and input into the second coding sub-layer of the first coding layer in the S203 process to obtain the non-leafroller body type features and the color, texture and bite mark features of the leaves damaged by the non-leafroller. S214. Input the body type features of leafrollers and the color, texture and curling features of leaves damaged by leafrollers, as well as the body type features of non-leafrollers and the color, texture and bite marks of leaves damaged by non-leafrollers, into the first multi-scale differential attention sublayer in the first coding layer in S204 to obtain the differential feature space of the first leafroller and non-leafroller pests and the fifth filter loss. S215. Repeat the process of S214 and input the differential feature space between the first leaf-rolling type and the non-leaf-rolling type pests into the second encoding layer of the process of S206 to obtain the differential feature space between the second leaf-rolling type and the non-leaf-rolling type pests and the sixth filtering loss. S216. Input the difference feature space between the first leaf-rolling and non-leaf-rolling pests and the difference feature space between the second leaf-rolling and non-leaf-rolling pests into the second feature fusion layer and the second lightweight decoding layer in the pest enhancement recognition sub-model in sequence to obtain each pest type in leaf-rolling insects and its corresponding classification loss, and each pest type in non-leaf-rolling insects and its corresponding classification loss. S217. Based on the fifth filtering loss, the sixth filtering loss, the classification loss corresponding to leaf rollers and the classification loss corresponding to non-leaf rollers, construct the second comprehensive training loss, set the second loss threshold, and repeat S212 to obtain the trained pest enhancement recognition sub-model. S218. Set the process corresponding to S201 to S212 as the first identification selection path, and the process corresponding to S213 to S217 as the second identification selection path. Based on the first identification selection path and the second identification selection path, integrate the layers and sub-layers corresponding to the weed enhanced identification sub-model and the pest enhanced identification sub-model to obtain the integrated weed-insect identification model. S219. When the object to be identified is weeds, the first identification selection path corresponding process is called for identification. When the object to be identified is pests, the second identification selection path corresponding process is called for identification to obtain the corresponding weed and pest type identification results. By constructing an integrated weed-insect recognition model, this process achieves accurate classification and identification of weeds and pests, greatly improving the intelligent level of agricultural pest and weed control. Firstly, by applying background segmentation, random sorting, multi-scale feature extraction, and attention mechanisms to the enhanced weed and pest recognition sequences, consistency and diversity processing of image data of rice and its symbiotic or parasitic weeds and pests at different growth stages are ensured, enhancing the model's generalization ability. Secondly, hierarchical encoding and multi-scale differential attention sublayers are used to refine feature extraction step by step, improving the accuracy of capturing subtle features (such as leaf texture and color) and effectively distinguishing rice from weeds, and leaf rollers from non-leaf rollers through similarity matching, reducing misjudgments. Thirdly, by alternating downsampling and upsampling, and applying a feature fusion layer, the model can capture the features of target objects at different scales, ensuring comprehensive coverage from macro to micro features. Finally, the introduction of a lightweight decoding layer and a comprehensive training loss optimization strategy ensures that the model maintains high accuracy while having low computational complexity, which is beneficial for the model's practical deployment and application. Furthermore, this process constructs an efficient integrated weed-pest identification model by separating and ultimately integrating the weed and pest identification paths. First, enhanced identification sub-models for weeds and pests are optimized separately to ensure the most accurate feature extraction and classification for each object, reducing cross-interference. Next, techniques such as hierarchical coding, multi-scale differential attention mechanisms, and feature fusion are used to improve adaptability to complex agricultural environments and identification accuracy. Finally, the corresponding identification path is selectively invoked based on the different identified objects, achieving effective utilization of model resources and accelerating the identification speed. This method not only enhances the model's specificity and generalization ability but also simplifies the operational process in practical applications, contributing to timely and accurate monitoring of farmland diseases, pests, and weeds.

[0022] S3. Based on the different weed and pest types obtained, the grid algorithm combined with the clustering algorithm is used to obtain the data and quantity of malignant weed types and non-malignant weed types and the number of leaf-rolling and non-leaf-rolling pests in each region. Furthermore, in this embodiment, while obtaining different weed and pest types, weed and pest counts are also performed simultaneously. Based on the different weed and pest types and their corresponding counts, the monitored plots are divided using a grid algorithm, and the same type of weeds and pests in each area are clustered for centralized monitoring and calculation. This yields the data and quantities of malignant and non-malignant weed types, as well as the quantities of leaf-rolling and non-leaf-rolling pests in each area. This is because weeds and pests in fields generally appear in patches. S4. Based on the data and quantity of malignant weeds and non-malignant weeds in each area, the number of leaf-rolling and non-leaf-rolling pests, and the pre-saved damage scores for each type of weed and insect, the evaluation algorithm is used to obtain the degree of weed-insect damage in each area of ​​the monitored plot and the overall degree of weed-insect damage in the monitored plot.

[0023] Furthermore, the damage scores for each type of weed and insect stored in the expert experience database are obtained through expert experience methods, which determine the degree of damage corresponding to each type of weed and pest in the field. This information is then used to construct the corresponding expert experience database. For each divided area, based on the obtained data and corresponding scores of weed and pest types, the degree of damage to rice in the corresponding area can be determined. Based on this, targeted weeding and insecticide spraying can be carried out, further improving the efficiency of field management.

[0024] This process utilizes a grid algorithm combined with clustering algorithms for refined management of monitored plots, significantly improving the efficiency and accuracy of weed and pest monitoring. First, while obtaining identification results for different weed and pest types, counting is performed simultaneously. Based on the counting results, a grid algorithm is used to divide the monitored plots, ensuring that the same type of weeds and pests within each area are monitored and calculated collectively. This method fully leverages the characteristic of weeds and pests appearing in clusters, improving the targeting and efficiency of data processing. Second, clustering algorithms group weeds and pests of the same type together, reducing data redundancy and facilitating subsequent centralized management and analysis. Based on the damage scores of each type of weed and pest stored in an expert experience database, the evaluation algorithm can accurately calculate the degree of weed and pest damage in each area and overall, providing a scientific basis for field management. Based on the actual damage situation, targeted weeding and pesticide spraying can be carried out, avoiding resource waste and environmental pollution, further improving the efficiency and sustainability of field management. Ultimately, this method not only optimizes the allocation of agricultural resources but also enhances the effectiveness of pest and disease control, ensuring the healthy growth of crops.

[0025] Example 2

[0026] Please see Figure 3 Another embodiment of the present invention provides: a grass and insect pest identification system based on a target recognition model, comprising: a data processing module, a grass and insect identification module, a region clustering module, and a comprehensive evaluation module; The data processing module is used for preprocessing and enhanced annotation of weed and pest image data; the data processing module includes a data acquisition unit and an enhanced annotation unit; The data acquisition unit is used to acquire images of rice seedlings and tillering stages, as well as images of different types of weeds and pests at the corresponding stages in the monitored plots. The enhancement annotation unit performs first enhancement annotation on rice attributes and attributes of different types of weeds, and performs enhanced classification annotation on pest images for leaf rollers and non-leaf rollers, to obtain enhanced weed identification pair sequences and pest identification sequences. The weed and insect identification module is used to identify the types of weeds and pests; the weed and insect identification module includes a weed identification unit, a pest identification unit, and a path selection unit. The weed identification unit performs dual weed identification based on the enhanced weed identification pair sequence and through the weed enhanced identification sub-model in the configured integrated weed-insect identification model to obtain different weed types; the pest identification unit performs enhanced pest classification identification based on the pest identification sequence and through the pest enhanced identification sub-model in the integrated weed-insect identification model to obtain different pest types. The path selection unit constructs a first identification selection path and a second identification selection path based on the identification process of the weed identification unit and the pest identification unit, and selects the corresponding identification selection path according to whether the identification object is a weed or a pest.

[0027] The regional clustering module is used to monitor the division of land parcels and the clustering of grass and insects; the regional clustering module includes division clustering units and measurement units; The clustering units are divided, and based on the different weed and pest types obtained, the grid algorithm combined with the clustering algorithm is used to obtain the data of malignant and non-malignant weed types and different types of pests for each region. The measurement unit is used to automatically count the number of malignant and non-malignant weed types and the number of pests in each region after the clustering unit is divided into clusters, and to obtain the corresponding number of each type of weed and leaf-rolling and non-leaf-rolling pests in each region. The comprehensive assessment module, based on the quantity of each type of weeds and pests in each area of ​​the monitored plot and the damage score of each type of weed and pest stored in the expert experience database, obtains the degree of weed-pest damage for each area of ​​the monitored plot and the overall degree of weed-pest damage for the monitored plot through an assessment algorithm.

[0028] Example 3

[0029] An electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement a method for identifying weeds and insect pests based on a target recognition model.

[0030] A computer-readable storage medium having computer instructions stored thereon, which, when executed, perform a pest and weed identification method based on a target recognition model.

[0031] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments under the guidance of the present invention without departing from the spirit and scope of the claims. All of these variations are within the protection scope of the present invention.

Claims

1. A method for identifying weed pests based on a target recognition model, characterized in that, include: S1. Acquire images of rice seedlings and tillering stages, images of different types of weeds and pests at the corresponding stages of the monitored plot, and perform enhanced annotation on rice and different types of weeds. At the same time, perform enhanced classification annotation on pest images to obtain enhanced weed identification pair sequences and pest identification sequences. S2. The enhanced weed recognition sequence is input into the weed enhanced recognition sub-model of the configured integrated weed-insect recognition model for dual weed recognition training. At the same time, the pest recognition sequence is input into the pest enhanced recognition sub-model of the integrated weed-insect recognition model for pest enhanced classification and recognition training. The trained integrated weed-insect recognition model is obtained and outputs different weed types and pest types. The dual weed recognition training includes recognition training for noxious weeds and broadleaf weeds. S3. Based on the different weed and pest types obtained, the grid algorithm combined with the clustering algorithm is used to obtain the data and quantity of malignant weed types and non-malignant weed types and the number of leaf-rolling and non-leaf-rolling pests in each region. S4. Based on the data and quantity of malignant weeds and non-malignant weeds in each area, the number of leaf-rolling and non-leaf-rolling pests, and the pre-saved damage scores of each type of weed and insect, the evaluation algorithm is used to obtain the degree of weed-insect damage in each area of ​​the monitored plot and the overall degree of weed-insect damage in the monitored plot. The step of obtaining the enhanced weed identification pair sequence and the pest identification sequence in S1 includes: S101. Obtain rice plant attribute information and images of rice seedling and tillering stages in the early, middle and late periods. Based on the rice plant attribute information, construct a ternary feature library of rice in the seedling and tillering stages using natural language. S102. Based on the feature library of rice ternary groups during the seedling and tillering stages, configure the trained automatic annotation model to perform enhanced feature annotation on leaf veins, leaf edges, auricles, ligules and fine hairs on the ligules in the images of rice seedlings and tillering stages, and obtain annotated images of rice seedlings and tillering stages. S103. Based on images of different types of weeds during the rice seedling and tillering stages, a primary classification of weed types is performed using an image similarity matching algorithm to obtain malignant similar weed types and broadleaf weed types. S104. Based on the text feature information of malignant similar weeds, use an automatic annotation model to perform enhanced feature annotation and type annotation of malignant similar weeds, and perform weed type annotation of broadleaf weeds to obtain the annotated enhanced malignant weed types and broadleaf weed types. S105. Construct enhanced weed identification pair sequences based on the labeled rice seedling and tillering stage images and the labeled enhanced malignant weed type images, and construct ordinary weed identification pair sequences based on the labeled broadleaf weed types and the seedling and tillering stage images labeled only with rice type labels. S106. Perform preliminary classification on the pest image data to obtain images of leafrollers and non-leafrollers; S107. Based on the white spot characteristics and leaf curling characteristics of leaf rollers, enhance the features and label the pest type of leaf roller images. Based on the yellow spot characteristics and pest type characteristics of non-leaf roller images, label the non-leaf roller images to obtain enhanced leaf rolling and non-leaf roller recognition sequences.

2. The method for identifying pests and weeds based on a target recognition model as described in claim 1, characterized in that, The steps for training dual weed recognition include: S201. Input the enhanced weed identification pair sequence and the ordinary weed identification pair sequence into the background segmentation layer of the weed enhancement identification sub-model to perform background and size segmentation, and obtain the enhanced weed identification pair sequence and the ordinary weed identification pair sequence with the same input size; S202. The segmented enhanced weed identification pair sequence and ordinary weed identification pair sequence are randomly sorted through a random sorting layer to obtain a comprehensive weed identification pair sequence. S203. Input the rice image in the integrated weed identification pair sequence into the first coding sub-layer of the first coding layer to obtain the rice leaf texture, color, and label semantics and rice structural features corresponding to the rice enhanced annotation. At the same time, input the weed image corresponding to the rice image into the second coding sub-layer of the first coding layer to obtain the weed leaf texture, color, and label semantics and weed structural features corresponding to the weed enhanced annotation. S204. Input the rice leaf texture, color, and the label semantics and structural features corresponding to the enhanced annotation of rice, as well as the weed leaf texture, color, and the label semantics and structural features corresponding to the enhanced annotation of weeds, into the first multi-scale differential attention sub-layer in the first coding layer. Through the matching similarity function and similarity threshold built into the first multi-scale differential attention sub-layer, obtain the similarity value of the multi-scale features of rice and weeds in the comprehensive weed identification pair.

3. The method for identifying weed pests based on a target recognition model as described in claim 2, characterized in that, The steps for training dual weed recognition also include: S205. Filter out the features whose similarity values ​​of multi-scale features of rice and weeds are greater than the similarity threshold to obtain the first multi-scale difference feature space and the first filtering loss. S206. Repeat S203 and S204, simultaneously inputting the first multi-scale difference feature space into the first and second coding sub-layers of the second coding layer for half-sampling, and inputting the output into the second multi-scale difference attention sub-layer of the second coding layer for similar feature filtering, to obtain the second multi-scale difference feature space and the second filtering loss. S207. Repeat S206 to perform quarter-downsampling and similar feature filtering and one-eighth-downsampling and similar feature filtering on the second multi-scale difference feature space, and obtain the third multi-scale difference feature space and the third filtering loss and the fourth multi-scale difference feature space and the fourth filtering loss in turn. S208. Input the first multi-scale difference feature space, the second multi-scale difference feature space, the third multi-scale difference feature space and the fourth multi-scale difference feature space into the upsampling layer, perform upsampling and map the channel dimension of the corresponding multi-scale difference feature space to the same channel dimension as the image in the integrated weed identification pair sequence in S202. S209. Input the upsampled first multi-scale difference feature space, second multi-scale difference feature space, third multi-scale difference feature space and fourth multi-scale difference feature space into the feature fusion layer, and stitch them together through the corresponding channel dimensions to obtain the comprehensive multi-scale difference feature space.

4. The method for identifying pests and weeds based on a target recognition model as described in claim 3, characterized in that, The steps for training dual weed recognition also include: S210. Input the comprehensive multi-scale differential feature space into the lightweight decoding layer to obtain the types of rice and each type of malignant and broadleaf weed and their corresponding classification loss. S211. Set the loss threshold and early stopping threshold, and construct the comprehensive training loss based on the first filtering loss, the second filtering loss, the third filtering loss, the fourth filtering loss and the classification loss. S212. When the comprehensive training loss corresponding to the consecutive early stopping threshold training cycles is less than the loss threshold, the trained weed enhancement recognition sub-model is obtained.

5. The method for identifying pests and weeds based on a target recognition model as described in claim 4, characterized in that, The training steps for the pest enhancement recognition sub-model include: S213. The image in the enhanced leafroller identification sequence is segmented into the same size as the weed identification pair and input into the first coding sub-layer of the first coding layer in the S203 process to obtain the leafroller body type features and the color, texture and curling features of the leaves damaged by the leafroller. At the same time, the non-leafroller identification sequence is segmented into the same size as the weed identification pair and input into the second coding sub-layer of the first coding layer in the S203 process to obtain the non-leafroller body type features and the color, texture and bite mark features of the leaves damaged by the non-leafroller. S214. Input the body type features of leafrollers and the color, texture and curling features of leaves damaged by leafrollers, as well as the body type features of non-leafrollers and the color, texture and bite marks of leaves damaged by non-leafrollers, into the first multi-scale differential attention sublayer in the first coding layer in S204 to obtain the differential feature space of the first leafroller and non-leafroller pests and the fifth filter loss. S215. Repeat the process of S214 and input the differential feature space between the first leaf-rolling type and the non-leaf-rolling type pests into the second encoding layer of the process of S206 to obtain the differential feature space between the second leaf-rolling type and the non-leaf-rolling type pests and the sixth filtering loss. S216. Input the difference feature space between the first leaf-rolling and non-leaf-rolling pests and the difference feature space between the second leaf-rolling and non-leaf-rolling pests into the second feature fusion layer and the second lightweight decoding layer in the pest enhancement recognition sub-model in sequence to obtain each pest type in leaf-rolling insects and its corresponding classification loss, and each pest type in non-leaf-rolling insects and its corresponding classification loss. S217. Based on the fifth filtering loss, the sixth filtering loss, the classification loss corresponding to leafrollers and the classification loss corresponding to non-leafrollers, construct the second comprehensive training loss, and repeat S212 to obtain the trained pest enhancement recognition sub-model.

6. The method for identifying weed pests based on a target recognition model as described in claim 5, characterized in that, The construction steps of the grass-insect integrated recognition model include: S218. Set the process corresponding to S201 to S212 as the first identification selection path, and the process corresponding to S213 to S217 as the second identification selection path. Based on the first identification selection path and the second identification selection path, integrate the layers and sub-layers corresponding to the weed enhanced identification sub-model and the pest enhanced identification sub-model to obtain the integrated weed-insect identification model. S219. When the object to be identified is weeds, the first identification selection path corresponding process is called for identification. When the object to be identified is pests, the second identification selection path corresponding process is called for identification to obtain the corresponding weed and pest type identification results.

7. A pest and weed identification system based on a target recognition model, used to implement the pest and weed identification method based on a target recognition model according to any one of claims 1-6, characterized in that, include: Data processing module, insect identification module, region clustering module, and comprehensive evaluation module; The data processing module includes a data acquisition unit and an enhanced annotation unit; The data acquisition unit is used to acquire images of rice seedlings and tillering stages, as well as images of different types of weeds and pests at the corresponding stages of the monitored plots. The enhancement annotation unit enhances the annotation of rice attributes and attributes of different types of weeds, and at the same time enhances the classification annotation of pest images for leaf rollers and non-leaf rollers, thereby obtaining enhanced weed identification pairs and pest identification sequences. The grass and insect identification module includes a weed identification unit, an insect identification unit, and a path selection unit; the weed identification unit performs dual weed identification based on the enhanced weed identification pair sequence through the weed enhanced identification sub-model in the configured grass-insect integrated identification model to obtain different weed types; The pest identification unit, based on the pest identification sequence, performs enhanced pest classification and identification through the pest enhanced identification sub-model in the integrated grass-insect identification model to obtain different pest types. The path selection unit constructs a first identification selection path and a second identification selection path based on the identification process of the weed identification unit and the pest identification unit, and selects the corresponding identification selection path according to whether the identification object is a weed or a pest.

8. The pest and weed identification system based on a target recognition model as described in claim 7, characterized in that, The region clustering module includes partitioning clustering units and measurement units; The clustering unit is defined by using a grid algorithm combined with a clustering algorithm to obtain data on the types of malignant and non-malignant weeds and different types of pests for each region, based on the different weed and pest types obtained. The metering unit is used to automatically count the number of malignant and non-malignant weed types and the number of pests in each region after the clustering unit is divided into clusters, and to obtain the corresponding number of each type of weed and leaf-rolling and non-leaf-rolling pests in each region. The comprehensive evaluation module, based on the quantity of each type of weeds and pests in each area of ​​the monitored plot and the pre-saved damage scores for each type of weed and pest, obtains the degree of weed-pest damage for each area of ​​the monitored plot and the overall degree of weed-pest damage for the monitored plot through an evaluation algorithm.

Citation Information

Patent Citations

  • Rice tillering stage weed segmentation identification method based on improved coding and decoding network

    CN113610035A

  • Crop disease, pest and weed identification processing method and device, electronic equipment and storage medium

    CN113705419A