Agricultural pest data set construction and intelligent identification method and system

By constructing a large-scale agricultural pest image dataset Pest_data, combining multi-perspective division and deep learning model optimization, the limitations of the existing dataset are solved, efficient identification and precise prevention and control of pests are achieved, and the intelligence level of agricultural production is improved.

CN120451647AActive Publication Date: 2025-08-08SOUTHWEST JIAOTONG UNIV
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510527691.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-08
Estimated Expiration
2045-04-25

AI Technical Summary

Technical Problem

The existing agricultural pest image datasets have limitations in terms of scale, quality and applicability, which are difficult to support the effective training and practical application of deep learning models, resulting in low accuracy in pest recognition and difficult to achieve precise prevention and control.

Method used

A large-scale agricultural pest image dataset is constructed. Images are acquired through the combination of online crawling and offline real-time shooting, standardized processing and annotation in stages, sub-datasets are generated based on multi-view division, multiple deep learning models are trained, feature heat maps and weighted fusion strategies are introduced, and intelligent identification models are formed.

Benefits of technology

It has realized the rapid identification and intelligent classification of agricultural pests, improved the recognition accuracy and response speed, supported pest monitoring, precise pesticide spraying and crop health assessment, and enhanced the intelligent level and user experience of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451647A_ABST
    Figure CN120451647A_ABST
Patent Text Reader

Abstract

The invention discloses an agricultural pest data set construction and intelligent identification method and system, and belongs to the field of agricultural informatization and artificial intelligence technology fusion application. The method comprises the steps of determining a target type; acquiring and integrating images; performing data cleaning and staged annotation; performing multi-view division and sub-data set generation; training and optimizing the model; according to the method, a high-quality agricultural pest image data set is constructed, and a set of closed-loop flow covering data acquisition, processing, modeling and application is formed. According to the invention, a high-quality and multi-dimensional agricultural pest image data set is constructed through an innovative pest control-driven stage annotation mechanism and a multi-view data division strategy, and a set of agricultural pest intelligent identification whole-process system which can be popularized and deployed is formed by combining model training optimization and multi-dimensional pest situation identification output. And the method has remarkable technical advancement and industrial application potential.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of agricultural informatization and artificial intelligence technology, and in particular to a method and system for constructing an agricultural pest dataset and intelligently identifying pests. Background Art

[0002] According to statistics, approximately 38% of global agricultural production losses are caused by pests. Accurate pest identification is a prerequisite for effective pest control. However, agricultural pests are diverse, have complex life cycles, and are subject to volatile field environments. Furthermore, some pests possess strong camouflage abilities, making pest identification challenging and accuracy difficult to guarantee.

[0003] Traditional pest identification methods rely primarily on on-site inspections by agricultural experts and manual observation. These methods are not only costly, time-consuming, and labor-intensive, but also difficult to implement in large-scale agricultural production. Furthermore, many agricultural workers lack systematic pest identification skills and often rely on empirical application, leading to overuse of pesticides. This increases the risk of pest resistance and causes environmental problems such as soil and water pollution.

[0004] With the rapid development of deep learning technology, AI-based image recognition methods have demonstrated strong performance in multiple fields, promising to help agricultural practitioners achieve automated pest identification and control. However, effective training of deep learning models relies heavily on large-scale, high-quality annotated datasets. Despite the abundance of internet image resources, the specific application area of agricultural pest identification still lacks high-quality datasets accurately annotated by professionals, limiting the practical application and widespread adoption of intelligent recognition systems.

[0005] Constructing agricultural pest image datasets faces numerous technical challenges. First, pests exhibit significant morphological differences across their lifecycle stages (e.g., eggs, larvae, pupae, and adults). Some male and female pests also differ in color or morphology. Furthermore, the high visual similarity between species, coupled with pests' excellent camouflage and wide geographic distribution, makes image acquisition and accurate annotation complex and time-consuming. These factors contribute to the widespread limitations of existing agricultural pest datasets in terms of scale, quality, and diversity, making it difficult to meet the training data requirements of deep learning models.

[0006] Table 1 summarizes the basic information of major pest image datasets developed in recent years. Despite the continued investment of numerous researchers in this field, which has promoted the development of agricultural pest data resources, existing datasets still have shortcomings in terms of species count, sample size, and ability to distinguish between adults and larvae. For example, some datasets only cover pest information for specific regions or crops, with a limited total sample size and an average sample size that is insufficient to support the training of high-performance models.

[0007] Table 1 - Overview of agricultural pest image datasets in recent years

[0008] Dataset years Number of categories public Differentiation between adults and larvae Sample size Average sample size KA 2014 20 no yes 200 10 D2 2015 24 yes no 1,440 60 Pest ID 2016 12 no no 5,136 428 X 2017 10 yes no 550 55 D0 2018 40 yes no 4,500 113 Mendeley Data 2018 10 yes yes 563 56 PP 2018 13 no yes 4,511 347 IP102 2019 102 yes no 75,222 737 RDD 2020 9 yes no 1,426 158 CPAF 2020 10 yes yes 5,629 562 Pest24 2020 24 yes no 25,378 1057 PY 2021 24 no no 28,000 1166 CPD 2021 6 no no 6,000 1000 IP41 2022 41 yes no 46,567 1135 IP67 2022 67 no yes 67,953 1014 CP14 2023 14 yes no 5,182 370 WPIT9K 2023 17 no no 2,235 131 APTV-99 2023 99 no yes 8,234 83 HQIP102 2023 102 yes no 47,393 464 Pest_data 2024 162 yes yes 194,700 1201

[0009] Secondly, the quality of existing datasets varies. Some lack standardized collection and annotation processes, resulting in poor image quality and inaccurate annotations, which severely impact the generalization capabilities of models. For example, the once widely used IP102 dataset, which contained a large number of mislabeled samples, was criticized as "dirty data." Its cleaned version, HQIP102, saw a sharp drop in sample size to just over 40,000, with an average of fewer than 500 samples per category.

