Agricultural pest dataset construction and intelligent identification method and system
Patent Information
- Application Number
- CN202510527691.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2045-04-25
AI Technical Summary
[0011]综上,现有农业害虫图像数据集在规模、质量及适用性方面均存在局限,严重制约了智能害虫识别系统的性能与实际应用,亟需开发更为系统、科学、实用的大规模农业害虫图像数据资源,以支持农业害虫智能识别技术的深入发展与广泛应用
[0059] (1) This invention constructs a large-scale agricultural pest image dataset (Pest_data) and forms a pest image recognition model based on this dataset, thereby realizing rapid identification and intelligent classification of agricultural pests. This invention is applicable to scenarios such as agricultural pest monitoring, precision pesticide spraying, and crop health assessment, aiming to improve the intelligence and automation level of agricultural production and achieve efficient and accurate pest monitoring and control.
Smart Images

Figure CN120451647B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of agricultural informatization and artificial intelligence technology, and in particular to a method and system for constructing and intelligently identifying agricultural pest datasets. Background Technology
[0002] Statistics show that pests account for approximately 38% of global agricultural yield losses. Accurate pest identification is a prerequisite for effective control. However, agricultural pests are diverse, have complex life cycles, and operate in variable field environments. Furthermore, some pests possess strong camouflage abilities, making pest identification challenging and difficult to guarantee accuracy.
[0003] Traditional pest identification methods mainly rely on on-site inspections by agricultural experts, making judgments through manual observation. These methods are not only costly and time-consuming, but also difficult to implement in large-scale agricultural production. Furthermore, because many agricultural workers lack systematic pest identification skills, they often rely on experience to apply pesticides, leading to overuse. This not only increases the risk of pest resistance but also 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 powerful performance in multiple fields, potentially helping agricultural practitioners achieve automated pest identification and control. However, the effective training of deep learning models heavily relies on large-scale, high-quality labeled datasets. Despite the abundance of internet image resources, high-quality datasets precisely labeled by professionals are still lacking in the specific application area of agricultural pest identification, thus limiting the practical application and promotion of intelligent identification systems.
[0005] Constructing image datasets of agricultural pests faces numerous technical challenges. First, pests exhibit significant morphological differences across their life cycle stages (e.g., egg, larva, pupa, adult); some pests also show differences in color or shape between male and female individuals. Furthermore, different species exhibit high visual similarity, and the pests' excellent camouflage and wide geographical distribution make image acquisition and accurate annotation complex and time-consuming. These factors result in limitations in the scale, quality, and diversity of existing agricultural pest datasets, 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 in recent years. Although many researchers have continuously invested in this field, promoting the development of agricultural pest data resources, existing datasets still have shortcomings in terms of the number of species, sample size, and differentiation between adults and larvae. For example, some datasets only cover pest information for specific regions or crops, have a limited total sample size, and insufficient average sample size, making it difficult to support the training of high-performance models.
[0007] Table 1 - Overview of agricultural pest image datasets in recent years
[0008] 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 is not uniform. Some datasets lack standardized collection and annotation processes, resulting in problems such as low image quality and inaccurate annotations, which seriously affect the generalization ability of the models. For example, the IP102 dataset, which was once widely used, was questioned as "dirty data" because it contained a large number of mislabeled samples. Its cleaned version, HQIP102, had a drastically reduced number of samples, with only more than 40,000 images remaining, averaging less than 500 images per class.
[0010] Furthermore, most datasets fail to provide detailed classifications of the different developmental stages of pests, often grouping adults and larvae together and ignoring their differences in morphological characteristics and control methods. For example, bollworm larvae are typically controlled through chemical or biological means, while adults require techniques such as pheromone trapping or interference with mating. Ignoring life cycle differences not only affects identification accuracy but also limits the model's application value in precision pest control. Even in datasets that label adults and larvae, the basis and standards for labeling are not clearly explained.
[0011] In summary, existing agricultural pest image datasets have limitations in terms of 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 intelligent agricultural pest identification technology. Summary of the Invention
[0012] To address the aforementioned problems, this invention proposes a method and system for constructing and intelligently identifying agricultural pest datasets. A large-scale agricultural pest image dataset (Pest_data) is constructed, and an image recognition model is developed based on this dataset, thereby achieving rapid identification and intelligent classification of agricultural pests. This invention is applicable to scenarios such as agricultural pest monitoring, precision pesticide spraying, and crop health assessment, aiming to improve the intelligence and automation level of agricultural production and achieve efficient and accurate pest monitoring and control.
[0013] The technical solution adopted in this invention is as follows:
[0014] A method for constructing and intelligently identifying agricultural pest datasets includes:
[0015] Target species identification: Based on the authoritative list of crop diseases and pests, and in combination with the actual agricultural prevention and control needs, determine the types of agricultural pests that need to be identified;
[0016] Image acquisition and integration: A combination of online crawling and offline shooting was used to acquire agricultural pest images from multiple sources, in multiple environments, and at multiple resolutions;
[0017] Data cleaning and phased annotation: After standardizing the acquired agricultural pest images, multi-stage annotation is implemented, and an agricultural pest image dataset is constructed. The multi-stage annotation includes: according to the needs of agricultural pest control, the biological characteristics of the agricultural pest development cycle are introduced, and phased annotation is performed for agricultural pests that have significant ecological differences and significant control differences between adults and larvae.
[0018] Multi-view segmentation and subset generation: Based on different dimensions of agricultural damage methods and visual morphological features, the agricultural pest image dataset is segmented from multiple perspectives to construct subsets with corresponding clustering features. The subsets include agricultural subsets and visual subsets.
[0019] Model training and structure optimization: Based on the constructed agricultural pest image dataset, various deep learning models are trained, and feature heatmaps are introduced to enhance the learning of foreground regions. At the same time, knowledge from agricultural and visual subsets is integrated to obtain an intelligent agricultural pest recognition model.
[0020] Intelligent identification and pest output: 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 information, including pest species, density estimation, development stage and damage level.
[0021] Furthermore, the data cleaning and phased annotation include:
[0022] The names of pests are standardized using Latin scientific names;
[0023] Clean the data, removing duplicate and substandard images;
[0024] Classify and annotate the adult and larval stages;
[0025] Construct an agricultural pest sample library, covering standard images and classification information of common agricultural pests;
[0026] Based on an agricultural pest sample database, image data is labeled and reviewed.
[0027] Furthermore, the multi-view partitioning and subset generation includes:
[0028] Based on the classification method of agricultural significance, the agricultural pest image dataset is divided into multiple sub-datasets according to the parts and methods of damage caused by pests to crops.
[0029] The visual feature-based segmentation method clusters pests according to their image morphological features, grouping pests with similar appearances into the same sub-dataset.
[0030] Furthermore, the model training and structure optimization include:
[0031] Multiple deep learning models were trained based on a constructed dataset of agricultural pest images, and the optimal model was selected through performance comparison.
[0032] Based on the selected optimal model, the Grad-CAM mechanism is introduced to focus on the foreground, enhance the model's attention to the target area and reduce background interference;
[0033] Foreground-background contrast learning is used to improve feature discrimination, making 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 by setting fusion weight parameters to achieve weighted fusion, the combination of recognition results is optimized, thereby enhancing the ability to identify complex and fine-grained pest categories.
[0036] An intelligent identification system for agricultural pests, comprising:
[0037] The target species determination module is configured to determine the types of agricultural pests to be identified based on authoritative lists of crop diseases and pests and in combination with actual agricultural prevention and control needs.
[0038] The image acquisition and integration module is configured to use a combination of online crawling and offline real-world shooting to acquire agricultural pest images from multiple sources, in multiple environments, and at 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 processing, and to construct an agricultural pest image dataset. The multi-stage annotation includes: according to the needs of agricultural pest control, introducing the biological characteristics of the agricultural pest development cycle, and performing phased annotation on agricultural pests that have significant ecological differences and significant control differences between adults and larvae.
[0040] The multi-view segmentation and subset generation module is configured to segment the agricultural pest image dataset from multiple perspectives based on different dimensions of agricultural damage methods and visual morphological features, and construct subsets with corresponding clustering features. The subsets include agricultural subsets and visual subsets.
[0041] The model training and structure optimization module is configured to train multiple deep learning models based on the constructed agricultural pest image dataset, and introduce feature heatmaps to enhance the learning of foreground regions. At the same time, it integrates the knowledge of agricultural subsets and visual subsets to obtain an intelligent agricultural pest recognition model.
[0042] The intelligent identification and pest output module is configured to input preprocessed target agricultural pest images into the agricultural pest intelligent identification model, and output agricultural pest identification results and multi-dimensional pest information, including pest species, density estimation, development stage and damage level.
[0043] Furthermore, the data cleaning and phased annotation module is configured as follows:
[0044] The names of pests are standardized using Latin scientific names;
[0045] Clean the data, removing duplicate and substandard images;
[0046] Classify and annotate the adult and larval stages;
[0047] Construct an agricultural pest sample library, covering standard images and classification information of common agricultural pests;
[0048] Based on an agricultural pest sample database, image data is labeled and reviewed.
[0049] Furthermore, the multi-view partitioning and subset generation module is configured as follows:
[0050] Based on the classification method of agricultural significance, the agricultural pest image dataset is divided into multiple sub-datasets according to the parts and methods of damage caused by pests to crops.
[0051] The visual feature-based segmentation method clusters pests according to their image morphological features, grouping pests with similar appearances into the same sub-dataset.
[0052] Furthermore, the model training and structure optimization module is configured as follows:
[0053] Multiple deep learning models were trained based on a constructed dataset of agricultural pest images, and the optimal model was selected through performance comparison.
[0054] Based on the selected optimal model, the Grad-CAM mechanism is introduced to focus on the foreground, enhance the model's attention to the target area and reduce background interference;
[0055] Foreground-background contrast learning is used to improve feature discrimination, making the features of different pest categories more clustered.
[0056] Furthermore, the model training and structure optimization module is also configured as follows:
[0057] By constructing an agricultural knowledge-driven model and a visual feature-driven model, and by setting fusion weight parameters to achieve weighted fusion, the combination of recognition results is optimized, thereby enhancing the ability to identify complex and fine-grained pest categories.
[0058] The beneficial effects of this invention are as follows:
[0059] (1) This invention constructs a large-scale agricultural pest image dataset (Pest_data) and forms a pest image recognition model based on this dataset, thereby realizing rapid identification and intelligent classification of agricultural pests. This invention is applicable to scenarios such as agricultural pest monitoring, precision pesticide spraying, and crop health assessment, aiming to improve the intelligence and automation level of agricultural production and achieve efficient and accurate pest monitoring and control.
[0060] (2) This invention uses a trained deep learning model to perform inference and recognition on collected images. The model is trained on a large-scale agricultural pest image dataset (Pest_data) and has strong image recognition capabilities and adaptability. This invention supports on-site image acquisition and local upload, adapts to various agricultural application scenarios, has high recognition accuracy, and fast response speed. Users can quickly obtain pest details and control suggestions through the system, effectively improving pest identification efficiency and the scientific nature of pest control.
[0061] (3) This invention supports the recording, monitoring, and early warning of pest occurrences, enabling agricultural management units to grasp regional pest dynamics in real time and scientifically formulate control strategies. Simultaneously, it supports expert interaction and pest discussion functions, enhancing user experience and system intelligence. Furthermore, it supports user image filtering and database update functions, allowing for continuous expansion of training samples through user-uploaded images, optimizing model performance, and achieving system self-iteration and continuous upgrading. Attached Figure Description
[0062] Figure 1 This is a flowchart of an agricultural pest dataset construction and intelligent identification method according to Embodiment 1 of the present invention.
[0063] Figure 2 This is a flowchart of the image acquisition process in Embodiment 1 of the present invention.
[0064] Figure 3 This is a data annotation flowchart of Embodiment 1 of the present invention.
[0065] Figure 4 This is an example diagram of the adult and larval insects of Embodiment 1 of the present invention that requires separate annotation.
[0066] Figure 5 This is a flowchart of model optimization and multi-model weighted fusion identification in Embodiment 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 Implementation
[0068] To provide a clearer understanding of the technical features, objectives, and effects of the present invention, specific embodiments are now described. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention; that is, the described embodiments are only a part of the embodiments of the invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0069] Example 1
[0070] like Figure 1 As shown in the figure, this embodiment provides a method for constructing and intelligently identifying agricultural pest datasets, including:
[0071] Target species identification: Based on the authoritative list of crop diseases and pests, and in combination with the actual agricultural prevention and control needs, determine the types of agricultural pests that need to be identified;
[0072] Image acquisition and integration: A combination of online crawling and offline shooting was used to acquire agricultural pest images from multiple sources, in multiple environments, and at multiple resolutions;
[0073] Data cleaning and phased annotation: After standardizing the acquired agricultural pest images, multi-stage annotation was implemented, and an agricultural pest image dataset was constructed. The multi-stage annotation included: based on the needs of agricultural pest control, the biological characteristics of the agricultural pest development cycle were introduced, and phased annotation was performed for agricultural pests with significant ecological differences and significant control differences between adults and larvae.
[0074] Multi-view segmentation and subset generation: Based on different dimensions of agricultural damage methods and visual morphological features, the agricultural pest image dataset is segmented from multiple perspectives to construct subsets with corresponding clustering features. The subsets include agricultural subsets and visual subsets.
[0075] Model training and structure optimization: Based on the constructed agricultural pest image dataset, various deep learning models are trained, and feature heatmaps are introduced to enhance the learning of foreground regions. At the same time, knowledge from agricultural and visual subsets is integrated to obtain an intelligent agricultural pest recognition model.
[0076] Intelligent identification and pest output: 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 information, including pest species, density estimation, development stage and damage level.
[0077] Preferably, data cleaning and phased annotation include: standardizing the names of pests using Latin scientific names; cleaning the data and removing duplicate and substandard images; classifying and annotating the adult and larval stages; constructing an agricultural pest sample library that covers standard images and classification information of common agricultural pests; and annotating and reviewing the image data based on the agricultural pest sample library.
[0078] Preferably, the multi-view segmentation and sub-dataset generation includes: a segmentation method based on agricultural significance, which divides the agricultural pest image dataset into multiple sub-datasets according to the parts and methods of damage caused by pests to crops; and a segmentation method based on visual features, which clusters pests based on their image morphological features, grouping pests with similar appearances into the same sub-dataset.
[0079] Preferably, model training and structure optimization include: training multiple deep learning models based on the constructed agricultural pest image dataset, and selecting the optimal model through performance comparison; based on the selected optimal model, introducing the Grad-CAM mechanism to focus on the foreground, enhancing the model's attention to the target area and reducing background interference; and using foreground-background contrast learning to improve feature discrimination, making the features of different pest categories more clustered.
[0080] Preferably, model training and structure optimization further include: constructing an agricultural knowledge-driven model and a visual feature-driven model, and achieving weighted fusion by setting fusion weight parameters to optimize the combination of recognition results and enhance the ability to recognize complex 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 Identification: Determine the agricultural pest species targeted by the identification system. The proper identification of pest species is a prerequisite for crop pest and disease research, identification system development, and precision agriculture applications. Because there are numerous types 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 damaging to crops, widely distributed, and highly destructive. Preferably, authoritative data such as the "List of First-Class Crop Pests and Diseases of the People's Republic of China" and regional lists of serious pests can be used to select pests that have a significant impact on agricultural production as identification targets, ensuring that the system construction has high practicality and promotional value.
[0083] S2. Image Acquisition: such as... Figure 2As shown, a combined online and offline image acquisition strategy was adopted to obtain a wide range of diverse images of pests to be annotated, providing data support for subsequent model training. For online acquisition, the Latin, English, Chinese names, and common aliases (including local colloquialisms) of pests were entered into search engines as keywords to automatically collect relevant images. The uniqueness of Latin names ensures image accuracy and avoids identification bias caused by name ambiguity; multilingual names expand the search coverage and improve the comprehensiveness of image acquisition. Through this strategy, approximately 500,000 images covering various agricultural pests were obtained, laying a solid foundation for the construction of a high-quality dataset.
[0084] S3. Data annotations: such as Figure 3 As shown, a multi-step annotation process was employed to meticulously annotate the collected image data, including key information such as pest species names, image shooting environment, shooting angle, and pest developmental stage. After rigorous verification and consistency checks, a high-quality agricultural pest image dataset, named Pest_data, was constructed for model training and performance evaluation.
[0085] S4. Multi-view Dataset Partitioning: To improve the model's ability to identify fine-grained pest species, agricultural and visual perspective classification methods were constructed based on agricultural attribute features and visual features, respectively. Through this multi-view partitioning strategy, subsets with different clustering dimensions were generated.
[0086] S5. Deep Learning Model Evaluation and Optimization: After the dataset is constructed, several 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 that performs best in the agricultural pest identification task is selected, providing a model foundation for system integration.
[0087] S6. Model Optimization and Multi-Model Fusion Recognition: Based on the selection of the optimal model suitable for agricultural pest recognition, to further improve the model's recognition performance in complex image scenes, a Grad-CAM mechanism is introduced for foreground focusing. 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 achieving weighted fusion by setting fusion weight parameters, the combination of recognition results is optimized, enhancing the recognition ability for complex, fine-grained pest categories, thus forming a pest recognition method based on multi-model weighted fusion. This method revolves around the synergistic effect of agricultural expertise and fine-grained image features from computer vision. Based on this, the agricultural knowledge-driven model and the visual feature-driven model are trained separately. Finally, by setting adjustable fusion weight parameters through a weighted fusion strategy, the optimal weighted combination of the multi-model output results is achieved, thereby effectively enhancing the recognition ability for complex, fine-grained pest categories while maintaining high recognition accuracy.
[0088] S7. Intelligent Recognition: Based on a trained deep learning model, it integrates image acquisition, recognition reasoning, and result feedback to achieve efficient identification and classification of agricultural pests. It supports deployment in real-world agricultural scenarios and possesses high recognition accuracy and promising prospects for widespread application.
[0089] Preferably, to further enhance the diversity and adaptability of image data, step S2, image acquisition, incorporates an offline acquisition process. Specific acquisition methods include: using high-resolution imaging equipment to capture images of pests in different regions, crop growth cycles, and from various shooting angles; field monitoring images provided by cooperating farmers and agricultural extension stations; and publicly released image data resources from agricultural research institutions. These methods effectively compensate for the shortcomings of online acquisition in terms of environmental conditions, light variations, and different developmental stages of pests, thereby enhancing the authenticity and representativeness of the dataset.
[0090] Preferably, step S3, i.e., data annotation, includes the following sub-steps:
[0091] S31: Use Latin scientific nomenclature to standardize the names of pests to ensure data consistency.
[0092] Specifically, pests often have multiple alternative names in both Chinese and English. For example, rice leaf roll is also called riceleave folder; longan cicada is also called longan wax cicada, yellow worm, long-nosed worm, etc., which can lead to confusion. In contrast, Latin scientific names are unique and standardized, making them more reliable identifiers in datasets. Therefore, the instance pest image dataset (Pest_data) constructed in this embodiment uses Latin names as pest labels to avoid ambiguity. This approach ensures the consistency of the entire dataset and promotes global scientific communication, preventing confusion caused by language differences.
[0093] S32: Clean up data, delete duplicate images, and avoid redundant interference.
[0094] Specifically, during online data collection, many duplicate images are inevitably collected. To minimize the impact of duplicate images, this embodiment uses a pre-trained ResNet50 deep learning model to extract feature vectors from the collected images. The feature extraction formula is as follows:
[0095] f i =F(I i )
[0096] Among them, f i Let F represent the image feature vector, and let I represent the general feature extraction model (e.g., ResNet, DenseNet). i This 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 · denotes the dot product, ||f j || represents the norm of a vector.
[0100] Specifically, in this embodiment, feature extraction uses a pre-trained ResNet50 model. The image is resized to 224x224 resolution, converted to a tensor, and normalized. The batch size is set to 256. A similarity threshold of 0.90 is established, where sim(f) satisfies the following condition. i ,f j Image pairs with I > 0.90 were identified as duplicates (i.e., I i and I j (Images considered duplicates). The threshold of 0.90 was determined through extensive testing to ensure that most duplicate pairs are detected accurately while minimizing the number of false positives.
[0101] S33: Distinguish between adult and larval stages to meet the needs of precise control of adult and larval stages.
[0102] Specifically, there exists a group of agricultural pests whose adult and larval stages not only differ completely in morphology and appearance, but also in their modes of damage and prevention methods. Therefore, when constructing the dataset, these pests need to be annotated separately to meet the needs of targeted control in practical applications.
[0103] Specifically, regarding the distinction between adults and larvae, using longhorn beetles as an example, please refer to [link to relevant documentation]. Figure 4This embodiment provides an example of the need to distinguish between adult and larval pests, illustrating under what circumstances the adult and larval pests should be annotated separately.
[0104] Specifically, in the example `Pest_data` of this embodiment, whether to distinguish between adults and larvae depends primarily on the following three key points: 1. Significant morphological and behavioral differences; 2. Significant differences in control methods. When larvae and adults of the same species require different control measures, their stages are usually distinguished in the dataset. For example, Bacillus thuringiensis (Bt) toxins target lepidopteran larvae but are ineffective against adults. Without stage differentiation, it is difficult to implement effective and targeted pest management strategies. 3. Life cycle consistency. For example, pests such as aphids and thrips exhibit small differences between life stages, meaning 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: Construct an agricultural pest sample bank to improve the authority and accuracy of the data.
[0106] Specifically, agricultural expertise was integrated throughout the entire process of building the Pest_data dataset, from image selection and annotation criteria to quality validation. Agricultural pest experts selected 10 high-quality images from each category. These images were chosen for their high resolution, clarity and unobstructed views, simple backgrounds, and high proportion of pests (more than 50% coverage). It played a central role in three key stages: 1. Species identification: using visual features to differentiate visually similar species, such as the arrangement of larval spots, wing patterns, and body structure; 2. Biomarker description: experts guided the annotation team to identify key biomarkers of pests at different stages; 3. Exclusion of outliers: experts identified outliers (such as those affected by parasites or deformed by environmental factors) to prevent noisy data.
[0107] S35: Annotate the collected image data based on an agricultural pest sample bank.
[0108] Specifically, an agricultural pest sample database was used as a reference for annotating the collected dataset. Taking the Pest_data dataset as an example in this embodiment, it and the expert database were divided into 18 groups, each containing 9 pest categories. Undergraduate and graduate students majoring in agriculture were responsible for annotating the dataset, 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 erroneous annotation. Images that remained unclear after these rounds were placed in the "Unannotated" folder for further review.
[0109] S36: Perform a second review after the initial annotations to ensure there are no omissions or errors.
[0110] Specifically, after the initial annotation, a secondary review is conducted to identify any remaining inaccuracies. A new group of agricultural students re-examines the entire dataset, bringing fresh perspectives to the annotation process. This step aims to identify any potential errors or inconsistencies that might have been overlooked during the initial review. Any uncertain or problematic images are again placed in the "To be Annotated" folder for further review. This step, as an additional layer of quality assurance, significantly improves 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 undergo a final expert review. This review is conducted by a team of experts with experience in agricultural pest identification, aiming to effectively resolve any uncertainties or potential annotation errors in the images, thereby ensuring the accuracy and consistency of the data annotation. This process provides crucial assurance for the quality control of the dataset, ultimately generating high-quality, accurate, and reliable annotated data.
[0113] Through the aforementioned image acquisition, filtering, annotation, and quality control processes, an agricultural pest image dataset, named Pest_data, was constructed for training deep learning models. This dataset is currently the largest and most comprehensive publicly available agricultural pest image dataset, possessing significant practical and research value.
[0114] In step S4, the constructed Pest_data dataset is divided from multiple perspectives. This step integrates agricultural knowledge with visual feature information, dividing the dataset into sub-datasets based on different perspectives, resulting in two classification methods: one is a classification based on agricultural significance, focusing on the ecological attributes and actual damage of pests; the other is a classification based on visual features, focusing on the image morphological features of pests. This division method facilitates multi-angle research on recognition tasks, improving the model's feature extraction capabilities and recognition performance.
[0115] Preferably, step S4, which is the multi-view partitioning of the dataset, includes the following steps:
[0116] S41: Agriculture-based subset partitioning. This partitioning method organizes pest images according to the actual damage types and ecological behaviors of pests in agricultural production, dividing them into four main superclasses based on the affected crop parts and damage patterns. This classification method meets the needs of integrated pest management in agriculture and helps guide field control strategies.
[0117] Specifically, pests can be divided into the following four agricultural subsets:
[0118] Soil pests (SP): These pests spend most of their life cycle in the soil, primarily damaging the underground parts of plants, seeds, seedlings, or the main stem 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, and in severe cases can cause large-scale crop death, resulting in significant economic losses. Representative species include longhorn beetle larvae and weevils.
[0120] Sucking pests (SuP): These pests obtain nutrients by sucking plant sap. They have a high reproductive rate, are widely distributed, often causing large-scale damage, and can also transmit viruses, leading to sooty mold and other diseases. Typical pests include aphids, leafhoppers, and spider mites.
[0121] Leaf-eating pests (LEPs): These pests mainly feed on plant leaves. They are diverse in species and exist in large numbers, with moth and butterfly larvae being representative examples.
[0122] S42: Subset partitioning based on visual features. This classification groups pests according to the similarity of their image appearance, grouping species with similar visual features into the same category. This provides a clear training objective for model feature extraction and optimization, improving recognition performance.
[0123] Specifically, Pest_data can be divided into the following four subsets:
[0124] MB54: Contains 54 species with wing-like structures, which are morphologically similar to moths and butterflies.
[0125] LA42: Contains 42 species of soft-bodied, slender pests, commonly found in larval stages.
[0126] BE43: Includes 43 species of pests with exoskeletons and segmented body structures, such as beetles.
[0127] Co23: Contains 23 pests that do not belong to the above three categories, making it suitable as a sample for general visual recognition tasks.
[0128] The Pest_data dataset, constructed based on the above process, provides high-quality data support for the subsequent training of deep learning-based pest identification models. This dataset features comprehensive species coverage, high-quality annotations, and a classification strategy that integrates agricultural and visual features, playing a crucial role in model training and performance evaluation. The specific structure of the dataset is shown in Table 2.
[0129] Table 2 - Pest_data Data Structure
[0130]
[0131] Preferably, in step S5, which is the evaluation and selection of deep learning models, the current advanced deep learning models are 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 selected through multi-model comparison and evaluation, laying the foundation for subsequent performance optimization.
[0132] Specifically, six typical deep learning methods were selected, including ResNet (Residual Network), DenseNet (Densely Connected Convolutional Network), MobileNetV3, ViT (Vision Transformer), SwinTransformer, and ConvMixer, to comprehensively evaluate the Pest_data dataset. The selection of these models aimed to verify the applicability and effectiveness of Pest_data, covering classic convolutional neural networks (such as ResNet and DenseNet), lightweight models (such as MobileNetV3), Transformer-based architectures (such as ViT and SwinTransformer), and hybrid methods combining convolution and hybrid mechanisms (ConvMixer). This diverse range of model architectures enabled a comprehensive evaluation of the dataset, demonstrating its practicality and generalization ability in pest identification 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 identification, such as... Figure 5 As shown, the SwinTransformer-based model incorporates a Grad-CAM mechanism for foreground focusing, enhancing the model's attention to the target region and reducing background interference. Simultaneously, foreground-background contrastive learning is employed to improve feature discriminative power, making features of different pest categories more clustered, thereby improving classification accuracy. Furthermore, a weighted fusion strategy allows for adjustable fusion weight parameters, fusing 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. Based on selecting the optimal model suitable for agricultural pest recognition tasks, the potential of agricultural and visual subset partitioning in pest recognition performance is further explored.
[0134] Specifically, such as Figure 5 As shown in (a), the Grad-CAM mechanism is introduced for foreground focusing, generating an activation map based on the gradient information of the target category. This activation heatmap highlights regions related to the target category, thereby achieving foreground focusing, reducing background interference, and improving the model's ability to focus on the target region. The gradient of each category relative to feature map A is calculated:
[0135]
[0136] Among them, A k Let H represent the feature map of the k-th channel, where H and W are the height and width of the feature map, respectively.
[0137] Obtain channel weighting coefficients Next, calculate the gradient heatmap:
[0138]
[0139] In the feature space, we want the features of samples of the same category (especially the same foreground) to be as close as possible, while the features of samples of different categories (or foreground and background) to be as far apart as possible. To this end, this embodiment introduces a loss function based on contrastive learning, the mathematical expression of which is:
[0140]
[0141] Among them, z i and z j Let y be the feature vector of two samples; ij =1 indicates that the two belong to the same foreground, y ij =0 indicates different foregrounds; d(z) i ,z j ) is the Euclidean distance; m is the preset margin, which controls the minimum interval between different samples.
[0142] Specifically, for multi-model weighted fusion recognition, see, for example... Figure 5 (d) shows the parallel training and fusion process of the three models. First, as... Figure 5 As shown in (b), the agricultural knowledge-driven model (Model-Agr) is based on agricultural subsets, classifying pests into four categories (SP, BP, SuP, LEP), and training a dedicated classifier for each subset. During recognition, the input image is first determined to belong to its agricultural subcategory by the four-class classifier, and then passed to the corresponding subcategory classifier for fine-grained recognition. Similarly, as... Figure 5 As shown in (c), the visual feature-driven model (Model-Vis) constructs a classifier based on visual subsets (MB54, LA42, BE43, Co23) and employs the same hierarchical recognition strategy. Figure 5 (a) involves directly training a model based on Pest_data (model-Pest_data) on the complete dataset. Weighted fusion of the results from multiple models can effectively improve the accuracy of pest identification.
[0143] This method focuses on the synergistic effect of agricultural expertise and fine-grained image features from computer vision. Based on this, an agricultural knowledge-driven model and a visual feature-driven model are trained separately. Finally, by setting adjustable fusion weight parameters through a weighted fusion strategy, the optimal weighted combination of the output results from multiple models is achieved, thereby effectively enhancing the system's ability to identify complex, fine-grained pest categories while maintaining high recognition accuracy.
[0144] Preferably, in step S7, i.e., intelligent identification, based on the aforementioned trained deep learning model, rapid identification and accurate classification of agricultural pests are achieved through image acquisition, recognition reasoning, and result feedback. In this embodiment, on-site images are acquired using camera equipment or uploaded local images. After data preprocessing and model reasoning, the identification results are output, along with 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 in the figure, this embodiment provides an intelligent identification system for agricultural pests, including a homepage module, a user module, a camera module, an interaction 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 about nearby users and recommends relevant science and technology knowledge about pest control based on regional pest data and user browsing habits, so as to achieve knowledge sharing and user guidance.
[0149] The user module includes registration and login functions. After registering and logging in, users can access the account management interface, connect to the backend database, and filter and manage pest images. Filtered images are used to expand the pest image database, while also supporting image privacy protection measures. The expanded images are used to train deep learning models, thereby continuously improving the model's recognition accuracy and robustness.
[0150] Camera module: Provides two image acquisition methods: on-site shooting and local upload. The acquired images are transmitted to the backend database, where they undergo format conversion and preprocessing by the data processing module. They then enter the pest identification module for model inference and finally output the identification results.
[0151] Identification Result Module: After the identification results are output, users can choose whether to ask questions about the results. If there are questions, the system will guide the user to the interactive module; if there are no questions, the user will be taken to the pest details page, which displays the morphological characteristics, damage symptoms and control methods of the identified pest.
[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 detection functions. The system can record the geographical information of pest occurrences, update it to the pest monitoring and early warning system, realize regional pest data statistics and early warning release, and facilitate agricultural management and pest control.
[0154] In this embodiment, the system uses a trained deep learning model to perform inference and recognition on the acquired images. The model is trained on the Pest_data large-scale agricultural pest image dataset and possesses strong image recognition capabilities and adaptability. The system supports on-site image acquisition and local upload, adapts to various agricultural application scenarios, and boasts high recognition accuracy and fast response speed. Users can quickly obtain pest details and control suggestions through the system, effectively improving pest identification efficiency and the scientific basis of pest control.
[0155] This system supports the recording, monitoring, and early warning of pest occurrences, enabling agricultural management units to grasp regional pest dynamics in real time and formulate scientific control strategies. Simultaneously, the system supports expert interaction and pest discussion functions, enhancing user experience and the system's intelligence level. Furthermore, the system supports user image filtering and database update functions, allowing for continuous expansion of training samples through user-uploaded images, optimizing model performance, and achieving self-iteration and continuous upgrading of the system.
[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 collected images and implement pest occurrence recording and pest monitoring and early warning functions within the monitoring and early warning system. The system boasts high accuracy, fast response speed, and promising prospects for widespread application, providing intelligent technical support for agricultural pest control.
[0157] Example 3
[0158] This embodiment provides an intelligent identification system for agricultural pests, including:
[0159] The target species determination module is configured to determine the types of agricultural pests to be identified based on authoritative lists of crop diseases and pests and in combination with actual agricultural prevention and control needs.
[0160] The image acquisition and integration module is configured to use a combination of online crawling and offline shooting to acquire agricultural pest images from multiple sources, in multiple environments, and at 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 processing, and to construct an agricultural pest image dataset. The multi-stage annotation includes: according to the needs of agricultural pest control, introducing the biological characteristics of the agricultural pest development cycle, and performing phased annotation on agricultural pests with significant ecological differences and significant control differences between adults and larvae.
[0162] The multi-view segmentation and subset generation module is configured to segment the agricultural pest image dataset from multiple perspectives based on different dimensions of agricultural damage methods and visual morphological features, and construct subsets with corresponding clustering features. The subsets include agricultural subsets and visual subsets.
[0163] The model training and structure optimization module is configured to train multiple deep learning models based on the constructed agricultural pest image dataset, and introduce feature heatmaps to enhance the learning of foreground regions. At the same time, it integrates the knowledge of agricultural subsets and visual subsets to obtain an intelligent agricultural pest recognition model.
[0164] The intelligent identification and pest output module is configured to input preprocessed images of target agricultural pests into the intelligent agricultural pest identification model, and output agricultural pest identification results and multi-dimensional pest information, including pest species, density estimation, developmental stage and damage level.
[0165] Preferably, the data cleaning and phased annotation module is configured as follows:
[0166] The names of pests are standardized using Latin scientific names;
[0167] Clean the data, removing duplicate and substandard images;
[0168] Classify and annotate the adult and larval stages;
[0169] Construct an agricultural pest sample library, covering standard images and classification information of common agricultural pests;
[0170] Based on an agricultural pest sample database, image data is labeled and reviewed.
[0171] Preferably, the multi-view partitioning and subset generation module is configured as follows:
[0172] Based on the classification method of agricultural significance, the agricultural pest image dataset is divided into multiple sub-datasets according to the parts and methods of damage caused by pests to crops.
[0173] The visual feature-based segmentation method clusters pests according to their image morphological features, grouping pests with similar appearances into the same sub-dataset.
[0174] Preferably, the model training and structure optimization module is configured as follows:
[0175] Multiple deep learning models were trained based on a constructed dataset of agricultural pest images, and the optimal model was selected through performance comparison.
[0176] Based on the selected optimal model, the Grad-CAM mechanism is introduced to focus on the foreground, enhance the model's attention to the target area and reduce background interference;
[0177] Foreground-background contrast learning is used to improve feature discrimination, making the features of different pest categories more clustered.
[0178] Preferably, the model training and structure optimization module is further configured as follows:
[0179] By constructing an agricultural knowledge-driven model and a visual feature-driven model, and by setting fusion weight parameters to achieve weighted fusion, the combination of recognition results is optimized, thereby enhancing the ability to identify complex and fine-grained pest categories.
[0180] It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
Claims
1. A method for constructing and intelligently identifying agricultural pest datasets, characterized in that, include: Target species identification: Based on the authoritative list of crop diseases and pests, and in combination with the actual agricultural prevention and control needs, determine the types of agricultural pests that need to be identified; Image acquisition and integration: A combination of online crawling and offline shooting was used to acquire agricultural pest images from multiple sources, in multiple environments, and at multiple resolutions; Data cleaning and phased annotation: After standardizing the acquired agricultural pest images, multi-stage annotation is implemented, and an agricultural pest image dataset is constructed. The multi-stage annotation includes: according to the needs of agricultural pest control, the biological characteristics of the agricultural pest development cycle are introduced, and phased annotation is performed for agricultural pests that have significant ecological differences and significant control differences between adults and larvae. Multi-view segmentation and subset generation: Based on different dimensions of agricultural damage methods and visual morphological features, the agricultural pest image dataset is segmented from multiple perspectives to construct subsets with corresponding clustering features. The subsets include agricultural subsets and visual subsets. Model training and structure optimization: Based on the constructed agricultural pest image dataset, various deep learning models are trained, and feature heatmaps are introduced to enhance the learning of foreground regions. At the same time, knowledge from agricultural and visual subsets is integrated to obtain an intelligent agricultural pest recognition model. Intelligent identification and pest output: 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 information, including pest species, density estimation, development stage and damage level; The multi-view segmentation and sub-dataset generation include: Based on the classification method of agricultural significance, the agricultural pest image dataset is divided into multiple sub-datasets according to the parts and methods of damage caused by pests to crops. The visual feature-based segmentation method clusters pests according to their image morphological features, grouping pests with similar appearances into the same subset. The model training and structure optimization include: Multiple deep learning models were trained based on a constructed dataset of agricultural pest images, and the optimal model was selected through performance comparison. Based on the selected optimal model, the Grad-CAM mechanism is introduced to focus on the foreground, enhance the model's attention to the target area and reduce background interference; Foreground-background contrast learning is used to improve feature discrimination, making the features of different pest categories more clustered; The model training and structure optimization also include: constructing an agricultural knowledge-driven model and a visual feature-driven model, and achieving weighted fusion by setting fusion weight parameters to optimize the combination of recognition results and enhance the ability to recognize complex and fine-grained pest categories.
2. The method for constructing and intelligently identifying agricultural pest datasets according to claim 1, characterized in that, The data cleaning and phased annotation include: The names of pests are standardized using Latin scientific names; Clean the data, removing duplicate and substandard images; Classify and annotate the adult and larval stages; Construct an agricultural pest sample library, covering standard images and classification information of common agricultural pests; Based on an agricultural pest sample database, image data is labeled and reviewed.
3. An intelligent identification system for agricultural pests, characterized in that, include: The target species determination module is configured to determine the types of agricultural pests to be identified based on authoritative lists of crop diseases and pests and in combination with actual agricultural prevention and control needs. The image acquisition and integration module is configured to use a combination of online crawling and offline shooting to acquire agricultural pest images from multiple sources, in multiple environments, and at multiple resolutions. The data cleaning and phased annotation module is configured to perform multi-stage annotation on the acquired agricultural pest images after standardization processing, and to construct an agricultural pest image dataset. The multi-stage annotation includes: according to the needs of agricultural pest control, introducing the biological characteristics of the agricultural pest development cycle, and performing phased annotation on agricultural pests that have significant ecological differences and significant control differences between adults and larvae. The multi-view segmentation and subset generation module is configured to segment the agricultural pest image dataset from multiple perspectives based on different dimensions of agricultural damage methods and visual morphological features, and construct subsets with corresponding clustering features. The subsets include agricultural subsets and visual subsets. The model training and structure optimization module is configured to train multiple deep learning models based on the constructed agricultural pest image dataset, and introduce feature heatmaps to enhance the learning of foreground regions. At the same time, it integrates the knowledge of agricultural subsets and visual subsets to obtain an intelligent agricultural pest recognition model. The intelligent identification and pest output module is configured to input preprocessed target agricultural pest images into the agricultural pest intelligent identification model, and output agricultural pest identification results and multi-dimensional pest information, including pest species, density estimation, development stage and damage level. The multi-view segmentation and sub-dataset generation include: Based on the classification method of agricultural significance, the agricultural pest image dataset is divided into multiple sub-datasets according to the parts and methods of damage caused by pests to crops. The visual feature-based segmentation method clusters pests according to their image morphological features, grouping pests with similar appearances into the same subset. The model training and structure optimization include: Multiple deep learning models were trained based on a constructed dataset of agricultural pest images, and the optimal model was selected through performance comparison. Based on the selected optimal model, the Grad-CAM mechanism is introduced to focus on the foreground, enhance the model's attention to the target area and reduce background interference; Foreground-background contrast learning is used to improve feature discrimination, making the features of different pest categories more clustered; The model training and structure optimization also include: constructing an agricultural knowledge-driven model and a visual feature-driven model, and achieving weighted fusion by setting fusion weight parameters to optimize the combination of recognition results and enhance the ability to recognize complex and fine-grained pest categories.
4. The intelligent identification system for agricultural pests according to claim 3, characterized in that, The data cleaning and phased annotation module is configured as follows: The names of pests are standardized using Latin scientific names; Clean the data, removing duplicate and substandard images; Classify and annotate the adult and larval stages; Construct an agricultural pest sample library, covering standard images and classification information of common agricultural pests; Based on an agricultural pest sample database, image data is labeled and reviewed.
Citation Information
Patent Citations
Bacterial strain capable of increasing insecticidal effectiveness of biocontrol fungi and construction method thereof
CN101709270A
Male and female silkworm chrysalis sorting and counting device based on SIFT (Scale Invariant Feature Transform) feature image
CN104899595A