A method, device and computer-readable storage medium for preventing and controlling agricultural pests and diseases
By monitoring farmland environmental data and updating agricultural ontology, and using semantic technology to correct labels, we solve the problems of low accuracy in automatic control of agricultural pest control and image classification in the existing technology, and achieve high-accuracy pest identification and the intelligence of the agricultural Internet of Things. control.
Patent Information
- Application Number
- CN201910722791.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-06
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2039-08-06
AI Technical Summary
Existing agricultural pest control methods lack automated control. The image classification model has low accuracy in classifying pests and diseases with similar symptoms and requires a large amount of manual labeling data, resulting in incomplete classification categories and the inability to realize intelligent interaction and control of agricultural IoT devices.
By monitoring farmland environmental data, classification predictions are made based on the trained pest and disease model, and the results are semantically mapped with the semantic knowledge in the agricultural ontology. The agricultural ontology is updated to reason about agricultural operation events. The sample processing mechanism is used to update the model, using semantic similarity. Correct labels to improve model recognition accuracy and recall.
It realizes the automatic control of agricultural pests and diseases, improves the accuracy and recall rate of pest identification, reduces the cost of manual marking, and promotes the sharing and interoperability of data and knowledge of agricultural Internet of Things equipment.
Smart Images

Figure CN112347264B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of mobile communication technology, and in particular to an agricultural pest control method, device and computer-readable storage medium. Background Art
[0002] In the existing technology, there are three main types of agricultural pest control solutions: one is based on human experience, one is to query relevant information through the Internet or software, and the other is through machine learning.
[0003] The first method of pest control based on human experience requires farmers to have a lot of experience and knowledge, and is mainly carried out through manual control, with basically no automated control;
[0004] The second method of searching for relevant information through the Internet or software requires farmers to describe the symptoms of pests and diseases in detail. The accuracy of the diagnosis results varies greatly due to the comprehensiveness, accuracy and professionalism of the description information. This solution is mainly carried out in the form of manual prevention and control, lacking automated control;
[0005] The second machine learning method uses image recognition to diagnose pests and diseases. However, the symptoms of many pests and diseases are very similar. The image classification model has a low accuracy rate for pests and diseases with similar symptoms, which in turn affects the diagnosis and prevention of diseases. At the same time, the image classification model requires a large amount of labeled data. It is very difficult for humans to label all types of pests and diseases, resulting in incomplete classification categories, making some pests and diseases unrecognizable. In terms of automation, this solution mainly guides agricultural operations by associating classification labels with corresponding control devices. It is impossible to achieve a unified description of various resources in agriculture, hinder the sharing and intercommunication of data and knowledge between devices, and cannot achieve intelligent interaction and control of devices in the agricultural Internet of Things. Summary of the invention
[0006] In view of this, embodiments of the present invention are intended to provide an agricultural pest control method, device, and computer-readable storage medium.
[0007] To achieve the above object, the technical solution of the embodiment of the present invention is implemented as follows:
[0008] The embodiment of the present invention provides an agricultural pest control method, the method comprising:
[0009] Monitor current farmland environmental data;
[0010] Classify and predict the environmental data based on the trained pest and disease model;
[0011] Semantically map the classification results with the semantic knowledge in agricultural ontology;
[0012] Updating the agricultural ontology using the mapped semantic concepts;
[0013] Agricultural operation events are obtained based on the updated agricultural ontology reasoning.
[0014] Optionally, the method further includes:
[0015] The trained pest and disease model is updated based on the preset sample processing mechanism.
[0016] The updating of the trained pest and disease model based on a preset sample processing mechanism includes:
[0017] Based on the pest and disease related knowledge in semantic technology and according to the current agricultural environment data and / or crop information and / or date, determine the set of pest and disease types P that may occur currently;
[0018] Perform sample label correction or sample annotation according to the classification probability of the pest and disease type set P, the pest and disease classification label set C, and the semantic similarity between the pests and diseases;
[0019] Update pest and disease models based on label-corrected samples or newly annotated samples.
[0020] The method for determining the pest classification label set C is as follows:
[0021] The current farmland environmental data is input into the pest and disease model for classification, and the classification result is the pest and disease classification label set C.
[0022] Optionally, before performing sample label correction or sample labeling, the method further includes:
[0023] Establish a semantic similarity file for pests and diseases.
[0024] The step of establishing a pest and disease semantic similarity file includes:
[0025] Training doc2vec model based on agricultural corpus;
[0026] Descriptive information of each pest and disease was obtained from the online database;
[0027] Determine the word vector corresponding to each pest based on the doc2vec model;
[0028] Based on the word vector of each pest, the semantic similarity value between each pest disease is calculated to describe the similarity of the symptoms between two pest diseases.
[0029] The sample label correction or sample annotation is performed according to the classification probability of the pest type set P, the pest classification label set C, and the semantic similarity between the pests, including:
[0030] When it is determined that the classification label c is in the pest type set P and the classification probability of the classification label c is greater than 1 / n, it means that the classification is correct, and the sample label correction or sample marking operation is omitted;
[0031] Determine that the classification label c is not in the pest and disease type set P, but the classification label set C has an intersection F with the pest and disease type set P, and the classification probability of the label with the highest classification label probability in F is greater than 1 / n, then replace the classification label c with the label with the highest classification label probability;
[0032] Determine that the classification label set C and the pest and disease type set P have an intersection F, the classification probability of the classification labels in F is less than 1 / n, and the classification label c is greater than 1 / n, then determine the semantic similarity between the word vector corresponding to each pest and disease in the pest and disease type set P and the word vector corresponding to the classification label c, and select the pest and disease p with the greatest semantic similarity as the new label;
[0033] Determine that the classification label set C has no intersection with the pest type set P, and the classification label c is greater than 1 / n, then determine the semantic similarity between the word vector corresponding to each pest in the pest type set P and the word vector corresponding to the classification label c, and select the pest p with the greatest semantic similarity as the new label;
[0034] When it is determined that the classification label c is less than 1 / n, it means that the pest model does not contain the correct classification label, and manual labeling is performed;
[0035] Wherein, n is the total number of pest and disease categories in the classification label set C.
[0036] The embodiment of the present invention also provides an agricultural pest control device, which includes:
[0037] Monitoring module, used to monitor the current farmland environmental data;
[0038] A classification module, used for classifying and predicting the environmental data based on the trained pest and disease model;
[0039] A mapping module is used to semantically map the classification results with the semantic knowledge in the agricultural ontology;
[0040] An updating module, used for updating the agricultural ontology using the mapped semantic concepts;
[0041] The reasoning module is used to obtain agricultural operation events based on the updated agricultural ontology.
[0042] The embodiment of the present invention further provides an agricultural pest control device, the device comprising: a processor and a memory for storing a computer program that can be run on the processor,
[0043] Wherein, the processor is used to execute the steps of the above method when running the computer program.
[0044] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.
[0045] The agricultural pest control method, device and computer-readable storage medium provided by the embodiment of the present invention monitor the environmental data of the current farmland; classify and predict the environmental data based on the trained pest model; semantically map the classification results with the semantic knowledge in the agricultural ontology; update the agricultural ontology using the mapped semantic concepts; and infer agricultural operation events based on the updated agricultural ontology. The embodiment of the present invention can realize the automated control of agricultural Internet of Things pests and diseases, and can make decisions and controls based on multiple information such as agricultural environment and crop habits.
[0046] In addition, the embodiment of the present invention also provides a sample processing mechanism. Through continuous updating of the model, the model's recognition accuracy of pests and diseases becomes higher and higher, and more and more types can be recognized, thereby reducing the cost of manual labeling and improving the recall rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is a schematic diagram of the process of the agricultural pest control method according to an embodiment of the present invention;
[0048] Figure 2 This is a schematic diagram of the structure of the agricultural pest control device according to an embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of an agricultural pest control system according to an embodiment of the present invention;
[0050] Figure 4 This is a schematic diagram of a partial ontology knowledge model in agriculture according to an embodiment of the present invention;
[0051] Figure 5 This is a schematic diagram of semantic mapping according to an embodiment of the present invention;
[0052] Figure 6 This is a flowchart of semantic mapping, ontology updating and reasoning described in an embodiment of the present invention;
[0053] Figure 7 This is a flow chart of the sample processing mechanism described in an embodiment of the present invention;
[0054] Figure 8 The present invention provides a flowchart for constructing a pest and disease similarity file according to an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The present invention is described below in conjunction with the accompanying drawings and embodiments.
[0056] The present invention provides a method for controlling agricultural pests and diseases. Figure 1 As shown, the method includes:
[0057] Step 101: Monitor the current farmland environmental data;
[0058] Step 102: classifying and predicting the environmental data based on the trained pest and disease model;
[0059] Step 103: semantically map the classification results with the semantic knowledge in the agricultural ontology;
[0060] Step 104: updating the agricultural ontology using the mapped semantic concepts;
[0061] Step 105: Obtain agricultural operation events based on the updated agricultural ontology reasoning.
[0062] The embodiments of the present invention can realize the automated control of agricultural Internet of Things pests and diseases, and can make decisions and controls based on multiple information such as the agricultural environment and crop habits.
[0063] In one embodiment, the method further comprises:
[0064] The trained pest and disease model is updated based on the preset sample processing mechanism.
[0065] In the embodiment of the present invention, the updating of the trained pest and disease model based on the preset sample processing mechanism includes:
[0066] Based on the pest and disease related knowledge in semantic technology and according to the current agricultural environment data and / or crop information and / or date, determine the set of pest and disease types P that may occur currently;
[0067] Perform sample label correction or sample annotation according to the classification probability of the pest and disease type set P, the pest and disease classification label set C, and the semantic similarity between the pests and diseases;
[0068] Update pest and disease models based on label-corrected samples or newly annotated samples.
[0069] Through continuous updating of the model, the embodiment of the present invention makes the recognition accuracy of the model for pests and diseases higher and higher, and more and more types can be recognized, thereby reducing the cost of manual labeling.
[0070] In the embodiment of the present invention, the method for determining the pest classification label set C is:
[0071] The current farmland environmental data is input into the pest and disease model for classification, and the classification result is the pest and disease classification label set C.
[0072] In one embodiment, before performing sample label correction or sample annotation, the method further includes:
[0073] Establish a semantic similarity file for pests and diseases.
[0074] In the embodiment of the present invention, the step of establishing a pest and disease semantic similarity file includes:
[0075] Training doc2vec model based on agricultural corpus;
[0076] Descriptive information of each pest and disease was obtained from the online database;
[0077] Determine the word vector corresponding to each pest based on the doc2vec model;
[0078] Based on the word vector of each pest, the semantic similarity value between each pest disease is calculated to describe the similarity of the symptoms between two pest diseases.
[0079] In the embodiment of the present invention, the sample label correction or sample annotation is performed according to the classification probability of the pest type set P, the pest classification label set C, and the semantic similarity between the pests, including:
[0080] When it is determined that the classification label c is in the pest type set P and the classification probability of the classification label c is greater than 1 / n, it means that the classification is correct, and the sample label correction or sample marking operation is omitted;
[0081] Determine that the classification label c is not in the pest and disease type set P, but the classification label set C has an intersection F with the pest and disease type set P, and the classification probability of the label with the highest classification label probability in F is greater than 1 / n, then replace the classification label c with the label with the highest classification label probability;
[0082] Determine that the classification label set C and the pest and disease type set P have an intersection F, the classification probability of the classification labels in F is less than 1 / n, and the classification label c is greater than 1 / n, then determine the semantic similarity between the word vector corresponding to each pest and disease in the pest and disease type set P and the word vector corresponding to the classification label c, and select the pest and disease p with the greatest semantic similarity as the new label;
[0083] Determine that the classification label set C has no intersection with the pest type set P, and the classification label c is greater than 1 / n, then determine the semantic similarity between the word vector corresponding to each pest in the pest type set P and the word vector corresponding to the classification label c, and select the pest p with the greatest semantic similarity as the new label;
[0084] When it is determined that the classification label c is less than 1 / n, it means that the pest model does not contain the correct classification label, and manual labeling is performed;
[0085] Wherein, n is the total number of pest and disease categories in the classification label set C.
[0086] In order to implement the above method embodiment, the present invention also provides an agricultural pest control device, such as Figure 2 As shown, the device comprises:
[0087] Monitoring module 201, used to monitor the current farmland environmental data;
[0088] A classification module 202 is used to classify and predict the environmental data based on the trained pest and disease model;
[0089] A mapping module 203 is used to semantically map the classification results with the semantic knowledge in the agricultural ontology;
[0090] An updating module 204, used to update the agricultural ontology using the mapped semantic concepts;
[0091] The reasoning module 205 is used to obtain agricultural operation events based on the updated agricultural ontology.
[0092] In one embodiment, the updating module 204 is further used to update the trained pest and disease model based on a preset sample processing mechanism.
[0093] In the embodiment of the present invention, the updating module 204 updates the trained pest model based on a preset sample processing mechanism, including:
[0094] Based on the pest and disease related knowledge in semantic technology and according to the current agricultural environment data and / or crop information and / or date, determine the set of pest and disease types P that may occur currently;
[0095] Perform sample label correction or sample annotation according to the classification probability of the pest and disease type set P, the pest and disease classification label set C, and the semantic similarity between the pests and diseases;
[0096] Update pest and disease models based on label-corrected samples or newly annotated samples.
[0097] Through continuous updating of the model, the embodiment of the present invention makes the recognition accuracy of the model for pests and diseases higher and higher, and more and more types can be recognized, thereby reducing the cost of manual labeling.
[0098] In the embodiment of the present invention, the method by which the updating module 204 determines the pest classification label set C is:
[0099] The current farmland environmental data is input into the pest and disease model for classification, and the classification result is the pest and disease classification label set C.
[0100] In one embodiment, the updating module 204 is also used to create a pest and disease semantic similarity file before performing sample label correction or sample annotation.
[0101] In the embodiment of the present invention, the updating module 204 establishes a pest semantic similarity file, including:
[0102] Training doc2vec model based on agricultural corpus;
[0103] Descriptive information of each pest and disease was obtained from the online database;
[0104] Determine the word vector corresponding to each pest based on the doc2vec model;
[0105] Based on the word vector of each pest, the semantic similarity value between each pest disease is calculated to describe the similarity of the symptoms between two pest diseases.
[0106] In the embodiment of the present invention, the updating module 204 performs sample label correction or sample annotation according to the classification probability of the pest type set P, the pest classification label set C, and the semantic similarity between the pests, including:
[0107] When it is determined that the classification label c is in the pest type set P and the classification probability of the classification label c is greater than 1 / n, it means that the classification is correct, and the sample label correction or sample marking operation is omitted;
[0108] Determine that the classification label c is not in the pest and disease type set P, but the classification label set C has an intersection F with the pest and disease type set P, and the classification probability of the label with the highest classification label probability in F is greater than 1 / n, then replace the classification label c with the label with the highest classification label probability;
[0109] Determine that the classification label set C and the pest and disease type set P have an intersection F, the classification probability of the classification labels in F is less than 1 / n, and the classification label c is greater than 1 / n, then determine the semantic similarity between the word vector corresponding to each pest and disease in the pest and disease type set P and the word vector corresponding to the classification label c, and select the pest and disease p with the greatest semantic similarity as the new label;
[0110] Determine that the classification label set C has no intersection with the pest type set P, and the classification label c is greater than 1 / n, then determine the semantic similarity between the word vector corresponding to each pest in the pest type set P and the word vector corresponding to the classification label c, and select the pest p with the greatest semantic similarity as the new label;
[0111] When it is determined that the classification label c is less than 1 / n, it means that the pest model does not contain the correct classification label, and manual labeling is performed;
[0112] Wherein, n is the total number of pest and disease categories in the classification label set C.
[0113] The embodiment of the present invention further provides an agricultural pest control device, the device comprising: a processor and a memory for storing a computer program that can be run on the processor,
[0114] Wherein, when the processor is used to run the computer program, it executes:
[0115] Monitor current farmland environmental data;
[0116] Classify and predict the environmental data based on the trained pest and disease model;
[0117] Semantically map the classification results with the semantic knowledge in agricultural ontology;
[0118] Updating the agricultural ontology using the mapped semantic concepts;
[0119] Agricultural operation events are obtained based on the updated agricultural ontology reasoning.
[0120] The processor is further configured to execute, when running the computer program:
[0121] The trained pest and disease model is updated based on the preset sample processing mechanism.
[0122] When the trained pest and disease model is updated based on the preset sample processing mechanism, the processor is also used to execute the following when running the computer program:
[0123] Based on the pest and disease related knowledge in semantic technology and according to the current agricultural environment data and / or crop information and / or date, determine the set of pest and disease types P that may occur currently;
[0124] Perform sample label correction or sample annotation according to the classification probability of the pest and disease type set P, the pest and disease classification label set C, and the semantic similarity between the pests and diseases;
[0125] Update pest and disease models based on label-corrected samples or newly annotated samples.
[0126] The method for determining the pest classification label set C is as follows:
[0127] The current farmland environmental data is input into the pest and disease model for classification, and the classification result is the pest and disease classification label set C.
[0128] Before performing sample label correction or sample labeling, the processor is further configured to execute, when running the computer program:
[0129] Establish a semantic similarity file for pests and diseases.
[0130] When establishing the pest and disease semantic similarity file, the processor is further configured to execute, when running the computer program:
[0131] Training doc2vec model based on agricultural corpus;
[0132] Descriptive information of each pest and disease was obtained from the online database;
[0133] Determine the word vector corresponding to each pest based on the doc2vec model;
[0134] Based on the word vector of each pest, the semantic similarity value between each pest disease is calculated to describe the similarity of the symptoms between two pest diseases.
[0135] When performing sample label correction or sample annotation based on the pest type set P, the classification probability of the pest classification label set C, and the semantic similarity between the pests, the processor is further configured to execute, when running the computer program:
[0136] When it is determined that the classification label c is in the pest type set P and the classification probability of the classification label c is greater than 1 / n, it means that the classification is correct, and the sample label correction or sample marking operation is omitted;
[0137] Determine that the classification label c is not in the pest and disease type set P, but the classification label set C has an intersection F with the pest and disease type set P, and the classification probability of the label with the highest classification label probability in F is greater than 1 / n, then replace the classification label c with the label with the highest classification label probability;
[0138] Determine that the classification label set C and the pest and disease type set P have an intersection F, the classification probability of the classification labels in F is less than 1 / n, and the classification label c is greater than 1 / n, then determine the semantic similarity between the word vector corresponding to each pest and disease in the pest and disease type set P and the word vector corresponding to the classification label c, and select the pest and disease p with the greatest semantic similarity as the new label;
[0139] Determine that the classification label set C has no intersection with the pest type set P, and the classification label c is greater than 1 / n, then determine the semantic similarity between the word vector corresponding to each pest in the pest type set P and the word vector corresponding to the classification label c, and select the pest p with the greatest semantic similarity as the new label;
[0140] When it is determined that the classification label c is less than 1 / n, it means that the pest model does not contain the correct classification label, and manual labeling is performed;
[0141] Wherein, n is the total number of pest and disease categories in the classification label set C.
[0142] It should be noted that: the device provided in the above embodiment is only illustrated by the division of the above program modules when performing agricultural pest control. In actual application, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the device provided in the above embodiment and the corresponding method embodiment belong to the same concept, and its specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0143] In an exemplary embodiment, an embodiment of the present invention further provides a computer-readable storage medium, which may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc.
[0144] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the computer program performs:
[0145] Monitor current farmland environmental data;
[0146] Classify and predict the environmental data based on the trained pest and disease model;
[0147] Semantically map the classification results with the semantic knowledge in agricultural ontology;
[0148] Updating the agricultural ontology using the mapped semantic concepts;
[0149] Agricultural operation events are obtained based on the updated agricultural ontology reasoning.
[0150] When the computer program is executed by a processor, it also performs:
[0151] The trained pest and disease model is updated based on the preset sample processing mechanism.
[0152] When the trained pest and disease model is updated based on the preset sample processing mechanism, when the computer program is executed by the processor, the following steps are also performed:
[0153] Based on the pest and disease related knowledge in semantic technology and according to the current agricultural environment data and / or crop information and / or date, determine the set of pest and disease types P that may occur currently;
[0154] Perform sample label correction or sample annotation according to the classification probability of the pest and disease type set P, the pest and disease classification label set C, and the semantic similarity between the pests and diseases;
[0155] Update pest and disease models based on label-corrected samples or newly annotated samples.
[0156] The method for determining the pest classification label set C is as follows:
[0157] The current farmland environmental data is input into the pest and disease model for classification, and the classification result is the pest and disease classification label set C.
[0158] Before performing sample label correction or sample labeling, when the computer program is executed by the processor, the following steps are further performed:
[0159] Establish a semantic similarity file for pests and diseases.
[0160] When the pest and disease semantic similarity file is established, the computer program is executed by the processor and further executes:
[0161] Training doc2vec model based on agricultural corpus;
[0162] Descriptive information of each pest and disease was obtained from the online database;
[0163] Determine the word vector corresponding to each pest based on the doc2vec model;
[0164] Based on the word vector of each pest, the semantic similarity value between each pest disease is calculated to describe the similarity of the symptoms between two pest diseases.
[0165] When performing sample label correction or sample annotation based on the pest type set P, the classification probability of the pest classification label set C, and the semantic similarity between the pests, the computer program, when executed by the processor, further executes:
[0166] When it is determined that the classification label c is in the pest type set P and the classification probability of the classification label c is greater than 1 / n, it means that the classification is correct, and the sample label correction or sample marking operation is omitted;
[0167] Determine that the classification label c is not in the pest and disease type set P, but the classification label set C has an intersection F with the pest and disease type set P, and the classification probability of the label with the highest classification label probability in F is greater than 1 / n, then replace the classification label c with the label with the highest classification label probability;
[0168] Determine that the classification label set C and the pest and disease type set P have an intersection F, the classification probability of the classification labels in F is less than 1 / n, and the classification label c is greater than 1 / n, then determine the semantic similarity between the word vector corresponding to each pest and disease in the pest and disease type set P and the word vector corresponding to the classification label c, and select the pest and disease p with the greatest semantic similarity as the new label;
[0169] Determine that the classification label set C has no intersection with the pest type set P, and the classification label c is greater than 1 / n, then determine the semantic similarity between the word vector corresponding to each pest in the pest type set P and the word vector corresponding to the classification label c, and select the pest p with the greatest semantic similarity as the new label;
[0170] When it is determined that the classification label c is less than 1 / n, it means that the pest model does not contain the correct classification label, and manual labeling is performed;
[0171] Wherein, n is the total number of pest and disease categories in the classification label set C.
[0172] The present invention is described below in conjunction with scenario embodiments.
[0173] This embodiment proposes an agricultural pest control system based on semantic technology and machine learning. The system diagram is as follows Figure 3 The system is mainly divided into three modules: pest and disease model training, agricultural semantic knowledge base and sample processing mechanism. These three modules are linked through pest and disease model update, ontology update and reasoning, and event control, forming a set of agricultural pest and disease automation prevention and control system, which improves the accuracy and recall rate of pest and disease identification and the automation level of equipment control.
[0174] Taking the prevention and control of apple tree pests and diseases as an example, the implementation method of this embodiment is introduced below, and the specific process is as follows:
[0175] 1. Pest and disease model training
[0176] In the pest model training module, model training is performed based on historically marked pest image data to obtain a pest model, and then the pest types of crops are judged based on the image information taken in the farmland. This embodiment does not limit the machine learning method of model training.
[0177] 2. Agricultural semantic knowledge base: semantic mapping, ontology updating and reasoning decision-making
[0178] 1) Introduction to agricultural ontology knowledge model
[0179] Ontology is a conceptual abstraction of things in a domain and the relationships between things. It is organized in a hierarchical structure and is used to describe, represent and obtain knowledge in related domains. Ontology can provide semantic knowledge and common understanding in the domain, determine commonly recognized concepts (classes) and relationships (attributes) between concepts in the domain, and achieve sharing between people, people and machines, and machines and machines. As a form of knowledge expression, ontology is of great significance for realizing the automation and intelligent scenarios of the Internet of Things. It can also provide external knowledge for technologies such as machine learning to improve learning performance.
[0180] There are many interrelated entities (concepts) in the agricultural Internet of Things, including agricultural execution equipment, agricultural sensors, types of pests and diseases, factors that cause pests and diseases (such as external factors such as temperature and humidity), pest and disease control measures, crops, farmland, etc. These entities are interrelated, support and collaborate with each other, and constitute the framework of the agricultural Internet of Things. This embodiment creates an agricultural Internet of Things domain ontology (agricultural knowledge base) based on semantic technology to describe related information such as resources, data, time and space, and pest and disease control in agriculture and the relationships between them. The agricultural ontology knowledge model constitutes the basis for knowledge reasoning in the entire agriculture, allowing each concept such as sensor or smart device to share semantic knowledge. For example, the agricultural ontology knowledge model Figure 4 As shown (including some ontology knowledge models in agriculture).
[0181] 2) Semantic Mapping
[0182] The classification labels in the pest model are semantically mapped with the pest concept classes in the ontology. The semantic mapping is as follows: Figure 5 As shown in the figure. The classification labels "leaf spot", "brown spot", "anthracnose leaf blight" and so on after machine learning are mapped to the categories of apple diseases in the ontology and mapped to instances of these classes. For example, the classification label "leaf spot" is mapped to an instance of the "leaf spot" class in the ontology. After semantic mapping, "leaf spot", "brown spot" and "anthracnose leaf blight" are no longer labels, but an instance of pests and diseases at the semantic level, with certain semantics. Based on the ontology, the equipment in the farmland can understand the meaning of "leaf spot", "brown spot" and "anthracnose leaf blight", and realize data sharing and interoperability.
[0183] 3) Ontology update and reasoning
[0184] Semantic mapping, ontology updating and reasoning flow chart Figure 6 As shown, including:
[0185] Step 601: Sensor equipment in the farmland monitors farmland environmental data (including image data) in real time;
[0186] Step 602: using the trained pest and disease model to perform classification prediction on the current image data;
[0187] Step 603: semantically mapping the classification results with the concepts in the agricultural ontology;
[0188] Step 604: Update the agricultural ontology using the mapped semantic concepts;
[0189] Step 605: Perform reasoning based on the updated agricultural ontology to infer agricultural operation events.
[0190] At this time, the image data is predicted to be labeled "brown spot disease", and then the "brown spot disease" label is mapped to an instance of the "brown spot disease" class in the ontology, and it is updated to the ontology model. At this time, the "brown spot disease" class has an instance of "brown spot disease". Based on the updated ontology, the "spraying" event is obtained through reasoning. For example, the reasoning rule: (a type farmland) and (a has_disease b) and (b instance "brown spot disease") → (a has_treatment "spraying").
[0191] 3. Sample processing mechanism
[0192] Since the symptoms of many pests and diseases are very similar (e.g., the symptoms of brown spot disease, leaf spot disease, and anthracnose leaf blight of apple trees are very similar, and people sometimes cannot distinguish them with the naked eye), the accuracy of pests and diseases in the image recognition process decreases. At the same time, there are many types of pests and diseases, and it is time-consuming and laborious to manually label each type of pest and disease image data. An automated labeling mechanism is needed to label unlabeled pest and disease types and improve the recall and accuracy of pest and disease. This embodiment proposes a mechanism for processing sample data based on semantic knowledge, which can correct incorrectly labeled data and label new categories of pests and diseases.
[0193] The sample processing mechanism is described in detail below. The specific implementation flowchart is as follows Figure 7 As shown, including:
[0194] Step 701: obtaining a pest classification label c and a possible pest type set P;
[0195] The classification label set in the pest model is C = {c1, c2, ..., c nFirst, the image information of the current farmland is input into the pest classification model for classification, and the classification result is c; then based on the current farmland temperature, humidity, and crop date information in the agricultural knowledge base, the possible pest type set P = {p1, p2, ..., p m}, m is the number of possible pests and diseases. For example, (a type farmland) and (a has_temperature_sensor b) and (b hasValue "35") (a has_humidity_sensor c) and (c hasValue "75") (a has_data "August 3") → (a has_disease "brown spot disease", "red spider", "leaf roller").
[0196] Step 702: Select samples based on the classification probability and the possible pest and disease type set P
[0197] Before selecting samples, we first introduce the pest and disease similarity file. The construction process of the pest and disease similarity file is as follows: Figure 8 As shown, including:
[0198] Step 801: training a doc2vec model based on an agricultural corpus;
[0199] Step 802: Searching for description information of each pest from Wikipedia;
[0200] Step 803: infer the word vector corresponding to each pest based on the doc2vec model;
[0201] Step 804: Based on the word vector of each disease and insect pest, the semantic similarity between each disease is calculated to describe the similarity of symptoms between two diseases.
[0202] For example: Brown spot disease = (-0.878781-2.112356 1.204208……1.129659 0.363234)
[0203] Leaf spot disease = (1.041078-1.249182 0.272419……-1.952982 2.179033)
[0204] The following describes how to select samples based on the classification probability, the possible pest and disease type set P, and the pest and disease similarity file. The flowchart is as follows Figure 7 As shown in Figure 2, the results of sample selection can be divided into three categories: one is correct classification, such as Figure 7 ①; one is a classification error, but there is such a disease in the pest model, so the label is corrected, such as Figure 7②; Another category is misclassification, but there is no such disease in the pest model, so a new label needs to be re-labeled, such as Figure 7 ③④. The specific selection rules are as follows:
[0205] 1) If the classification label c is in the possible pest and disease type set P (c∈P), and the classification probability of the c label is greater than 1 / n, then the classification is correct, such as Figure 7 Middle①.
[0206] 2) If the classification label c is not in the possible pest and disease type set P, but the pest and disease model label set C and the possible pest and disease type set P have an intersection F (C∩P=F), and the label c with the highest probability of classification label in F i If the classification probability is greater than 1 / n, the classification label c is corrected to label c i ,like Figure 7 ②. Then, the pest and disease model is updated based on the corrected labels to improve the accuracy of the model.
[0207] 3) If the model classification label set C and the possible pest and disease type set P have an intersection of F (C∩P=F), the classification probability of the model classification label in F is less than 1 / n, and the classification label c is greater than 1 / n, then it means that the classification model does not contain the correct classification label, and a new category needs to be marked, and the newly marked category label is similar to the category label c. Therefore, calculate the probability of each pest and disease p in the possible pest and disease type set P i The word vector of the label c is similar to the word vector of the label c, and the pest p with the largest semantic similarity is selected as the new label, as shown in formula (1). The pest model is updated with the new label and trained, thereby adding a new category to the model and improving the recall and precision of pests and diseases. Figure 7 Middle ③.
[0208]
[0209] 4) If the model classification label set C has no intersection with the possible pest and disease type set P (C∩P=ф), and the classification label c is greater than 1 / n, it means that the classification model does not contain the correct classification label, and a new category needs to be marked, and the newly marked category label is similar to the category label c. Therefore, calculate the number of each pest and disease p in the set P i The semantic similarity between the corresponding word vector and the word vector corresponding to label c is calculated, and the pest p with the largest semantic similarity is selected as the new label, as shown in formula (1). The pest model is updated with the new label and trained, thereby adding a new category to the model and improving the recall and accuracy of pests. Figure 7 Middle ③.
[0210] 5) Regardless of whether the classification label set C and the possible pest and disease type set P have an intersection, when the classification label c is less than 1 / n, it means that the probability of all categories is less than 1 / n, and the classification model does not contain the correct classification label, and a new category needs to be marked. Because the probability of all categories is less than 1 / n, it means that the similarity between the current image category and the category in the classification model is very small, and manual participation is required for labeling, such as Figure 7 Middle ④.
[0211] It should be noted that if the model is updated slowly, the corrected labels can be put together for model update at night.
[0212] Step 703: Automatically control pests and diseases according to the classification labels.
[0213] Based on the classification labels finally determined in step 702, the knowledge base is updated, and then the knowledge base is inferred to infer the treatment plan, and the corresponding equipment is automatically controlled to treat the pests and diseases. For example, the inference rule: (a type farmland) and (a has_disease b) and (b instance "brown spot disease") → (a has_treatment "spraying").
[0214] The embodiment of the present invention also combines semantic technology with machine learning to design an automated decision-making and control system for the agricultural Internet of Things. The system first uses the sample processing mechanism proposed in this solution to update the model, then semantically maps the classification information of machine learning with the semantic knowledge in the agricultural ontology, and finally, with the help of the rich entities in the ontology and the relationships between the entities, a prevention and control plan is obtained through reasoning, thereby realizing automated control of pests and diseases in the agricultural Internet of Things. Decisions and controls can be made based on multiple information such as the agricultural environment and crop habits.
[0215] The embodiment of the present invention provides a sample processing mechanism to improve the accuracy and recall rate of pest and disease identification. The sample processing mechanism first infers the set P of pest and disease types that may occur based on the pest and disease related knowledge in semantic technology, according to the current agricultural environmental data, crop information, and date, and then corrects the sample labels or annotates new samples according to the relationship between the set P and the classification results of the pest and disease classification model; finally, the model is updated according to the label-corrected samples or the newly annotated samples. Through the continuous updating of the model, the model's recognition accuracy of pests and diseases becomes higher and higher, and more and more types can be identified, which reduces the cost of manual labeling and improves the recall rate.
[0216] The embodiment of the present invention also designs a method for constructing a pest and disease similarity file. The doc2vec model is trained based on the agricultural corpus to infer the word vector corresponding to each disease. Finally, based on the word vector of each disease, the semantic similarity between each pest and disease can be calculated to determine the similarity of the symptoms of the two pests and diseases.
[0217] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention.
Claims
1. A method for controlling agricultural pests and diseases, characterized in that: The method includes: Monitor current farmland environmental data; Classify and predict the environmental data based on the trained pest and disease model; Semantically map the classification results with the semantic knowledge in agricultural ontology; Updating the agricultural ontology using the mapped semantic concepts; The agricultural operation events are obtained based on the updated agricultural ontology reasoning; The method further includes: Update the trained pest and disease model based on the preset sample processing mechanism; The updating of the trained pest and disease model based on the preset sample processing mechanism includes: Based on the pest and disease related knowledge in semantic technology and according to the current agricultural environment data and / or crop information and / or date, determine the set of pest and disease types P that may occur currently; Perform sample label correction or sample annotation according to the classification probability of the pest and disease type set P, the pest and disease classification label set C, and the semantic similarity between the pests and diseases; Update pest and disease models based on label-corrected samples or newly annotated samples; The sample label correction or sample annotation is performed according to the classification probability of the pest type set P, the pest classification label set C, and the semantic similarity between the pests, including: When it is determined that the classification label c is in the pest type set P and the classification probability of the classification label c is greater than 1 / n, it means that the classification is correct, and the sample label correction or sample marking operation is omitted; Determine that the classification label c is not in the pest and disease type set P, but the classification label set C has an intersection F with the pest and disease type set P, and the classification probability of the label with the highest classification label probability in F is greater than 1 / n, then replace the classification label c with the label with the highest classification label probability; Determine that the classification label set C and the pest and disease type set P have an intersection F, the classification probability of the classification labels in F is less than 1 / n, and the classification label c is greater than 1 / n, then determine the semantic similarity between the word vector corresponding to each pest and disease in the pest and disease type set P and the word vector corresponding to the classification label c, and select the pest and disease p with the greatest semantic similarity as the new label; Determine that the classification label set C has no intersection with the pest type set P, and the classification label c is greater than 1 / n, then determine the semantic similarity between the word vector corresponding to each pest in the pest type set P and the word vector corresponding to the classification label c, and select the pest p with the greatest semantic similarity as the new label; When it is determined that the classification label c is less than 1 / n, it means that the pest model does not contain the correct classification label, and manual labeling is performed; Wherein, n is the total number of pest and disease categories in the classification label set C.
2. The method according to claim 1, characterized in that The method for determining the pest classification label set C is as follows: The current farmland environmental data is input into the pest and disease model for classification, and the classification result is the pest and disease classification label set C.
3. The method according to claim 1, characterized in that: Before performing sample label correction or sample labeling, the method further includes: Establish semantic similarity files of pests and diseases.
4. The method according to claim 3, characterized in that The step of establishing a pest and disease semantic similarity file includes: Training doc2vec model based on agricultural corpus; Descriptive information of each pest and disease was obtained from the online database; Determine the word vector corresponding to each pest based on the doc2vec model; Based on the word vector of each pest, the semantic similarity value between each pest disease is calculated to describe the similarity of the symptoms between two pest diseases.
5. An agricultural pest control device, characterized in that: The device includes: Monitoring module, used to monitor the current farmland environmental data; A classification module, used for classifying and predicting the environmental data based on the trained pest and disease model; A mapping module is used to semantically map the classification results with the semantic knowledge in the agricultural ontology; An updating module, used for updating the agricultural ontology using the mapped semantic concepts; Reasoning module, used to obtain agricultural operation events based on the updated agricultural ontology; The updating module is also used to update the trained pest and disease model based on a preset sample processing mechanism; The updating module is also used to determine the set of pests and diseases types P that may occur currently based on pest and disease related knowledge in semantic technology and according to current agricultural environmental data and / or crop information and / or date; Perform sample label correction or sample annotation according to the classification probability of the pest and disease type set P, the pest and disease classification label set C, and the semantic similarity between the pests and diseases; Update pest and disease models based on label-corrected samples or newly annotated samples; The sample label correction or sample annotation is performed according to the classification probability of the pest type set P, the pest classification label set C, and the semantic similarity between the pests, including: When it is determined that the classification label c is in the pest type set P and the classification probability of the classification label c is greater than 1 / n, it means that the classification is correct, and the sample label correction or sample marking operation is omitted; Determine that the classification label c is not in the pest and disease type set P, but the classification label set C has an intersection F with the pest and disease type set P, and the classification probability of the label with the highest classification label probability in F is greater than 1 / n, then replace the classification label c with the label with the highest classification label probability; Determine that the classification label set C and the pest and disease type set P have an intersection F, the classification probability of the classification labels in F is less than 1 / n, and the classification label c is greater than 1 / n, then determine the semantic similarity between the word vector corresponding to each pest and disease in the pest and disease type set P and the word vector corresponding to the classification label c, and select the pest and disease p with the greatest semantic similarity as the new label; Determine that the classification label set C has no intersection with the pest type set P, and the classification label c is greater than 1 / n, then determine the semantic similarity between the word vector corresponding to each pest in the pest type set P and the word vector corresponding to the classification label c, and select the pest p with the greatest semantic similarity as the new label; When it is determined that the classification label c is less than 1 / n, it means that the pest model does not contain the correct classification label, and manual labeling is performed; Wherein, n is the total number of pest and disease categories in the classification label set C.
6. An agricultural pest control device, characterized in that: The apparatus comprises: a processor and a memory for storing a computer program capable of running on the processor, Wherein, when the processor is used to run the computer program, the steps of the method described in any one of claims 1-4 are executed.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