[0010] Furthermore, most datasets fail to meticulously classify pest developmental stages, often lumping adults and larvae together, ignoring differences in their morphological characteristics and control methods. For example, cotton bollworm larvae are typically controlled through chemical or biological means, while adults rely on pheromone trapping or mating disruption techniques. Ignoring differences in lifecycles not only affects identification accuracy but also limits the model's usefulness in precision pest control. Even in some datasets where adults and larvae are labeled, the basis and standards for labeling are not clearly stated.

[0011] In summary, existing agricultural pest image datasets have limitations in scale, quality, and applicability, which seriously restrict the performance and practical application of intelligent pest identification systems. There is an urgent need to develop more systematic, scientific, and practical large-scale agricultural pest image data resources to support the in-depth development and widespread application of agricultural pest intelligent identification technology. Summary of the Invention

[0012] To address these issues, this paper proposes a method and system for constructing and intelligently identifying agricultural pest datasets. This system constructs a large-scale agricultural pest image dataset (Pest_data) and develops a pest image recognition model based on this dataset, enabling rapid identification and intelligent classification of agricultural pests. This system is applicable to scenarios such as agricultural pest monitoring, precision pesticide spraying, and crop health assessment. It aims to enhance the intelligence and automation of agricultural production and achieve efficient and accurate pest monitoring and control.

[0013] The technical solution adopted in the present invention is as follows:

[0014] A method for constructing an agricultural pest dataset and intelligently identifying pests, including:

[0015] Target species identification: Based on the authoritative list of crop pests and diseases and combined with the actual prevention and control needs of agriculture, determine the types of agricultural pests that need to be identified;

[0016] Image acquisition and integration: A combination of online crawling and offline photography is used to obtain agricultural pest images from multiple sources, environments, and resolutions.

[0017] Data cleaning and phased annotation: After standardizing the acquired agricultural pest images, multi-stage annotation is performed to construct an agricultural pest image dataset. This multi-stage annotation includes: based on the needs of agricultural pest control, the biological characteristics of the agricultural pest development cycle are introduced, and agricultural pests with significant ecological differences and significant control differences between adults and larvae are annotated in phases;

[0018] Multi-view partitioning and sub-dataset generation: Based on the different dimensions of agricultural damage modes and visual morphological characteristics, the agricultural pest image dataset is partitioned from multiple perspectives to construct sub-datasets with corresponding clustering characteristics. The sub-datasets include agricultural sub-datasets and visual sub-datasets.

[0019] Model training and structure optimization: Based on the constructed agricultural pest image dataset, multiple deep learning models were trained. Feature heatmaps were introduced to enhance learning of foreground areas. At the same time, knowledge from the agricultural and visual sub-datasets was integrated to develop an intelligent agricultural pest recognition model.

[0020] Intelligent identification and pest status output: Input the pre-processed target agricultural pest image into the agricultural pest intelligent identification model, and output the agricultural pest identification results and multi-dimensional pest status information. The multi-dimensional pest status information includes pest type, density estimation, development stage and damage level.

[0021] Furthermore, the data cleaning and phased annotation include:

[0022] Standardize pest names using Latin scientific names;

[0023] Clean the data and remove duplicate and substandard images;

[0024] Taxonomic annotation of adult and larval stages;

[0025] Build an agricultural pest sample library, covering standard images and classification information of common agricultural pests;

[0026] Based on the agricultural pest sample library, the image data is labeled and reviewed.

[0027] Furthermore, the multi-view division and sub-dataset generation include:

[0028] Based on the agricultural significance classification method, the agricultural pest image dataset is divided into multiple sub-datasets according to the location and method of pest damage to crops;

[0029] The visual feature-based division method clusters pests according to their image morphological features, and classifies pests with similar appearances into the same sub-dataset.

[0030] Furthermore, the model training and structure optimization include:

[0031] Train multiple deep learning models based on the constructed agricultural pest image dataset and select the optimal model through performance comparison;

[0032] Based on the optimal model screened out, the Grad-CAM mechanism is introduced to focus on the foreground, enhancing the model's attention to the target area and reducing background interference;

[0033] Foreground-background contrast learning is used to improve feature discrimination and make the features of different pest categories more clustered.

[0034] Furthermore, the model training and structure optimization also include:

[0035] By constructing an agricultural knowledge-driven model and a visual feature-driven model, and realizing weighted fusion by setting fusion weight parameters, the combination of recognition results is optimized and the recognition ability of complex and fine-grained pest categories is enhanced.

[0036] An intelligent agricultural pest identification system, comprising:

[0037] The target species identification module is configured to determine the types of agricultural pests that need to be identified based on the authoritative list of crop pests and diseases and the actual prevention and control needs of agriculture;

[0038] The image acquisition and integration module is configured to use a combination of online crawling and offline real-time shooting to obtain agricultural pest images from multiple sources, multiple environments, and multiple resolutions;

[0039] The data cleaning and phased annotation module is configured to perform multi-stage annotation on the acquired agricultural pest images after standardization, and to construct an agricultural pest image dataset. The multi-stage annotation includes: introducing the biological characteristics of the agricultural pest development cycle according to the needs of agricultural pest control, and annotating agricultural pests with significant ecological differences and significant control differences between adults and larvae by phase;

[0040] a multi-view partitioning and sub-dataset generation module configured to perform multi-view partitioning of the agricultural pest image dataset based on different dimensions of agricultural damage modes and visual morphological features, and construct sub-datasets with corresponding clustering features, the sub-datasets including an agricultural sub-dataset and a visual sub-dataset;

[0041] The model training and structure optimization module is configured to train multiple deep learning models based on the constructed agricultural pest image dataset, introduce feature heat maps to enhance learning of foreground areas, and integrate knowledge from the agricultural and visual sub-datasets to obtain an intelligent agricultural pest recognition model.

[0042] The intelligent identification and pest status output module is configured to input the preprocessed target agricultural pest image into the agricultural pest intelligent identification model, and output the agricultural pest identification results and multi-dimensional pest status information, which includes pest type, density estimation, development stage and damage level.

[0043] Furthermore, the data cleaning and phased annotation module is configured to:

[0044] Standardize pest names using Latin scientific names;

[0045] Clean the data and remove duplicate and substandard images;

[0046] Taxonomic annotation of adult and larval stages;

