Agricultural pest automatic identification method based on Internet of Things and artificial intelligence
By combining multi-dimensional image acquisition and environmental data fusion with deep convolutional neural networks and attention mechanisms, the shortcomings of existing agricultural pest and disease identification methods have been addressed, achieving high-precision identification and precise prevention and control, thereby improving agricultural production efficiency.
Patent Information
- Application Number
- CN202510956150.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2025-11-07
AI Technical Summary
Existing methods for identifying agricultural pests and diseases are inadequate in terms of accuracy, efficiency, and adaptability to different crops and environmental conditions, and lack an effective mechanism for generating precise control solutions.
By employing multi-dimensional image acquisition and environmental data fusion, combined with deep convolutional neural networks and attention mechanisms, pest and disease identification and classification are performed, and precise prevention and control plans are generated through an intelligent decision-making system.
It has improved the accuracy and reliability of pest and disease identification, provided scientific guidance for prevention and control, reduced the damage of pests and diseases to crops, and improved agricultural production efficiency and agricultural product quality.
Smart Images

Figure CN120913243A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of agricultural technology, and in particular to an agricultural pest and disease automatic identification method based on the Internet of Things and artificial intelligence. BACKGROUND
[0002] In traditional agriculture, the identification and prevention of pests and diseases mainly rely on manual experience observation and on-site sampling detection. This method is labor-intensive, low in efficiency and prone to misjudgment. With the development of agricultural modernization, timely and accurate identification of pests and diseases is of great significance to improve crop yield and quality.
[0003] Currently, although there have been some researches on pest and disease identification using the Internet of Things and artificial intelligence, the existing methods still have shortcomings in identification accuracy, efficiency and adaptability to different crops and environmental conditions. For example, the existing methods often can only perform simple image recognition and cannot comprehensively consider environmental factors and multi-source data, resulting in inaccurate identification results. At the same time, after identifying pests and diseases, the existing methods lack effective and accurate prevention and control scheme generation mechanisms and cannot provide scientific prevention and control guidance for farmers. SUMMARY
[0004] The purpose of the present application is to solve the shortcomings in the prior art and to provide an agricultural pest and disease automatic identification method based on the Internet of Things and artificial intelligence.
[0005] In order to achieve the above-mentioned purpose, the present application adopts the following technical solutions:
[0006] An agricultural pest and disease automatic identification method based on the Internet of Things and artificial intelligence, comprising the following specific steps:
[0007] S1: Multi-dimensional image acquisition: multiple Internet of Things cameras are set up at different positions and angles in the farmland, and high-definition images of crop leaves are collected at regular intervals. At the same time, a camera is mounted on an unmanned aerial vehicle to take aerial photographs of the crop canopy, obtaining image information of a large area of crops, and all image data are transmitted to a data processing center;
[0008] S2: Environmental data fusion acquisition: multiple Internet of Things sensors are arranged in the farmland to collect real-time farmland environmental data, and the collected environmental data and image data are time-stamped and synchronously labeled and associated, forming a fusion data set which is then transmitted to the data processing center for subsequent analysis of the correlation between crop pests and diseases and environmental factors;
[0009] S3: Data preprocessing and feature preliminary screening: preprocess the collected image data and environmental data, use image processing algorithms to preliminarily extract simple shape features and color features in leaf images, and combine with the preset feature threshold range to screen out leaf images that may exist diseases and pests and their corresponding environmental data subsets, so as to reduce the data amount of subsequent processing and improve the processing efficiency;
[0010] S4: Deep feature mining and correlation analysis: input the screened leaf images and their corresponding environmental data subsets into a deep convolutional neural network (CNN) model, construct a comprehensive feature vector, and use a Softmax-based attention mechanism to weight and highlight key features in the comprehensive feature vector to enhance the model's recognition ability of important disease and pest features and improve the accuracy and reliability of recognition;
[0011] S5: Disease and pest recognition and classification based on feature similarity: extract the feature vectors in the trained CNN model to establish a disease and pest feature library; calculate the similarity between the feature vectors of the crops to be identified and the standard feature vectors in the disease and pest feature library, and consider multiple measurement methods such as Euclidean distance, cosine similarity and Manhattan distance to determine the similarity between the feature vectors to be identified and the standard feature vectors; according to the similarity matching result, the type of disease and pest is identified, and according to the preset similarity threshold range and disease and pest classification standard, the severity of the disease and pest is classified, providing a scientific basis for subsequent precision prevention;
[0012] S6: Multi-source data verification and result optimization: cross-verify the disease and pest type and grade results identified based on the CNN model with other multi-source data in the fusion data set, including using historical disease and pest occurrence data, crop variety disease resistance data and expert experience knowledge base data; through the construction of data verification rules and logical judgment model, the rationality of the identification result is evaluated and corrected, and the accuracy and reliability of disease and pest identification are further improved; at the same time, according to the verified result, the CNN model is updated and optimized online, and the incremental learning algorithm is used to feed back the new sample data and the verified result to the model, so that the model can continuously adapt to the changes of crop growing environment and the evolution of disease and pest characteristics, and maintain good recognition performance;
[0013] S7: Intelligent decision-making and precise prevention and control guidance: according to the final determined type of disease and insect pests, grade, and growth stage and environmental conditions of crops, a preset intelligent decision-making system is called, which is based on big data analysis and machine learning algorithm, and integrates the application range, advantages and disadvantages and effect evaluation data of multiple prevention and control methods; a precise prevention and control scheme for specific disease and insect pest conditions is generated, which includes specific pesticide types, application dose, application time and application method, and corresponding combination suggestions of agricultural prevention and control measures, physical prevention and control measures and biological prevention and control measures; the prevention and control scheme is pushed to farmers or agricultural management personnel in time through mobile terminal application or short message, and visual operation guide and caution prompt of the prevention and control measures are provided to ensure the effective implementation of the prevention and control measures, and realize the intelligent and precise management and prevention and control of agricultural diseases and insect pests.
[0014] As a further technical scheme of the present application, in S1, the Internet of Things camera and the unmanned aerial vehicle camera both have infrared imaging function, can collect crop images at night or under low light conditions, to realize all-weather disease and insect pest monitoring, and have automatic zoom and focusing function, and the resolution of the collected high-definition images is not less than 1080p.
[0015] As a further technical scheme of the present application, in S2, the Internet of Things sensor includes temperature and humidity sensor, light sensor, soil nutrient sensor and weather station, and the environmental data includes air temperature, humidity, light intensity, soil nutrient content, rainfall, wind speed and wind direction.
[0016] As a further technical scheme of the present application, in S3, the preprocessing of image data includes removing noise in the image, enhancing image contrast, and performing image segmentation to extract leaf area, and the preprocessing of environmental data includes normalization processing and outlier rejection.
[0017] As a further technical scheme of the present application, in S4, the deep convolutional neural network (CNN) model automatically learns the complex texture features, edge features and subtle features of disease and insect pest symptoms in the leaf image through multiple convolutional layers, pooling layers and fully connected layers, and performs correlation analysis on these deep features and corresponding environmental data.
[0018] As a further technical scheme of the present application, in S4, the key features in the comprehensive feature vector are highlighted by using the attention mechanism based on Softmax, which specifically includes:
[0019] S41: Calculate the attention weight a of each feature in the comprehensive feature vector i , the calculation formula is: In the formula: d is the dimension of the comprehensive feature vector, β i is the attention score of the i-th feature, and the calculation formula is: β i= v T · tanh(W att · F 综合,i + b att ), wherein: v is an attention vector used to determine the importance of features, with a dimension of 1 x h; W att is an attention weight matrix with a size of h x d; b att is an attention bias vector with a size of h x 1; F is a comprehensive feature vector, i is the i-th feature component of the comprehensive feature vector; h is the number of neurons in the intermediate hidden layer, generally taking a value of 64 or 128; tanh is a hyperbolic tangent activation function, and its expression is: The calculated attention weight a i reflects the importance of each feature in pest and disease identification, and the weight value is between 0 and 1, and the sum of all weights is 1;
[0020] S42: The comprehensive feature vector is weighted using the attention weight to obtain a weighted feature vector F att , and the calculation formula is:
[0021] As a further technical solution of the present application, in S5, in the training process of the deep convolutional neural network model, data augmentation techniques are used to randomly rotate, flip, crop and color dither the image data to expand the diversity and scale of the training sample set; the pest and disease feature library contains standard feature vectors of multiple known pest and disease types and corresponding pest and disease grade information; the standard feature vectors in the pest and disease feature library are obtained by feature extraction and clustering analysis on a large number of sample images of labeled pest and disease types, and are updated and improved regularly according to new pest and disease sample data and research results to ensure the comprehensiveness and timeliness of the feature library.
[0022] As a further technical solution of the present application, in S5, the feature vector of the crop to be identified is matched with the standard feature vectors in the pest and disease feature library for similarity calculation, pest and disease type identification and grading, specifically including:
[0023] S51: Similarity matching calculation:
[0024] Euclidean distance calculation: for the to-be-identified feature vector F att and the i-th standard feature vector B i in the pest and disease feature library, the Euclidean distance D euc,i is:
[0025] wherein: d is the dimension of the feature vector, F att,j and B i,j represent the j-th component of the to-be-identified feature vector and the standard feature vector, respectively;
[0026] Cosine similarity calculation: Cosine similarity S COS,i To measure the similarity of two vectors in direction, the formula is: The value range is [-1, 1], and the larger the value, the more similar the vector direction is;
[0027] Manhattan distance calculation: Manhattan distance D man,i is the sum of the absolute difference of each component of the vector, and the formula is:
[0028] Comprehensive similarity measurement: In order to comprehensively consider the three distance measurement methods, the comprehensive similarity S i is defined as: where: D euc,max and D man,max are the maximum values of Euclidean distance and Manhattan distance in the pest feature library, used for normalization processing of distance values; w euc , w cos and w man are the weight coefficients of the three measurement methods, satisfying w euc +w cos +w man =1, used to balance the weight of each measurement method in similarity calculation, and the value range is [0, 1], and the specific value can be determined according to the actual application scene and prior knowledge or obtained by machine learning method optimization;
[0029] S52: Pest type recognition and classification:
[0030] Pest type recognition: According to the comprehensive similarity S i , find the pest type corresponding to the standard feature vector most similar to the feature vector to be identified from the pest feature library; The specific method is to find the first k standard feature vectors with the maximum comprehensive similarity, where k is a preset integer, and the value is generally 1-5, then vote for the pest types corresponding to the k standard feature vectors, and the type with the most votes is the identified pest type, if there are multiple types with the same number of votes, further consider their comprehensive similarity to make a decision;
[0031] Pest severity classification: According to the pre-set similarity threshold range T=
[0032] {T min , T mid , T max}, the severity of the pest is divided into three levels of slight, moderate and severe, where: T min and T mid are two key thresholds, satisfying 0≤T min <T mid≤1; the overall similarity of the identified pest and disease types is S. max (i.e., the maximum comprehensive similarity among all standard feature vectors to the feature vector to be identified), when S max <T min This indicates that the symptoms of the pest or disease differ significantly from the standard characteristics in the feature database, suggesting that the disease may be in its early stages or have mild symptoms, and is therefore classified as mild. min ≤S ma <T mid The symptoms of pests and diseases are relatively obvious but have not yet seriously affected crop growth, and are therefore classified as medium-level; when S max ≥T mid If the symptoms of pests and diseases highly match the standard features in the feature database, it indicates that the pests and diseases are relatively serious and may have already caused significant damage to crops, and is therefore classified as severe.
[0033] As a further technical solution of the present invention, S6 specifically includes:
[0034] S61: Cross-validation process: Constructing multi-source data feature vector V multi Its form is V multi =[v1,v2,...,v n ], where: n is the dimension of the multi-source data, and each element v i The formula for calculating the feature value corresponding to a type of multi-source data is as follows:
[0035]
[0036] In this way, the multi-source data is initially compared with the CNN recognition results to form a feature vector of multi-source data matching.
[0037] S62: Constructing Data Validation Rules and Logical Judgment Model: Define the data validation rule matrix R, which has the following form: Where: m is the number of validation rules, and each element r ij This represents the weight coefficient of the i-th validation rule for the j-th type of multi-source data, with a value range of [0,1], and has a weight for each row. These weighting coefficients can be set based on expert experience and the reliability of multi-source data; the logical judgment model is based on the verification rule matrix R and the feature vector V of multi-source data. multi Calculate the verification score S verify Its formula is: Where: w i Let be the weight of the i-th validation rule, satisfying And w i ≥0, verification score S verify The value ranges from [0,1], with a larger value indicating a higher degree of reasonableness in the recognition result; based on the verification score Sverify Compared with the preset reasonableness threshold T verify The comparison is used to correct the recognition results. If S verify ≥T verify If the identification result is correct, it is considered reasonable; otherwise, the identification result is corrected according to the verification rules and the feature vectors of multi-source data. The corrected pest / disease type is C. corrected Level L corrected It is determined by the following rules:
[0038]
[0039] Among them, C CNN and L CNN These represent the types and levels of pests and diseases identified by the CNN model, C multi and L multi Based on the feature vector V of multi-source data respectively multi The pest and disease types and levels are determined by the check rule matrix R;
[0040] S63: Online updates and optimizations of CNN models:
[0041] According to the verified result C corrected and L corrected , take the new sample data X new and the corresponding label Y new The new sample data X is fed back into the CNN model. new Including the image feature vector F of the crop to be identified att and environmental data feature vector F env Its form is:
[0042] X new =[F att ,F env ], corresponding label Y new It includes information on pest and disease type and severity, in the format: Y new =[C corrected ,L corrected ];
[0043] Incremental learning algorithms minimize the loss function L of new sample data. new To adjust the model parameters, loss function L new The calculation formula is:
[0044]
[0045] Where: N is the number of new sample data, Y new,i Let P be the label of the i-th new sample. new,i Let be the predicted probability of the model for the i-th new sample;
[0046] When updating model parameters online, a gradient descent-based optimization algorithm is used, and the update formula for model parameter θ is: Where η is the learning rate, and its value ranges from (0,1). For loss function L new The gradient with respect to the model parameter θ.
[0047] As a further technical solution of the present invention, S7 specifically includes:
[0048] S71: Construct a knowledge base for prevention and control strategies, which includes the applicable scope, advantages and disadvantages, and effectiveness evaluation data of various prevention and control methods. Each prevention and control method corresponds to a prevention and control strategy vector S = [s1, s2, ..., s n ], where n is the dimension of the prevention and control method, s i This represents the applicability weight of the i-th prevention and control method, with a value ranging from 0 to 1. For example, pesticide control, agricultural control, physical control, and biological control methods each correspond to different applicability weights;
[0049] S72: Based on the final determined pest / disease type C, grade L, crop growth stage G, and environmental conditions E, calculate the suitability AD of each control method. i The formula for calculating the suitability of prevention and control methods is: AD i =α·Sim C (C,C i )+β·Sim L (L,L i )+γ·Sim G (G,G i )+δ·Sim E (E,E i ), where: i represents the i-th control method, α, β, γ, and δ are the weighting coefficients of pest / disease type, severity, growth stage, and environmental conditions, respectively, and α + β + γ + δ = 1. Their values are usually between 0 and 1, and can be determined based on the actual application scenario and prior knowledge; for example, assuming that pest / disease type and severity have a greater impact on the selection of control method, α = 0.4 and β = 0.3 can be set, while growth stage and environmental conditions have a relatively smaller impact, and γ = 0.2 and δ = 0.1 can be set; Sim C Sim L Sim G and Sim E These are functions for calculating the similarity between corresponding factors and control methods, with values ranging from 0 to 1; for example, for the similarity between pest and disease types, Sim... C (C,C i ), can be defined as the pest type C that is applicable to the control method i.i If the two are completely matched, the similarity is 1; if partially matched (such as the same type but different subspecies), the similarity is 0.5, otherwise 0, and other similarity calculation functions can be similarly defined;
[0050] S73: generating a precise control scheme according to the adaptation degree and the control strategy vector, and the generation formula of the precise control scheme is: Wherein: M i represents the specific measure set of the i-th control method, and P is the finally generated precise control scheme; for example, if the specific measure corresponding to a control method is to use pesticide A, the dose is d kg / ha, the application time is t, and the application method is spraying, then M i ={pesticide A, d, t, spraying}.
[0051] The beneficial effects of the present application are:
[0052] 1. Through multi-dimensional image acquisition and environmental data fusion acquisition, the image information and environmental information of crops can be comprehensively obtained, providing a richer data basis for disease and pest identification, and improving the accuracy and reliability of identification.
[0053] 2. Using a deep convolutional neural network model and an attention mechanism, complex texture features, edge features and subtle features of disease and pest symptoms in leaf images can be automatically learned, and key features can be highlighted, further improving the precision and efficiency of disease and pest identification.
[0054] 3. Through cross-validation and data verification rules, the rationality of the identification result is evaluated and corrected, ensuring the credibility and accuracy of the identification result.
[0055] 4. According to the final determined disease and pest type, grade, growth stage of crops and environmental conditions, a preset intelligent decision system is called to generate a precise control scheme for specific disease and pest conditions, providing scientific control guidance for farmers, which helps to take effective control measures in time, reduces the harm of diseases and pests to crops, and improves the agricultural production efficiency and the quality of agricultural products. BRIEF DESCRIPTION OF DRAWINGS
[0056] Figure 1 A flowchart of an agricultural disease and pest automatic identification method based on the Internet of Things and artificial intelligence is provided. DETAILED DESCRIPTION
[0057] In order to make the technical means, creative features, purposes and effects achieved by the present application easy to understand, the present application will be further described below in conjunction with specific embodiments.
[0058] Please refer to the accompanying Figure 1The application discloses an agricultural disease and pest automatic identification method based on an Internet of Things and artificial intelligence.
[0059] S1: multi-dimensional image acquisition: multiple Internet of Things cameras are arranged at different positions and angles of a farmland, high-definition images of crop leaves are collected in a time manner, a camera is carried on an unmanned aerial vehicle to take aerial photographs of a crop canopy, image information of a large-area crop is acquired, and all image data are transmitted to a data processing center;
[0060] S2: environmental data fusion acquisition: multiple Internet of Things sensors are arranged in the farmland, farmland environmental data are collected in a real-time manner, the collected environmental data and the image data are time-stamped and synchronously marked and associatedly bound, a fusion data set is formed and transmitted to the data processing center, so that a correlation between crop diseases and pests and environmental factors is analyzed subsequently;
[0061] S3: data preprocessing and feature preliminary screening: the collected image data and environmental data are preprocessed, simple shape features and color features in leaf images are preliminarily extracted by using an image processing algorithm, and leaf images possibly containing diseases and pests and corresponding environmental data subsets are screened out in combination with a preset feature threshold range, so that the data amount in subsequent processing is reduced and the processing efficiency is improved;
[0062] S4: deep feature mining and correlation analysis: the screened leaf images and corresponding environmental data subsets are input into a deep convolutional neural network (CNN) model, a comprehensive feature vector is constructed, key features in the comprehensive feature vector are highlighted by using a Softmax-based attention mechanism, so that the recognition ability of the model to important disease and pest features is enhanced, and the accuracy and reliability of recognition are improved;
[0063] S5: disease and pest identification and grading based on feature similarity: feature vectors in a trained CNN model are extracted to establish a disease and pest feature library; feature vectors of crops to be identified are matched with standard feature vectors in the disease and pest feature library in terms of similarity, multiple measurement modes such as Euclidean distance, cosine similarity and Manhattan distance are comprehensively considered, similarity between the feature vectors to be identified and the standard feature vectors is determined; according to the similarity matching result, the type of the disease and pest is identified, the severity of the disease and pest is graded according to a preset similarity threshold range and a disease and pest grading standard, and a scientific basis is provided for subsequent precise prevention and treatment;
[0064] S6: Multi-source data verification and result optimization: Cross-verify the pest and disease type and grade results identified by the CNN model with other multi-source data in the fusion data set, including using historical pest and disease occurrence data, crop variety disease resistance data, and data in the expert experience knowledge base; through the construction of data verification rules and logical judgment models, reasonably evaluate and correct the identification results, further improve the accuracy and reliability of pest and disease identification; at the same time, according to the verified results, online update and optimization of the CNN model, using incremental learning algorithm, the new sample data and the verified results are fed back to the model, so that the model can continuously adapt to the changes of crop growth environment and the evolution of pest and disease characteristics, and maintain good identification performance;
[0065] S7: Intelligent decision-making and precise prevention and control guidance: According to the final determined pest and disease type, grade, and crop growth stage and environmental conditions, call the preset intelligent decision-making system, which is based on big data analysis and machine learning algorithm, and integrates the application range, advantages and disadvantages, and effect evaluation data of various prevention and control methods; generate a precise prevention and control scheme for specific pest and disease conditions, which includes specific pesticide types, application dose, application time and application method, as well as corresponding agricultural prevention and control measures, physical prevention and control measures and biological prevention and control measures combination suggestions; the prevention and control scheme is pushed to farmers or agricultural management personnel in time through mobile terminal application or SMS, and visual operation guide and caution prompt of prevention and control measures are provided to ensure the effective implementation of prevention and control measures, and realize intelligent and precise management and prevention and control of agricultural pests and diseases.
[0066] In a preferred embodiment, in S1, the Internet of Things camera and the unmanned aerial vehicle camera both have infrared imaging function, which can collect crop images at night or in low light conditions to realize all-weather pest and disease monitoring, and have automatic zoom and focus function, and the resolution of the collected high-definition images is not less than 1080p.
[0067] In a preferred embodiment, in S2, the Internet of Things sensor includes temperature and humidity sensor, light sensor, soil nutrient sensor and weather station, and the environmental data includes air temperature, humidity, light intensity, soil nutrient content, rainfall, wind speed and wind direction.
[0068] In a preferred embodiment, in S3, the preprocessing of image data includes removing noise in the image, enhancing image contrast, and performing image segmentation to extract leaf area, and the preprocessing of environmental data includes normalization and outlier removal.
[0069] In a preferred embodiment, in S4, the deep convolutional neural network (CNN) model automatically learns the complex texture features, edge features and subtle features of disease and pest symptoms in the leaf image through multiple convolutional layers, pooling layers and fully connected layers, and correlates and analyzes these deep features with the corresponding environmental data.
[0070] In a preferred embodiment, in S4, the key features in the comprehensive feature vector are highlighted by using a Softmax-based attention mechanism, which specifically includes:
[0071] S41: Calculate the attention weight a of each feature in the comprehensive feature vector i , and the calculation formula is: In the formula: d is the dimension of the comprehensive feature vector, β i is the attention score of the i-th feature, and the calculation formula is: β i = v T · tanh(W att · F 综合,i + b att ), where: v is the attention vector, used to determine the importance of the feature, with a dimension of 1xh; W att is the attention weight matrix, with a size of hxd; b att is the attention bias vector, with a size of hxl; F is the comprehensive feature vector, i is the i-th feature component of the comprehensive feature vector; h is the number of neurons in the intermediate hidden layer, generally taking a value of 64 or 128; tanh is the hyperbolic tangent activation function, and its expression is: The calculated attention weight a i reflects the importance of each feature in disease and pest identification, and the weight value is between 0 and 1, and the sum of all weights is 1;
[0072] S42: Weight the comprehensive feature vector using the attention weight to obtain the weighted feature vector F att , and the calculation formula is:
[0073] In a preferred embodiment, in S5, during the training process, the deep convolutional neural network model uses data augmentation techniques to randomly rotate, flip, crop and color jitter the image data to expand the diversity and scale of the training sample set; the disease and pest feature library contains standard feature vectors of multiple known disease and pest types and their corresponding disease and pest grade information; the standard feature vectors in the disease and pest feature library are obtained by feature extraction and clustering analysis on a large number of labeled disease and pest type sample images, and are updated and improved regularly according to new disease and pest sample data and research results to ensure the comprehensiveness and timeliness of the feature library.
[0074] In a preferred embodiment, in S5, the feature vector of the crop to be identified is matched with the standard feature vectors in the pest and disease feature library for similarity calculation and pest and disease type identification and classification, specifically including:
[0075] S51: Similarity matching calculation:
[0076] Euclidean distance calculation: for the feature vector F att to be identified and the i-th standard feature vector B i in the pest and disease feature library, the Euclidean distance D euc,i is:
[0077] where d is the dimension of the feature vector, F att,j and B i,j represent the j-th component of the feature vector to be identified and the standard feature vector, respectively;
[0078] Cosine similarity calculation: Cosine similarity S COS,i is used to measure the similarity of two vectors in direction, and the calculation formula is: The value range is [-1, 1], and the larger the value, the more similar the vector direction;
[0079] Manhattan distance calculation: Manhattan distance D man,i is the sum of the absolute differences of the components of the vector, and the calculation formula is:
[0080] Comprehensive similarity measurement: In order to comprehensively consider the three distance measurement methods, the comprehensive similarity S i is defined as: where D euc,max and D man,max are the maximum values of Euclidean distance and Manhattan distance in the pest and disease feature library, respectively, for distance value normalization; w euc , w cos and w man are the weight coefficients of the three measurement methods, satisfying w euc +w cos +w man =1, for balancing the weight of each measurement method in similarity calculation, the value range is [0, 1], and the specific value can be determined according to the actual application scenario and prior knowledge or optimized by machine learning method;
[0081] S52: Pest and disease type identification and classification:
[0082] Pest and disease type identification: According to the comprehensive similarity S ifind the disease and pest type corresponding to the standard feature vector most similar to the to-be-identified feature vector from the disease and pest feature library; the specific method is to find the first k standard feature vectors with the maximum comprehensive similarity, where k is a preset integer, and the value is generally 1-5, and then vote for the disease and pest types corresponding to the k standard feature vectors, and the type with the most votes is the identified disease and pest type, and if there are multiple types with the same number of votes, the decision can be further made by considering the sizes of their comprehensive similarities;
[0083] The disease and pest severity classification: according to the preset similarity threshold range T = {T
[0084] {T min ,T mid ,T max}, the severity of the disease and pest is classified into three levels of slight, medium and severe, wherein: T min and T mid are two key thresholds, and satisfy 0≤T min <T mid ≤1; the comprehensive similarity of the identified disease and pest type is S max (that is, the maximum comprehensive similarity of all standard feature vectors to the to-be-identified feature vector), when S max <T min , it means that the disease and pest symptoms are quite different from the standard features in the feature library, and the disease and pest may be in the early stage or the symptoms are slight, and it is determined as the slight level; when T min ≤S max <T mid , the disease and pest symptoms are relatively obvious but have not yet seriously affected the growth of crops, and it is determined as the medium level; when S max ≥T mid , the disease and pest symptoms are highly matched with the standard features in the feature library, indicating that the disease and pest is relatively serious, and it may have caused great harm to crops, and it is determined as the severe level.
[0085] In a preferred embodiment, S6 specifically includes:
[0086] S61: cross-validation process: construct a multi-source data feature vector V multi , which is in the form of V multi = [v1, v2,..., v n ], wherein: n is the dimension of the multi-source data, and each element v i corresponds to a feature value of a kind of multi-source data, and the calculation formula is:
[0087]
[0088] In this way, the multi-source data is preliminarily compared with the CNN recognition result to form a feature vector of the multi-source data matching situation;
[0089] S62: Constructing data verification rules and logical judgment model: define the data verification rule matrix R, which is in the form of: wherein: m is the number of verification rules, each element r ij represents the weight coefficient of the i-th verification rule to the j-th multi-source data, which is in the range of [0, 1], and for each row, These weight coefficients can be set according to expert experience and the reliability of multi-source data; the logical judgment model is based on the verification rule matrix R and the multi-source data feature vector V multi , calculates the verification score S verify , whose formula is: wherein: w i is the weight of the i-th verification rule, which satisfies and w i ≥ 0, the verification score S verify is in the range of [0, 1], and the larger the value, the higher the rationality of the identification result; according to the comparison between the verification score S verify and the preset rationality threshold T verify , the identification result is corrected, if S verify ≥ T verify , it is considered that the identification result is reasonable, otherwise the identification result is corrected according to the verification rule and the multi-source data feature vector, and the corrected disease and pest type is C corrected , and the grade is L corrected , which is determined by the following rules:
[0090]
[0091] wherein, C CNN and L CNN are the disease and pest type and grade identified by the CNN model, C multi and L multi are the disease and pest type and grade determined according to the multi-source data feature vector V multi and the verification rule matrix R;
[0092] S63: Online updating and optimizing CNN model:
[0093] According to the corrected results C corrected and L corrected , the new sample data X new and the corresponding label Y new are fed back to the CNN model, and the new sample data X new includes the image feature vector F att and the environmental data feature vector F env , which is in the form of:
[0094] X new =[F att ,F env ], corresponding label Y new It includes information on pest and disease type and severity, in the format: Y new =[C corrected ,L corrected ];
[0095] Incremental learning algorithms minimize the loss function L of new sample data. new To adjust the model parameters, loss function L new The calculation formula is:
[0096]
[0097] Where: N is the number of new sample data, Y new,i Let P be the label of the i-th new sample. new,i Let be the predicted probability of the model for the i-th new sample;
[0098] When updating model parameters online, a gradient descent-based optimization algorithm is used, and the update formula for model parameter θ is: Where η is the learning rate, and its value ranges from (0,1). For the loss function L new The gradient with respect to the model parameter θ.
[0099] In a preferred embodiment, S7 specifically includes:
[0100] S71: Construct a knowledge base for prevention and control strategies, which includes the applicable scope, advantages and disadvantages, and effectiveness evaluation data of various prevention and control methods. Each prevention and control method corresponds to a prevention and control strategy vector S = [s1, s2, ..., s n ], where n is the dimension of the prevention and control method, s i This represents the applicability weight of the i-th prevention and control method, with a value ranging from 0 to 1. For example, pesticide control, agricultural control, physical control, and biological control methods each correspond to different applicability weights;
[0101] S72: Based on the final determined pest / disease type C, grade L, crop growth stage G, and environmental conditions E, calculate the suitability AD of each control method. i The formula for calculating the suitability of prevention and control methods is: AD i =α·Sim C (C,C i )+β·Sim L (L,L i )+γ·Sim G (G,G i)+delta*Sim E (E,E i ), wherein: i represents the i-th control method, alpha, beta, gamma and delta are weight coefficients of the pest type, grade, growth stage and environmental condition respectively, and alpha+beta+gamma+delta=1, their value range is usually between 0-1, which can be determined according to the actual application scene and prior knowledge; for example, assuming that the pest type and grade have a greater impact on the control method selection, alpha=0.4, beta=0.3 can be set, while the growth stage and environmental condition have a relatively smaller impact, gamma=0.2, delta=0.1 can be set; Sim C , Sim L , Sim G and Sim E are similarity calculation functions corresponding to the factors and the control method, and their value range is between 0-1; for example, for the pest type similarity Sim C (C,C i ), it can be defined as: if the pest type C is completely matched with the pest type C i suitable for the control method i, the similarity is 1; if it is partially matched (such as the same type but different subspecies), the similarity is 0.5, otherwise it is 0, other similarity calculation functions can be similarly defined;
[0102] S73: generating a precise control scheme according to the fitness degree and the control strategy vector, and the generation formula of the precise control scheme is: wherein: M i represents a specific measure set of the i-th control method, and P is the finally generated precise control scheme; for example, if the specific measure corresponding to a control method is to use pesticide A, the dose is d kg / ha, the application time is t, and the application method is spraying, then M i ={pesticide A, d, t, spraying}.
[0103] From the above description, it can be seen that the above-mentioned embodiments of the present application achieve the following technical effects: through multi-dimensional image acquisition and environmental data fusion acquisition, image information and environmental information of crops can be comprehensively acquired, providing a richer data basis for pest identification, and improving the accuracy and reliability of identification.
[0104] Using a deep convolutional neural network model and an attention mechanism, complex texture features, edge features and subtle features of pest symptoms in leaf images can be automatically learned, and key features can be highlighted, further improving the precision and efficiency of pest identification.
[0105] Through cross-validation and data verification rules, the rationality of the identification result is evaluated and corrected, ensuring the credibility and accuracy of the identification result.
[0106] According to the finally determined disease and pest type, grade, and growth stage and environmental conditions of the crops, a preset intelligent decision system is called to generate a precise prevention and control scheme for the specific disease and pest condition, thereby providing scientific prevention and control guidance for the farmers, helping to take effective prevention and control measures in time, reducing the harm of the disease and pest to the crops, and improving the agricultural production efficiency and the quality of agricultural products.
[0107] Those skilled in the art should understand that the above discussion of any embodiment is only exemplary and is not intended to imply that the scope (including claims) of the present application is limited to these examples; the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes of different aspects of the present application as described above, which are not provided in details for the sake of brevity.
[0108] The present application is intended to cover all such alternatives, modifications, and variations as fall within the broad scope of the claims. Accordingly, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. An agricultural pest automatic identification method based on Internet of Things and artificial intelligence, characterized in that, Comprise the following specific steps: S1: Multi-dimensional image acquisition: multiple Internet of Things cameras are set up at different positions and angles in the farmland, and high-definition images of crop leaves are collected at regular intervals, and a UAV is used to take aerial photographs of the crop canopy to obtain image information of a large area of crops; S2: Environmental data fusion acquisition: multiple Internet of Things sensors are arranged in the farmland to collect real-time farmland environmental data; S3: Data preprocessing and feature preliminary screening: the collected image data and environmental data are preprocessed, and image processing algorithms are used to screen out leaf images that may have diseases and insect pests and their corresponding environmental data subsets; S4: Deep feature mining: input the screened leaf images and their corresponding environmental data subsets into a deep convolutional neural network model to construct a comprehensive feature vector; S5: Disease and pest identification and classification: the feature vector of the crop to be identified is matched with the standard feature vector in the disease and pest feature library; according to the matching result, the type of disease and pest is identified and the severity is classified; S6: Multi-source data verification and result optimization: cross-verify the identified disease and pest type and grade result with other multi-source data; reasonably evaluate and correct the identification result, and update and optimize the CNN model online according to the verified result; S7: Intelligent decision-making and precise prevention and control guidance: according to the finally determined disease and pest type, grade, growth stage of crops and environmental conditions, call the preset intelligent decision-making system to generate a precise prevention and control scheme for a specific disease and pest situation. 2.The agricultural pest automatic identification method based on the Internet of Things and artificial intelligence according to claim 1, characterized in that, In S1, the Internet of Things cameras and UAV cameras both have infrared imaging function and automatic zoom and focusing function, and the collected high-definition images have a resolution of no less than 1080p. 3.The agricultural pest automatic identification method based on the Internet of Things and artificial intelligence according to claim 1, characterized in that, In S2, the Internet of Things sensors include temperature and humidity sensors, light sensors, soil nutrient sensors, and weather stations, and the environmental data includes air temperature, humidity, light intensity, soil nutrient content, rainfall, wind speed and direction.
4. The agricultural pest automatic identification method based on the Internet of Things and artificial intelligence according to claim 1, characterized in that, In S3, the preprocessing of image data includes removing noise in the image, enhancing image contrast, and segmenting the image to extract the leaf area, and the preprocessing of environmental data includes normalization and outlier removal. 5.The agricultural pest automatic identification method based on the Internet of Things and artificial intelligence according to claim 1, characterized in that, In S4, the deep convolutional neural network model automatically learns the complex texture features, edge features and subtle features of disease and pest symptoms in the leaf image through multiple convolution layers, pooling layers and fully connected layers, and correlates these deep features with the corresponding environmental data. 6.The agricultural pest automatic identification method based on the Internet of Things and artificial intelligence according to claim 5, characterized in that, In S4, the key features in the comprehensive feature vector are highlighted by using a Softmax-based attention mechanism, specifically including: S41: calculate the attention weight a of each feature in the comprehensive feature vector i The calculated attention weight a i reflects the importance of each feature in pest and disease identification, the weight value is between 0 and 1, and the sum of all weights is 1; S42: weight the integrated feature vector using the attention weight to obtain a weighted feature vector F att . 7.The agricultural pest automatic identification method based on the Internet of Things and artificial intelligence according to claim 1, characterized in that, In the S5, the deep convolutional neural network model is subjected to random rotation, flipping, cropping and color jittering processing on the image data by using a data enhancement technique in the training process; the pest and disease feature library contains standard feature vectors of multiple known pest and disease types and corresponding pest and disease grade information; the standard feature vectors in the pest and disease feature library are obtained by feature extraction and cluster analysis on a large number of sample images of labeled pest and disease types, and are updated and improved periodically according to new pest and disease sample data and research results. 8.The agricultural pest automatic identification method based on the Internet of Things and artificial intelligence according to claim 6, characterized in that, In the S5, the feature vector of the crop to be identified is subjected to similarity matching calculation with the standard feature vectors in the pest and disease feature library, and pest and disease type identification and grading, specifically including: S51: Similarity matching calculation; Euclidean distance calculation: for the feature vector F to be identified att and the i-th standard feature vector B in the pest feature library i , the Euclidean distance of which is D euc,i ; Cosine similarity calculation: Cosine similarity S COS,i For measuring the degree of similarity of two vectors in the direction, the value range is [-1, 1], and the larger the value, the more similar the vector direction is. Manhattan distance calculation: Manhattan distance D man,i is the sum of the absolute differences of the components of the vectors; Comprehensive similarity measure: In order to comprehensively consider the three distance measurement methods, the comprehensive similarity S is defined i ; S52: Pest and disease type identification and grading: Disease and pest type identification: according to the comprehensive similarity S i find the disease and pest type corresponding to the standard feature vector most similar to the to-be-identified feature vector from the disease and pest feature library; Pest and disease severity grading: according to a preset similarity threshold range T = {T min ,T mid ,T max}, the severity of the disease and insect pests is divided into three levels of slight, medium and severe, wherein: T min and T mid are two key thresholds, satisfying 0≤T min <T mid ≤1; the comprehensive similarity corresponding to the identified type of disease and insect pests is S max , when S max <T min , it is determined as the slight level; when T min ≤S max <T mid , it is determined as the medium level; when S max ≥T mid , it is determined as the severe level. 9.The agricultural pest automatic identification method based on the Internet of Things and artificial intelligence according to claim 1, characterized in that, The S6 specifically includes: S61: Cross-validation process: Constructing multi-source data feature vector V multi Its form is V multi =[v1,v2,...,v n ], where: n is the dimension of the multi-source data, and each element v i For each feature value corresponding to a multi-source data, the multi-source data is initially compared with the CNN recognition results to form a feature vector of multi-source data matching. S62: Constructing data verification rules and logical judgment model: defining data verification rule matrix R, and logical judgment model based on verification rule matrix R and multi-source data feature vector V multi , calculating verification score S verify , the value range of verification score S verify is [0, 1], and the larger the value is, the higher the rationality of the identification result is; according to the comparison between verification score S verify and the preset rationality threshold T verify , the identification result is corrected, and the corrected pest type is C corrected and the grade is L corrected . S63: online updating and optimizing CNN model: according to the checked result C corrected and L corrected , the new sample data X new and the corresponding label Y new are fed back to the CNN model, the new sample data X new includes the image feature vector F att and the environmental data feature vector F env of the crop to be identified, and the corresponding label Y new contains the type and grade information of the disease and pest; the incremental learning algorithm adjusts the model parameters by minimizing the loss function L new of the new sample data; when updating the model parameters online, a gradient descent-based optimization algorithm is used. 10.The agricultural pest automatic identification method based on the Internet of Things and artificial intelligence according to claim 1, characterized in that, The S7 specifically includes: S71: Construct a prevention and treatment scheme knowledge base, which includes the applicable scope, advantages and disadvantages and effect evaluation data of a plurality of prevention and treatment methods, and each prevention and treatment method corresponds to a prevention and treatment strategy vector S=[s1, s2,..., sn], wherein n is the dimension of the prevention and treatment method, and s n represents the applicability weight of the i th prevention and treatment method; i S72: Calculate the adaptation degree AD of each control method according to the finally determined pest type C, grade L, crop growth stage G and environmental condition E i ; S73: generating a precise prevention and control scheme according to the adaptation degree and the prevention and control strategy vector, and the generation formula of the precise prevention and control scheme is: Wherein: M i represents a specific measure set of the i th prevention and control method, and P is the finally generated precise prevention and control scheme.
Citation Information
Cited By
Intelligent identification method and system for hillside orchard diseases and insect pests based on coordination of large and small models
CN121191039A
Crop disease and pest control method and device based on generative control decision
CN121811096A