[0047] Build an agricultural pest sample library, covering standard images and classification information of common agricultural pests;

[0048] Based on the agricultural pest sample library, the image data is labeled and reviewed.

[0049] Furthermore, the multi-view division and sub-dataset generation module is configured to:

[0050] Based on the agricultural significance classification method, the agricultural pest image dataset is divided into multiple sub-datasets according to the location and method of pest damage to crops;

[0051] The visual feature-based division method clusters pests according to their image morphological features, and classifies pests with similar appearances into the same sub-dataset.

[0052] Furthermore, the model training and structure optimization module is configured as follows:

[0053] Train multiple deep learning models based on the constructed agricultural pest image dataset and select the optimal model through performance comparison;

[0054] Based on the optimal model screened out, the Grad-CAM mechanism is introduced to focus on the foreground, enhancing the model's attention to the target area and reducing background interference;

[0055] Foreground-background contrast learning is used to improve feature discrimination and make the features of different pest categories more clustered.

[0056] Furthermore, the model training and structure optimization module is further configured to:

[0057] By constructing an agricultural knowledge-driven model and a visual feature-driven model, and realizing weighted fusion by setting fusion weight parameters, the combination of recognition results is optimized and the recognition ability of complex and fine-grained pest categories is enhanced.

[0058] The beneficial effects of the present invention are:

[0059] (1) This paper constructs a large-scale agricultural pest image dataset (Pest_data) and develops a pest image recognition model based on this dataset, thereby enabling rapid identification and intelligent classification of agricultural pests. This paper is applicable to scenarios such as agricultural pest monitoring, precision pesticide spraying, and crop health assessment. It aims to enhance the intelligence and automation level of agricultural production and achieve efficient and accurate pest monitoring and control.

[0060] (2) The present invention uses a trained deep learning model to perform inference and recognition on captured images. The model is trained on a large-scale agricultural pest image dataset (Pest_data) and has strong image recognition capabilities and adaptability. The present invention supports on-site image acquisition and local upload, adapting to a variety of agricultural application scenarios, with high recognition accuracy and fast response speed. Users can quickly obtain pest details and prevention and control recommendations through the system, effectively improving pest identification efficiency and scientific prevention and control.

[0061] (3) The present invention supports the recording and monitoring of pest occurrence sites, enabling agricultural management units to grasp regional pest dynamics in real time and formulate scientific prevention and control strategies. It also supports expert interaction and pest discussion, enhancing user experience and system intelligence. Furthermore, it supports user image screening and database update functions, continuously expanding training samples through user-uploaded images, optimizing model performance, and achieving self-iteration and continuous upgrades of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 This is a flow chart of a method for constructing an agricultural pest dataset and intelligently identifying pests according to Example 1 of the present invention.

[0063] Figure 2 This is an image acquisition flow chart of Example 1 of the present invention.

[0064] Figure 3 This is a data annotation flow chart of Example 1 of the present invention.

[0065] Figure 4 This is an example diagram of the adults and larvae of Example 1 of the present invention that require separate annotations.

[0066] Figure 5 This is a flow chart of model optimization and multi-model weighted fusion recognition in Example 1 of the present invention.

[0067] Figure 6 This is a schematic diagram of an intelligent agricultural pest identification system according to embodiment 2 of the present invention. DETAILED DESCRIPTION

[0068] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, the specific embodiments of the present invention are now described. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. That is, the embodiments described are only part of the embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.

[0069] Example 1

[0070] like Figure 1 As shown, this embodiment provides a method for constructing an agricultural pest dataset and intelligently identifying the pests, including:

[0071] Target species identification: Based on the authoritative list of crop pests and diseases and combined with the actual prevention and control needs of agriculture, determine the types of agricultural pests that need to be identified;

[0072] Image acquisition and integration: A combination of online crawling and offline photography is used to obtain agricultural pest images from multiple sources, environments, and resolutions.

[0073] Data cleaning and phased annotation: After standardizing the acquired agricultural pest images, multi-stage annotation is performed to construct an agricultural pest image dataset. Multi-stage annotation includes: based on the needs of agricultural pest control, the biological characteristics of the agricultural pest development cycle are introduced, and agricultural pests with significant ecological differences between adults and larvae and significant control differences are annotated in stages;

[0074] Multi-view partitioning and sub-dataset generation: Based on the different dimensions of agricultural damage modes and visual morphological characteristics, the agricultural pest image dataset is partitioned from multiple perspectives to construct sub-datasets with corresponding clustering characteristics. The sub-datasets include agricultural sub-datasets and visual sub-datasets.

[0075] Model training and structure optimization: Based on the constructed agricultural pest image dataset, multiple deep learning models were trained. Feature heatmaps were introduced to enhance learning of foreground areas. At the same time, knowledge from the agricultural and visual sub-datasets was integrated to develop an intelligent agricultural pest recognition model.

[0076] Intelligent identification and pest status output: Input preprocessed target agricultural pest images into the agricultural pest intelligent identification model, and output agricultural pest identification results and multi-dimensional pest status information. The multi-dimensional pest status information includes pest species, density estimation, development stage and damage level.

[0077] Preferably, data cleaning and stage-by-stage annotation include: standardizing pest names using Latin scientific names; cleaning data to remove duplicate and substandard images; classifying and annotating adult and larval stages; building an agricultural pest sample library that covers standard images and classification information of common agricultural pests; and labeling and reviewing image data based on the agricultural pest sample library.

[0078] Preferably, multi-perspective division and sub-dataset generation include: a division method based on agricultural significance, dividing the agricultural pest image dataset into multiple categories of sub-datasets according to the parts and methods of pest damage to crops; a division method based on visual features, clustering the image morphological features of the pests, and classifying pests with similar appearance into the same category of sub-datasets.

[0079] Preferably, model training and structure optimization include: training multiple deep learning models based on the constructed agricultural pest image dataset, and screening out the optimal model through performance comparison; based on the screened optimal model, introducing the Grad-CAM mechanism for foreground focusing, enhancing the model's attention to the target area and reducing background interference; using foreground-background contrast learning to improve feature discrimination, so that the features of different pest categories are more clustered.

[0080] Preferably, model training and structure optimization also include: by constructing an agricultural knowledge-driven model and a visual feature-driven model, and realizing weighted fusion by setting fusion weight parameters, optimizing the combination of recognition results, and enhancing the recognition ability of complex and fine-grained pest categories.

[0081] Specifically, the agricultural pest image recognition method of this embodiment can be implemented by the following steps:

[0082] S1. Pest species determination: Determine the agricultural pest species targeted by the identification system. The rational determination of pest species is a prerequisite for crop disease and insect pest research, identification system development, and precision agriculture applications. Due to the wide variety of agricultural pests, not all pests pose a serious threat to agricultural production in practice. Therefore, priority should be given to pest species that are severely harmful to crops, widely distributed, and highly destructive. Preferably, pests with significant impacts on agricultural production can be selected as identification targets based on authoritative data such as the "First-Class List of Crop Diseases and Insect Pests of the People's Republic of China" and the lists of serious pests in various regions, ensuring that the system construction has high practicality and promotional value.

[0083] S2. Image acquisition: Figure 2As shown in the figure, a combined online and offline image acquisition strategy is adopted to obtain a wide range of pest image data to be annotated with rich species, providing data support for subsequent model training. In terms of online acquisition, the Latin name, English name, Chinese name and common alias (including local nicknames) of the pest can be entered as keywords through the search engine to automatically collect relevant images. The Latin name is unique, ensuring the accuracy of the image and avoiding recognition bias caused by name ambiguity; multilingual names expand search coverage and improve the comprehensiveness of image acquisition. Through this strategy, approximately 500,000 images covering a variety of agricultural pests were obtained, laying a solid foundation for the construction of a high-quality dataset.

[0084] S3. Data annotation: Figure 3 As shown in the figure, a multi-step annotation process was used to finely annotate the collected image data, labeling key information such as pest species name, image capture environment, shooting angle, and pest developmental stage. After rigorous validation and consistency checks, a high-quality agricultural pest image dataset, named Pest_data, was constructed for model training and performance evaluation.

[0085] S4. Multi-perspective Dataset Partitioning: To improve the model's ability to identify fine-grained pest species, we constructed an agricultural perspective classification method and a visual perspective classification method based on agricultural attribute characteristics and visual features, respectively. This multi-perspective partitioning strategy generated sub-datasets with different clustering dimensions.

[0086] S5. Deep Learning Model Evaluation and Selection: After the dataset is constructed, several current mainstream deep learning models are introduced and trained and evaluated on the constructed large-scale agricultural pest image dataset (Pest_data). Based on the evaluation results, the model with the best performance in the agricultural pest identification task is selected to provide a model foundation for system integration.

[0087] S6. Model Optimization and Multi-Model Fusion Recognition: After identifying the optimal model for agricultural pest recognition, to further improve the model's recognition performance in complex image scenarios, the Grad-CAM mechanism is introduced for foreground focus. Simultaneously, foreground-background contrast learning is employed to enhance feature discrimination. By constructing an agricultural knowledge-driven model and a visual feature-driven model, and setting fusion weight parameters to achieve weighted fusion, the combination of recognition results is optimized, enhancing the recognition capability for complex, fine-grained pest categories. This method, based on weighted multi-model fusion, leverages the synergy between agricultural expertise and fine-grained computer vision image features. The agricultural knowledge-driven model and the visual feature-driven model are trained separately on this basis. Finally, a weighted fusion strategy is employed to set adjustable fusion weight parameters to achieve the optimal weighted combination of the multi-model outputs. This effectively enhances the recognition capability for complex, fine-grained pest categories while maintaining high recognition accuracy.

[0088] S7. Intelligent Identification: Based on a trained deep learning model, this system integrates image acquisition, recognition inference, and result feedback to achieve efficient identification and classification of agricultural pests. It supports deployment in real-world agricultural scenarios, boasts high recognition accuracy, and has promising prospects for widespread adoption.

[0089] To further enhance the diversity and adaptability of image data, step S2, or image acquisition, preferably incorporates offline collection. Specific collection methods include: using high-resolution imaging equipment to capture pest images from various locations, crop growth cycles, and angles; field monitoring images provided by cooperative farmers and agricultural extension stations; and publicly released image data resources from agricultural research institutions. These methods effectively compensate for the shortcomings of online collection in terms of environmental conditions, lighting variations, and different developmental stages of pests, enhancing the authenticity and representativeness of the dataset.

[0090] Preferably, step S3, i.e., data annotation, includes the following sub-steps:

[0091] S31: Standardize pest names using Latin scientific nomenclature to ensure data consistency.

[0092] Specifically, the Chinese and English names of pests often have multiple nicknames, such as rice leaf roll, also known as riceleave folder; longan chicken, also known as longan wax cicada, yellow worm, long nose, etc., which may cause confusion. In contrast, the Latin scientific name is unique and standardized, making it a more reliable identifier in the dataset. Therefore, the example pest image dataset (Pest_data) constructed in this embodiment uses Latin names as pest labels to avoid ambiguity. This approach ensures consistency across the entire dataset, promotes global scientific communication, and prevents confusion caused by language differences.

[0093] S32: Clean up data, delete duplicate images, and avoid redundant interference.

[0094] Specifically, it is inevitable that many duplicate images will be collected during the online data collection process. In order to minimize the impact of duplicate images, this embodiment uses the deep learning pre-trained ResNet50 model as a feature extraction model to extract feature vectors from the collected images. The feature extraction formula is:

[0095] f i =F(I i )

[0096] Among them, f i represents the image feature vector, F represents the general feature extraction model (such as ResNet, DenseNet), I i represents the i-th input image.

[0097] Cosine similarity is used to calculate the similarity matrix between feature vectors. The formula for similarity is:

[0098]

[0099] where · represents the dot product, ||f j || represents the norm of a vector.

[0100] Specifically, in this embodiment, the feature extraction uses a pre-trained ResNet50 model, the image is adjusted to a resolution of 224x224, converted to a tensor, and normalized. The batch size is set to 256. A similarity threshold of 0.90 is established, where sim(f i ,f j )>0.90 are identified as duplicates (i.e., I i and I j are considered duplicate images). The threshold of 0.90 was determined through extensive testing to ensure that most duplicate pairs were accurately detected while minimizing the number of false positives.

[0101] S33: Distinguish between adult and larval stages to meet the needs of precise prevention and control of adults and larvae.

[0102] Specifically, some agricultural pests have completely different morphologies and appearances between their adult and larval stages, as well as significantly different damage patterns and prevention methods. Therefore, when constructing the dataset, these pests need to be individually annotated to meet the needs of targeted prevention and control in practical applications.

[0103] Specifically, the difference between adults and larvae is shown in the example of longhorn beetles. Figure 4This embodiment provides an example of a pest that needs to be distinguished between adults and larvae, to illustrate when adults and larvae of pests should be annotated separately.

[0104] Specifically, in the example Pest_data of this embodiment, whether adults and larvae are distinguished mainly depends on the following three key points: First, significant morphological and behavioral differences; Second, significant differences in prevention and control methods. When larvae and adults of the same species require different control measures, their stages are usually distinguished in the data set. For example, Bacillus thuringiensis (Bt) toxin targets Lepidoptera larvae but is ineffective against adults. If the stages are not distinguished, it will be difficult to implement effective targeted pest management strategies. Third, consistency of life cycle. Pests such as aphids and thrips show little difference between life stages, which means that their control strategies and the types of damage they cause are relatively consistent. In this case, distinguishing between adults and larvae may not be necessary for actual pest management.

[0105] S34: Build an agricultural pest sample library to improve the authority and accuracy of data.

[0106] Specifically, expertise in the agricultural field runs through the entire process of building the Pest_data dataset, from image selection and annotation standards to quality verification. Agricultural pest experts select 10 high-quality images from each category. These images are selected for their high resolution, clear and accessible features, simple backgrounds, and a high proportion of pests in the images (more than 50% of the images are covered by pests). It plays a core role in the following three key stages. First, species identification: using appearance features to distinguish visually similar species, such as the arrangement of larval spots, wing patterns, and body structure; second, biological feature description: experts guide the annotation team to identify key biological features of pests at different stages; third, exclusion of abnormal samples: experts identify abnormal samples (such as samples affected by parasites or samples deformed by environmental factors) to prevent noisy data.

[0107] S35: Annotate the collected image data based on the agricultural pest sample library.

[0108] Specifically, a library of agricultural pest samples was used as a reference for annotating the collected datasets. Using the Pest_data dataset, used in this example, as an example, it and the expert library were divided into 18 groups, each containing nine pest categories. Undergraduate and graduate students in agriculture were responsible for annotating the datasets, using reference images as guidance. To ensure accuracy, each group underwent at least three rounds of annotation review. This rigorous process ensured continuous quality control and minimized the risk of incorrect annotations. Images that remained unclear after these rounds were placed in a "pending annotation" folder for further review.

[0109] S36: Perform a secondary review after the initial annotation to ensure there are no omissions or errors.

[0110] Specifically, after the initial annotation, a secondary review was conducted to identify any remaining inaccuracies. A new group of agricultural students re-reviewed the entire dataset, bringing a fresh perspective to the annotation process. This step aimed to identify any potential errors or inconsistencies that might have been overlooked during the initial review. Any uncertain or problematic images were placed in the "To Be Annotated" folder for further review. This step served as an additional layer of quality assurance and significantly improved the overall consistency of the dataset.

[0111] S37: Conduct expert review of controversial pest images to ensure data quality.

[0112] Specifically, the images in the "To be Annotated" folder underwent a final expert review. This review, performed by a team of experts with experience in agricultural pest identification, aimed to effectively address any uncertainties or potential annotation errors in the images, thereby ensuring the accuracy and consistency of the data annotation. This process provided a critical guarantee for dataset quality control, ultimately generating high-quality, accurate, and reliable annotated data.

[0113] Through the aforementioned image acquisition, screening, annotation, and quality control processes, we constructed a dataset of agricultural pest images for deep learning model training, named Pest_data. This dataset is the largest and most diverse publicly available dataset of agricultural pest images, possessing significant practical and research value.

[0114] In step S4, the constructed Pest_data dataset is partitioned into multiple viewpoints. This step integrates agricultural domain knowledge with visual feature information to create sub-datasets based on different viewpoints. This results in two classification methods: one based on agricultural significance, focusing on the ecological attributes and actual damage of pests; and the other based on visual features, focusing on the image morphological characteristics of pests. This partitioning method facilitates multi-perspective recognition task research and improves the model's feature extraction and recognition performance.

[0115] Preferably, step S4, i.e., dividing the data set into multiple perspectives, comprises the following steps:

[0116] S41: Agriculture-based subset partitioning. This partitioning method organizes pest images by crop damage location and damage pattern into four main superclasses based on the actual damage types and ecological behaviors of pests in agricultural production. This classification method meets the needs of integrated agricultural pest management and helps guide field control strategies.

[0117] Specifically, pests can be divided into the following four agricultural sub-datasets:

[0118] Soil pests (SP): These pests spend most of their life cycle in the soil, primarily targeting underground plant parts, seeds, seedlings, or main stems near the soil surface. Typical examples include termites, mole crickets, and wireworms.

[0119] Boring pests (BP): These pests invade stems, leaves, buds, flowers, fruits, and seeds. In severe cases, they can cause widespread crop mortality and significant economic losses. Representative species include longhorn beetle larvae and weevils.

[0120] Sucking pests (SuP): These pests feed on plant sap, have strong reproductive capacity, are widely distributed, and often cause extensive damage. They can also spread viruses and cause diseases such as sooty mold. Typical pests include aphids, leafhoppers, and spider mites.

[0121] Leaf-feeding pests (LEP): They mainly feed on plant leaves. They are of many types and large in number, and the representative ones are larvae of moths, butterflies, etc.

[0122] S42: Visual feature-based subset classification. This classification groups pests based on their morphological similarity in image appearance, placing species with similar visual features into the same category. This provides a clear training target for model feature extraction and optimization, improving recognition performance.

[0123] Specifically, Pest_data can be divided into the following four subsets:

[0124] MB54: Includes 54 species with wing-like structures, morphologically similar to moths and butterflies.

[0125] LA42: Contains 42 species of soft, slender pests, commonly found in larval species.

[0126] BE43: Includes 43 species of pests with an exoskeleton and segmented body structure, such as beetles.

[0127] Co23: Contains 23 species of pests that do not belong to the above three categories and are suitable as samples for general visual recognition tasks.

[0128] The Pest_data dataset, constructed based on the above process, provides high-quality data support for subsequent deep learning-based pest recognition model training. This dataset features comprehensive species coverage, high-quality annotations, and a classification strategy that integrates agricultural and visual features, playing a key role in model training and performance evaluation. The dataset's structure is shown in Table 2.

[0129] Table 2 - Pest_data data structure

[0130]

[0131] Preferably, in step S5, i.e., deep learning model evaluation and selection, the current advanced deep learning model is introduced and trained on the large-scale agricultural pest image dataset (Pest_data) constructed above. The model most suitable for the pest identification task is screened out through multi-model comparative evaluation, laying the foundation for subsequent performance optimization.

[0132] Specifically, six representative deep learning methods, including ResNet (residual network), DenseNet (densely connected convolutional network), MobileNetV3, ViT (Vision Transformer), SwinTransformer, and ConvMixer, were comprehensively evaluated on the Pest_data dataset. These models were selected to verify their applicability and effectiveness on the Pest_data dataset. They encompass classic convolutional neural networks (such as ResNet and DenseNet), lightweight models (such as MobileNetV3), Transformer-based architectures (such as ViT and SwinTransformer), and a hybrid approach (ConvMixer) that fuses convolutional and mixing mechanisms. This comprehensive evaluation of the dataset was achieved through the use of diverse model architectures, demonstrating their practicality and generalization capabilities for pest recognition tasks. Each model was trained with two parameter configurations, and all models were pre-trained on ImageNet. Experimental results show that the SwinTransformer-based model performs best in terms of recognition accuracy.

[0133] Preferably, step S6 is model optimization and multi-model weighted fusion recognition, such as Figure 5 As shown, the Grad-CAM mechanism is introduced to enhance foreground focus on the target area and reduce background interference based on the Swin Transformer-based model. Furthermore, foreground-background contrast learning is used to improve feature discrimination, clustering features of different pest categories and thus improving classification accuracy. Furthermore, a weighted fusion strategy is set up to adjust the fusion weight parameters, integrating the recognition results of the agricultural knowledge-driven model and the visual feature-driven model to improve the system's adaptability and recognition accuracy for fine-grained pest categories. After selecting the optimal model for agricultural pest recognition, the potential of agricultural and visual subset partitioning for pest recognition performance is further explored.

[0134] Specifically, if Figure 5 As shown in (a), the Grad-CAM mechanism is introduced to perform foreground focus, generating an activation map based on the gradient information of the target category. This activation heat map can highlight the area related to the target category, thereby achieving foreground focus, reducing background interference, and improving the model's ability to focus on the target area. The gradient of the category relative to the feature map A is calculated as follows:

[0135]

[0136] Among them, A k Represents the feature map of the kth channel, H and W are the height and width of the feature map respectively.

[0137] Get the channel weighting coefficient After that, calculate the gradient heat map:

[0138]

[0139] In the feature space, we hope that the features of samples of the same category (especially the same foreground) are as close as possible, while the features of samples of different categories (or foreground and background) are as far apart as possible. To this end, this embodiment introduces a loss function based on contrastive learning, whose mathematical expression is:

[0140]

[0141] Among them, z i and z j is the feature vector of the two samples; ij =1 means that the two belong to the same prospect, y ij =0 indicates different prospects; d(z i ,z j ) is the Euclidean distance; m is the preset margin, which controls the minimum interval between different samples.

[0142] Specifically, multi-model weighted fusion recognition, see Figure 5 (d), we can see the parallel training and fusion process of the three models. First, Figure 5 As shown in (b), the agricultural knowledge-driven model (Model-Agr) divides pests into four categories (SP, BP, SuP, LEP) based on the agricultural subset, and trains a dedicated classifier for each subset. During recognition, the input image is first determined by the four classifiers to determine its agricultural subcategory, and then the corresponding subcategory classifier is used for fine-grained recognition. Similarly, Figure 5 As shown in (c), the visual feature driven model (Model-Vis) builds a classifier based on the visual subset (MB54, LA42, BE43, Co23) and adopts the same hierarchical recognition strategy. Figure 5 (a) directly trains a model based on the Pest_data dataset (model-Pest_data). When identifying pests, weighted fusion of multiple model recognition results can effectively improve recognition accuracy.

[0143] This method leverages the synergy between agricultural expertise and fine-grained computer vision image features. Based on this, the agricultural knowledge-driven model and the visual feature-driven model are trained separately. Ultimately, a weighted fusion strategy is used to set adjustable fusion weight parameters to achieve an optimal weighted combination of the outputs of multiple models. This effectively enhances the system's ability to identify complex and fine-grained pest categories while maintaining high recognition accuracy.

[0144] Preferably, in step S7, intelligent identification, based on the previously trained deep learning model, rapid identification and accurate classification of agricultural pests is achieved through image acquisition, recognition inference, and result feedback. This embodiment uses a camera to capture on-site images or upload local images. After data preprocessing and model inference, the system outputs recognition results and provides corresponding pest details, including morphological characteristics, damage symptoms, and control methods. Users can provide feedback based on prompts, further enhancing interactivity and result accuracy.

[0145] Example 2

[0146] This embodiment is based on embodiment 1:

[0147] like Figure 6 As shown, this embodiment provides an intelligent agricultural pest identification system, including a homepage module, a user module, a camera module, an interactive module and a monitoring module. The functional modules work together through data flow and logic control. The specific functions are as follows.

[0148] Homepage module: displays information of nearby users to users, and recommends scientific knowledge content related to pest control based on regional pest data and user browsing habits, to achieve knowledge sharing and user guidance.

[0149] User Module: This module includes registration and login functions. After logging in, users can access the account management interface, connect to the backend database, and perform pest image screening and management. Screened images are used to expand the pest image database and support image privacy protection measures. These expanded images are used to train deep learning models, continuously improving their recognition accuracy and robustness.

[0150] Camera Module: Provides two image acquisition methods: on-site shooting and local upload. The captured images are transmitted to the backend database, format converted and pre-processed by the data processing module, and then enter the pest identification module for model inference, ultimately outputting the identification results.

[0151] Identification result module: After the identification result is output, the user can choose whether to raise questions and feedback on the result. If there are questions, the system will guide the user to enter the interactive module; if there are no questions, the user will enter the insect situation details page, which will display information such as the morphological characteristics, damage symptoms and prevention and control methods of the identified object.

[0152] Interactive module: includes pest discussion and expert identification functions. Users can participate in pest identification discussions or apply for expert identification services by posting pest pictures and text information to obtain more professional pest identification opinions.

[0153] Monitoring module: Includes system navigation and nearby pest functions. The system can record geographic information on pest occurrences and update it to the pest monitoring and early warning system, enabling regional pest data statistics and early warning releases to facilitate agricultural management and pest control.

[0154] In this embodiment, the system uses a trained deep learning model to perform inference and recognition on captured images. This model, trained on the large-scale Pest_data agricultural pest image dataset, possesses strong image recognition capabilities and adaptability. The system supports both on-site image acquisition and local upload, adapting to a variety of agricultural application scenarios with high recognition accuracy and fast response times. Users can quickly access pest details and prevention recommendations through the system, effectively improving pest identification efficiency and scientific management.

[0155] This system supports pest location recording, monitoring, and early warning, enabling agricultural management units to monitor regional pest trends in real time and formulate scientific prevention and control strategies. It also supports expert interaction and pest discussion, enhancing user experience and system intelligence. Furthermore, the system supports user-uploaded image filtering and database updates, continuously expanding training samples through user-uploaded images, optimizing model performance, and enabling system self-iteration and continuous upgrades.

[0156] It should be noted that this system is capable of being deployed in actual agricultural production scenarios. It can efficiently identify pest species in captured images and implement pest location recording and pest monitoring and early warning functions within the monitoring and early warning system. The system has high recognition accuracy and fast response time, and has promising prospects for promotion and application, providing intelligent technical support for agricultural pest control.

[0157] Example 3

[0158] This embodiment provides an agricultural pest intelligent identification system, including:

[0159] The target species identification module is configured to determine the types of agricultural pests that need to be identified based on the authoritative list of crop pests and diseases and the actual prevention and control needs of agriculture;

[0160] The image acquisition and integration module is configured to use a combination of online crawling and offline real-time shooting to obtain agricultural pest images from multiple sources, multiple environments, and multiple resolutions;

[0161] The data cleaning and phased annotation module is configured to perform multi-stage annotation on the acquired agricultural pest images after standardization, and to construct an agricultural pest image dataset. This multi-stage annotation includes: based on the needs of agricultural pest control, introducing the biological characteristics of the agricultural pest development cycle, and annotating agricultural pests with significant ecological differences between adults and larvae, as well as significant control differences, in phases;

[0162] The multi-view partitioning and sub-dataset generation module is configured to perform multi-view partitioning on the agricultural pest image dataset based on different dimensions of agricultural damage modes and visual morphological characteristics, and construct sub-datasets with corresponding clustering characteristics. The sub-datasets include agricultural sub-datasets and visual sub-datasets.

[0163] The model training and structure optimization module is configured to train multiple deep learning models based on the constructed agricultural pest image dataset, introduce feature heat maps to enhance learning of foreground areas, and integrate knowledge from the agricultural and visual sub-datasets to obtain an intelligent agricultural pest recognition model.

[0164] The intelligent identification and pest status output module is configured to input the preprocessed target agricultural pest image into the agricultural pest intelligent identification model, and output the agricultural pest identification results and multi-dimensional pest status information, which includes pest type, density estimation, development stage and damage level.

[0165] Preferably, the data cleaning and phased annotation module is configured as follows:

[0166] Standardize pest names using Latin scientific names;

[0167] Clean the data and remove duplicate and substandard images;

[0168] Taxonomic annotation of adult and larval stages;

[0169] Build an agricultural pest sample library, covering standard images and classification information of common agricultural pests;

[0170] Based on the agricultural pest sample library, the image data is labeled and reviewed.

[0171] Preferably, the multi-view division and sub-dataset generation module is configured as follows:

[0172] Based on the agricultural significance classification method, the agricultural pest image dataset is divided into multiple sub-datasets according to the location and method of pest damage to crops;

[0173] The visual feature-based division method clusters pests according to their image morphological features, and classifies pests with similar appearances into the same sub-dataset.

[0174] Preferably, the model training and structure optimization module is configured as follows:

[0175] Train multiple deep learning models based on the constructed agricultural pest image dataset and select the optimal model through performance comparison;

[0176] Based on the optimal model screened out, the Grad-CAM mechanism is introduced to focus on the foreground, enhancing the model's attention to the target area and reducing background interference;

[0177] Foreground-background contrast learning is used to improve feature discrimination and make the features of different pest categories more clustered.

[0178] Preferably, the model training and structure optimization module is further configured to:

[0179] By constructing an agricultural knowledge-driven model and a visual feature-driven model, and realizing weighted fusion by setting fusion weight parameters, the combination of recognition results is optimized and the recognition ability of complex and fine-grained pest categories is enhanced.

[0180] It should be noted that, for the sake of simplicity, the aforementioned method embodiments are described as a series of action combinations. However, those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

Claims

1. A method for constructing an agricultural pest dataset and intelligently identifying pests, characterized in that: include: Target species identification: Based on the authoritative list of crop pests and diseases and combined with the actual prevention and control needs of agriculture, determine the types of agricultural pests that need to be identified; Image acquisition and integration: A combination of online crawling and offline photography is used to obtain agricultural pest images from multiple sources, environments, and resolutions. Data cleaning and phased annotation: After standardizing the acquired agricultural pest images, multi-stage annotation is performed to construct an agricultural pest image dataset. This multi-stage annotation includes: based on the needs of agricultural pest control, the biological characteristics of the agricultural pest development cycle are introduced, and agricultural pests with significant ecological differences and significant control differences between adults and larvae are annotated in phases; Multi-view partitioning and sub-dataset generation: Based on the different dimensions of agricultural damage modes and visual morphological characteristics, the agricultural pest image dataset is partitioned from multiple perspectives to construct sub-datasets with corresponding clustering characteristics. The sub-datasets include agricultural sub-datasets and visual sub-datasets. Model training and structure optimization: Based on the constructed agricultural pest image dataset, multiple deep learning models were trained. Feature heatmaps were introduced to enhance learning of foreground areas. At the same time, knowledge from the agricultural and visual sub-datasets was integrated to develop an intelligent agricultural pest recognition model. Intelligent identification and pest status output: Input the pre-processed target agricultural pest image into the agricultural pest intelligent identification model, and output the agricultural pest identification results and multi-dimensional pest status information. The multi-dimensional pest status information includes pest type, density estimation, development stage and damage level.

2. The method for constructing and intelligently identifying an agricultural pest dataset according to claim 1, characterized in that: The data cleaning and phased annotation include: Standardize pest names using Latin scientific names; Clean the data and remove duplicate and substandard images; Taxonomic annotation of adult and larval stages; Build an agricultural pest sample library, covering standard images and classification information of common agricultural pests; Based on the agricultural pest sample library, the image data is labeled and reviewed.

3. The method for constructing an agricultural pest dataset and intelligently identifying pests according to claim 1, characterized in that: The multi-view division and sub-dataset generation include: Based on the agricultural significance classification method, the agricultural pest image dataset is divided into multiple sub-datasets according to the location and method of pest damage to crops; The visual feature-based division method clusters pests according to their image morphological features, and classifies pests with similar appearances into the same sub-dataset.

4. The method for constructing an agricultural pest dataset and intelligently identifying pests according to claim 1, characterized in that: The model training and structure optimization include: Train multiple deep learning models based on the constructed agricultural pest image dataset and select the optimal model through performance comparison; Based on the optimal model screened out, the Grad-CAM mechanism is introduced to focus on the foreground, enhancing the model's attention to the target area and reducing background interference; Foreground-background contrast learning is used to improve feature discrimination and make the features of different pest categories more clustered.

5. The method for constructing an agricultural pest dataset and intelligently identifying pests according to claim 4, characterized in that: The model training and structure optimization also include: By constructing an agricultural knowledge-driven model and a visual feature-driven model, and realizing weighted fusion by setting fusion weight parameters, the combination of recognition results is optimized and the recognition ability of complex and fine-grained pest categories is enhanced.

6. An intelligent agricultural pest identification system, characterized in that: include: The target species identification module is configured to determine the types of agricultural pests that need to be identified based on the authoritative list of crop pests and diseases and the actual prevention and control needs of agriculture; The image acquisition and integration module is configured to use a combination of online crawling and offline real-time shooting to obtain agricultural pest images from multiple sources, multiple environments, and multiple resolutions; The data cleaning and phased annotation module is configured to perform multi-stage annotation on the acquired agricultural pest images after standardization, and to construct an agricultural pest image dataset. The multi-stage annotation includes: introducing the biological characteristics of the agricultural pest development cycle according to the needs of agricultural pest control, and annotating agricultural pests with significant ecological differences and significant control differences between adults and larvae by phase; a multi-view partitioning and sub-dataset generation module configured to perform multi-view partitioning of the agricultural pest image dataset based on different dimensions of agricultural damage modes and visual morphological features, and construct sub-datasets with corresponding clustering features, the sub-datasets including an agricultural sub-dataset and a visual sub-dataset; The model training and structure optimization module is configured to train multiple deep learning models based on the constructed agricultural pest image dataset, introduce feature heat maps to enhance learning of foreground areas, and integrate knowledge from the agricultural and visual sub-datasets to obtain an intelligent agricultural pest recognition model. The intelligent identification and pest status output module is configured to input the preprocessed target agricultural pest image into the agricultural pest intelligent identification model, and output the agricultural pest identification results and multi-dimensional pest status information, which includes pest type, density estimation, development stage and damage level.

7. The intelligent agricultural pest identification system according to claim 6, characterized in that: The data cleaning and phased annotation module is configured as follows: Standardize pest names using Latin scientific names; Clean the data and remove duplicate and substandard images; Taxonomic annotation of adult and larval stages; Build an agricultural pest sample library, covering standard images and classification information of common agricultural pests; Based on the agricultural pest sample library, the image data is labeled and reviewed.

8. The intelligent agricultural pest identification system according to claim 6, characterized in that: The multi-view division and sub-dataset generation module is configured as follows: Based on the agricultural significance classification method, the agricultural pest image dataset is divided into multiple sub-datasets according to the location and method of pest damage to crops; The visual feature-based division method clusters pests according to their image morphological features, and classifies pests with similar appearances into the same sub-dataset.

9. The intelligent agricultural pest identification system according to claim 6, characterized in that: The model training and structure optimization module is configured as follows: Train multiple deep learning models based on the constructed agricultural pest image dataset and select the optimal model through performance comparison; Based on the optimal model screened out, the Grad-CAM mechanism is introduced to focus on the foreground, enhancing the model's attention to the target area and reducing background interference; Foreground-background contrast learning is used to improve feature discrimination and make the features of different pest categories more clustered.

10. The intelligent agricultural pest identification system according to claim 6, characterized in that: The model training and structure optimization module is further configured to: By constructing an agricultural knowledge-driven model and a visual feature-driven model, and realizing weighted fusion by setting fusion weight parameters, the combination of recognition results is optimized and the recognition ability of complex and fine-grained pest categories is enhanced.

Citation Information

Patent Citations

  • Bacterial strain capable of increasing insecticidal effectiveness of biocontrol fungi and construction method thereof

    CN101709270A

  • Specimen-based automatic lepidoptera insect species identification method

    CN102760228A

  • Male and female silkworm chrysalis sorting and counting device based on SIFT (Scale Invariant Feature Transform) feature image

    CN104899595A

  • Efficient and accurate grassland spodoptera frugiperda image recognition method

    CN115713755A

  • Fish disease real-time detection system based on YOLO-v5

    CN116012700A