Agricultural disaster warning and consultation response method based on dynamic knowledge graph
By applying dynamic knowledge graphs and a variety of neural network technologies in the agricultural field, the problems of low intent identification and early warning model efficiency are solved, and high-accuracy and targeted agricultural disaster warning and intelligent response are achieved.
Patent Information
- Application Number
- CN202411883138.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-04
AI Technical Summary
The prior art has low accuracy in disaster warning and consultation response in agricultural fields, lacks understanding of user intentions, and the convergence speed of the early warning model is slow, making it easy to fall into local minimization.
Using a dynamic knowledge graph based method, a knowledge graph is constructed by collecting agricultural expert consulting data, combining convolutional neural networks, generation adversarial neural networks and Bayesian neural networks to realize user intention recognition, intelligent response and agricultural disaster warning.
It improves the accuracy of dialogue intention recognition, improves the accuracy and pertinence of agricultural intelligent responses, solves the problems of slow convergence speed and easy fall into local minimization of traditional early warning models, and significantly improves the effect of disaster early warning.
Smart Images

Figure CN119760085A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data analysis and processing, and specifically relates to a disaster early warning and consultation response method in the agricultural field based on a dynamic knowledge graph. Background Art
[0002] The intelligent question-answering system based on the knowledge graph of agricultural pests and diseases can help farmers and agricultural practitioners solve pest and disease problems quickly and accurately and improve agricultural production efficiency. By using technologies such as natural language processing and machine learning, the system can automatically analyze questions raised by users and find relevant information in the knowledge graph for intelligent answers. The intelligent question-answering system based on the knowledge graph of agricultural pests and diseases will become one of the important applications of smart agriculture in the future.
[0003] However, the prior art has the following defects: 1. The current methods for implementing intent recognition for user questions mainly include rule classification based on dictionary templates, past log matching, intent recognition based on classification models, traditional machine learning methods (such as support vector machines and random forests), etc. The accuracy of intent recognition is low.
[0004] 2. The current generative dialogue model is mainly focused on improving the language quality of sentences generated by the dialogue system, including grammaticality, diversity, topic relevance, etc., but lacks understanding of user intentions.
[0005] 3. Artificial neural networks have been widely used in prediction and early warning, and have also achieved certain results in pest and disease early warning. Experiments have shown that the BP neural network has a high accuracy in agricultural pest and disease early warning, but it also has problems such as slow convergence speed and easy to fall into local minimization. Summary of the invention
[0006] In order to solve the problems raised in the above background technology, the present invention provides an agricultural disaster warning and consultation response method based on a dynamic knowledge graph to solve the problems of low accuracy of intent recognition, lack of understanding of user intent, slow convergence of warning, and easy to fall into local minimization in the prior art.
[0007] To achieve the above object, the present invention provides the following technical solutions: The agricultural disaster warning and consultation response method based on dynamic knowledge graph includes the following steps: S1: Collect a preset amount of agricultural expert consultation data as basic data and build a knowledge graph based on the basic data; S2: training a convolutional neural network. The trained convolutional neural network is used to extract key information of the user's input consulting question text. S3: Generate adversarial neural networks through data training in the knowledge graph. The trained generative adversarial neural networks are used to generate response data for the key information of intent extracted by the convolutional neural network. S4: Construct an agricultural early warning model based on Bayesian neural network, train the agricultural early warning model through the data in the knowledge graph, and use the trained agricultural early warning model to provide agricultural disaster early warning for agricultural production by inputting agricultural production data; S5: Input the user inquiry question text to be answered into the convolutional neural network to obtain the corresponding key information of the intent, then input the corresponding key information of the intent into the generative adversarial neural network to obtain the corresponding response data, input the agricultural production data to be predicted into the agricultural early warning model to obtain the corresponding agricultural disaster warning.
[0008] Preferably, S1 specifically comprises the following steps: S1.1: Collect a preset amount of agricultural expert consultation data; S1.2: Preprocess the collected agricultural expert consultation data to obtain processed data, and the preprocessing includes cleaning and denoising operations; S1.3: Extract knowledge from structured data in the processed data based on preset rules; S1.4: Construct agricultural ontology and define classes, relationships, attributes and set corresponding constraints to clarify the boundaries of knowledge extraction; S1.5: Based on the agricultural ontology, use deep learning methods to extract knowledge from unstructured data in the processed data; S1.6: Store the structured data and unstructured extracted triple data together in the graph data and display them visually.
[0009] Preferably, S2 specifically includes the following steps: S2.1: Clean the text of the consultation question input by the user; S2.2: Segment the cleaned text into words and characters; S2.3: Pre-train the word vectors and character vectors of the word2vec model using the agricultural terminology corpus; S2.4: Use the pre-trained word vectors and character vectors to embed the text into words and characters to obtain embedded text; S2.5: The embedded text is fed into a convolutional neural network. The convolution kernel of the convolutional neural network calculates the n-gram features of the text along the text sequence dimension, and obtains feature information of different spans through convolution kernels of different sizes. S2.6: Use the maximum pooling method to extract key features from the information extracted by each convolution kernel; S2.7: Fuse multiple key features to obtain the key information of the entire intention of the text of the consultation question input by the user, i.e., the semantic vector; S2.8: Perform softmax calculation on the semantic vector to obtain the probability distribution of the consulting question in each intent category, and select the category with the largest probability value as the calculated key information of the intent; S2.9: Optimize the convolutional neural network by performing backpropagation calculations on the error between the calculated probability distribution and the true intent category label encoding of the consulting question.
[0010] Preferably, S3 is specifically: S3.1: Obtain the text of the consulting question and the corresponding key information of the intent, integrate the text features and intent features of the consulting question to obtain the comprehensive features, and use the generative neural network model based on the Encoder-Decoder architecture to extract the context information and high-level semantic expression of the comprehensive features, and generate a reply based on the knowledge graph; S3.2: Build a discriminative neural network model. The discriminative neural network model is used to judge the gap between the generated replies and the real replies, and adjust the generative neural network model based on the gap and the output of the discriminative neural network model.
[0011] Preferably, the Encoder-Decoder architecture includes two sub-models, Encoder and Decoder, each sub-model is a BiLSTM neural network structure expanded in the time dimension, and the Encoder-Decoder architecture uses an input sequence data to generate an output sequence data. Through the Encoder's neural network, the input user question is extracted as a latent variable containing global information, and then the latent variable is used as the input of the Decoder's neural network to generate a reply text.
[0012] Preferably, S4 is specifically: S4.1: Extract historical consultation data, meteorological information data, agricultural park sensor data and disaster data from the knowledge graph, and extract disaster-related entities through entity keyword filtering; S4.2: Set a training set and a test set based on the entity, use the training set to train the Bayesian neural network model, and then use the test set to verify the accuracy of the Bayesian neural network model; S4.3: Construct an agricultural disaster warning model; first initialize the structural parameters, weights and thresholds of the Bayesian neural network model, select the activation function of the Bayesian neural network model, use the Bayesian theorem to obtain the distribution of the weights and thresholds of the input data, then use the obtained optimal solution to train the network, and finally perform error correction on the output results and output them.
[0013] Compared with the prior art, the present invention has the following beneficial effects: 1. This application designs a deep convolutional neural network based on intent recognition to improve the accuracy of conversation intent recognition. This application can take into account the correctness and real-time nature of user intent analysis at the same time. Through multi-dimensional convolution and iterative optimization training of model data, it can better learn user question data, extract key information from user questions, and correctly identify text intent based on key information.
[0014] 2. The generative adversarial neural network designed and constructed in this application can perform user intent analysis and improve the accuracy and pertinence of agricultural intelligent responses. By utilizing the powerful modeling capabilities and adversarial learning ideas of the generative adversarial neural network, it can better complete feature extraction and generate reasonable, helpful responses targeting specific intentions based on the features.
[0015] 3. This application constructs an early warning model based on Bayesian neural network, which improves the early warning effect, plays a guiding role in agricultural disaster prevention and control, and solves the problems of slow convergence speed and easy to fall into local minimization of traditional BP neural network. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a schematic diagram of the overall process of this application; Figure 2 Schematic diagram of the process built for the knowledge graph; Figure 3 This is a schematic diagram of the pre-processing process for consulting questions; Figure 4 It is a schematic diagram of the structure of the convolutional neural network; Figure 5 The figure is a schematic diagram of the response data generation process. DETAILED DESCRIPTION
[0017] In order to facilitate those skilled in the art to understand the technical content of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific examples. It should be understood that the specific examples described herein are only used to explain the present invention and are not used to limit the present invention.
[0018] Example 1 Agricultural disaster warning and consultation response methods based on dynamic knowledge graphs, such as Figure 1 As shown, the following steps are included: S1: Automatic construction of knowledge graph based on massive question-answer information; The user demands of the front-end of agricultural intelligent question and answer are heterogeneous and diverse, with scattered structures and unclear and inaccurate knowledge expression. Therefore, there are a large number of expected demands for natural language representation. This type of demand is not only an important measure of farmers' satisfaction with answers, but also a driving force for innovation and development. However, this type of demand is often the most prominent type of demand with fuzziness, incompleteness and subjective limitations. In view of the above technical difficulties, an entity relationship extraction method based on a standard system is adopted. In the process of named entity recognition and relationship extraction tasks in the construction of knowledge graphs, corpus annotation is a very important link. Traditional corpus annotation may not be applicable to all fields. This application uses a annotation system suitable for corpus terms based on the characteristics of the agricultural terminology corpus to realize the joint extraction of entities and relationships, transforms the entity and relationship extraction tasks into sequence annotation problems, and simultaneously annotates entities and relationships, directly models triples, obtains triple data through label matching and mapping, improves annotation efficiency, and alleviates the problem of overlapping relationship extraction. Due to the specialization of specific industries, complex and ever-changing business needs, and the requirement for high-quality data, vertical fields often adopt a top-down knowledge graph construction model, that is, first define the ontology and data model, and then fill the entities and their relationships into the knowledge graph. Therefore, this study adopts a top-down model. The specific knowledge graph construction process is as follows: Figure 2 As shown, it mainly includes the following steps: S1.1: Use the one million basic consultation question and answer data collected by Sichuan Science and Technology Village Online Platform as agricultural expert consultation data; S1.2: Preprocess the collected agricultural expert consultation data to obtain processed data, and the preprocessing includes cleaning and denoising operations; S1.3: Extract knowledge from structured data in the processed data based on preset rules; S1.4: Construct agricultural ontology and define classes, relationships, attributes and set corresponding constraints to clarify the boundaries of knowledge extraction; S1.5: Based on the agricultural ontology, use deep learning methods to extract knowledge from unstructured data in the processed data; S1.6: Store the structured data and unstructured extracted triple data together in the graph data and display them visually.
[0019] S2: Training a convolutional neural network for user intent recognition; In the automatic answering business, there are situations where users do not clearly express the questions they need to consult and their intentions are not clear, so it is necessary to identify and judge the user's intentions. User intent recognition aims to clarify user intentions and help the system correctly analyze the user's question intentions so that it can provide accurate answers. The application of convolutional neural networks (CNN) in text intent understanding and recognition can better extract n-gram features in the text, calculate multiple adjacent words simultaneously within a specified area span, and combine the semantics after word segmentation (characters). Perform data cleaning on the user's question text, segment the cleaned text, and then embed the processed text into words through pre-trained vectors, and send it to the convolutional neural network for training, and finally obtain the trained model. The specific process is as follows: Figure 3 shown.
[0020] This application intends to use an end-to-end model to identify the intent of user question text. The preprocessed text is pre-trained with word vectors and character vectors through the word2vec model. The text is embedded with words (characters) through the pre-trained vectors so that the words and characters have relatively more features, and then sent to the convolutional neural network for learning. The convolution kernel calculates the n-gram features of the text along the text sequence dimension, and extracts feature information of different spans through a variety of convolution kernels of different sizes. Then, the maximum pooling method is used to extract the key features from the information extracted by each convolution kernel, and multiple key features are spliced to obtain the final key information (semantic vector) of the user question text. The probability distribution of the question in each intent category is obtained by performing Softmax calculation on the semantic vector. The category with the largest probability value is the calculated question intent. During the training process, the error between the calculated probability distribution of the question intent and the true intent category label encoding of the question is used to perform back propagation calculations to optimize the model. The proposed model architecture is as follows: Figure 4 shown.
[0021] S3: Training Generative Adversarial Neural Networks; Generative Adversarial Networks (GAN) is a generative model proposed by Ian Goodfellow et al. in 2014. It has become a hot research direction in the field of artificial intelligence. Its basic idea is inspired by the two-person zero-sum game in game theory (that is, the sum of the interests of the two parties is zero, and the gain of one party is the loss of the other party). The system consists of a generator and a discriminator. The model is trained by adversarial learning, with the aim of estimating the potential distribution of real data samples and generating new data samples. It has achieved great success in the fields of image and visual computing, speech processing, information security, and chess competitions.
[0022] This application will first analyze the intent of user questions, then integrate the original question text features and intent features, and use a generative neural network model based on the Encoder-Decoder architecture to extract the contextual information and high-level semantic expressions of the comprehensive features, and generate responses to user-specific questions and intentions. This structure contains two sub-models, Encoder and Decoder, each of which is a BiLSTM neural network structure that is expanded in the time dimension. The Encoder-Decoder neural network model can generate an output sequence data using an input sequence data. In the generative answering task, through the Encoder neural network, we can extract the input user question into a hidden variable containing global information, and then use the hidden variable as the input of the Decoder neural network to generate a reply text. However, in this case, the vast majority of the answers to the reply text generated are seriously similar and have no practical value, that is, the human-computer dialogue cannot proceed further. Therefore, to solve this problem, a discriminative neural network model needs to be built to judge how far the generated results differ from the real responses, and to adjust the generative neural network model according to the output of the discriminative neural network model, so that it can tell the generative neural network model that the severely convergent responses generated by the generative neural network model are poor results, thereby forcing the generative neural network model to automatically generate specific and helpful answers. The technical solution model architecture to be adopted in this application is as follows: Figure 5 shown.
[0023] S4: Training an agricultural early warning model based on Bayesian neural network; Agricultural production data comes from a wide range of sources and in various forms. Each source or form can be regarded as a modality, including text, pictures, audio and video files. It is necessary to fuse multimodal data, absorb the advantages of different modalities, and complete the integration of information.
[0024] The historical consultation data, meteorological information data, agricultural park sensor data used in this study, and disaster data were extracted from the knowledge graph based on massive question-and-answer information constructed in the early stage. Disaster-related entities were extracted by filtering entity keywords, and the data was divided into training set and test set in a ratio of 7:3. The training set trained the Bayesian neural network model, and the test set verified the accuracy of the model. In the process of constructing the agricultural disaster warning model, the structural parameters, weights and thresholds of the neural network were first initialized, the activation function of the model was selected, the distribution of weights and thresholds was obtained using the Bayesian theorem, and then the network was trained using the optimal solution obtained. Finally, the output results were error corrected and output. The selection of warning factors in the process of model establishment is an important factor related to the effectiveness of warning. In this study, historical disaster data and meteorological data (temperature, precipitation, relative humidity, sunshine hours and wind speed) were used as vectors of the model input layer. Bayesian neural network can contain multiple hidden layers, but when the number of hidden layers is too large, the training network time will become longer and overfitting is prone to occur. Therefore, using one hidden layer and selecting the appropriate number of hidden layer nodes can obtain sufficiently high accuracy.
[0025] When the Bayesian neural network begins to perform the error back propagation operation, the weights are assigned to the nodes in each neural layer, and the optimal values contained in the neural nodes are easily obtained during the transmission process of the neural network. The results are repeatedly iterated and adjusted through the optimal values, and the optimal hyperparameters are output. When the optimal values of weights and thresholds are obtained in neurons, the Bayesian neural network will store the posterior distribution information obtained by the optimal values. In future predictions, the posterior distribution of the previous stage becomes the prior information. After several operations, the prediction results of the sample data will be continuously adjusted, thereby improving the generalization ability of the network and ultimately improving the accuracy of parameter estimation.
[0026] S5: Input the user inquiry question text to be answered into the convolutional neural network to obtain the corresponding key information of the intent, then input the corresponding key information of the intent into the generative adversarial neural network to obtain the corresponding response data, input the agricultural production data to be predicted into the agricultural early warning model to obtain the corresponding agricultural disaster warning.
[0027] In this embodiment, the present application designs a deep convolutional neural network based on intent recognition to improve the accuracy of dialogue intent recognition. The present application can take into account the correctness and real-time nature of the user's intent analysis at the same time. Through multi-dimensional convolution and iterative optimization training of the model data, the user's question data can be better learned, the key information in the user's question can be extracted, and the text intent can be correctly identified based on the key information. The generative adversarial neural network constructed and designed by the present application can perform user intent analysis and improve the accuracy and pertinence of agricultural intelligent responses. By utilizing the powerful modeling capabilities and adversarial learning ideas of the generative adversarial neural network, feature extraction can be better completed, and reasonable, helpful, and targeted responses to specific intents can be generated based on the features. The present application constructs an early warning model based on a Bayesian neural network, which improves the early warning effect, plays a guiding role in agricultural disaster prevention and control, and solves the problems of slow convergence speed and easy to fall into local minimization of traditional BP neural networks.
Claims
1. A method for agricultural disaster warning and consultation response based on dynamic knowledge graph, characterized in that: The following steps are involved: S1: Collect a preset amount of agricultural expert consultation data as basic data and build a knowledge graph based on the basic data; S2: training a convolutional neural network. The trained convolutional neural network is used to extract key information of the user's input consulting question text. S3: Generate adversarial neural networks through data training in the knowledge graph. The trained generative adversarial neural networks are used to generate response data for the key information of intent extracted by the convolutional neural network. S4: Construct an agricultural early warning model based on Bayesian neural network, train the agricultural early warning model through the data in the knowledge graph, and use the trained agricultural early warning model to provide agricultural disaster early warning for agricultural production by inputting agricultural production data; S5: Input the user inquiry question text to be answered into the convolutional neural network to obtain the corresponding key information of the intent, then input the corresponding key information of the intent into the generative adversarial neural network to obtain the corresponding response data, input the agricultural production data to be predicted into the agricultural early warning model to obtain the corresponding agricultural disaster warning.
2. The agricultural disaster early warning and consultation response method based on dynamic knowledge graph according to claim 1 is characterized in that: S1 specifically includes the following steps: S1.1: Collect a preset amount of agricultural expert consultation data; S1.2: Preprocess the collected agricultural expert consultation data to obtain processed data, and the preprocessing includes cleaning and denoising operations; S1.3: Extract knowledge from structured data in the processed data based on preset rules; S1.4: Construct agricultural ontology and define classes, relationships, attributes and set corresponding constraints to clarify the boundaries of knowledge extraction; S1.5: Based on the agricultural ontology, use deep learning methods to extract knowledge from unstructured data in the processed data; S1.6: Store the structured data and unstructured extracted triple data together in the graph data and display them visually.
3. The agricultural disaster early warning and consultation response method based on dynamic knowledge graph according to claim 1 is characterized in that: S2 specifically includes the following steps: S2.1: Clean the text of the consultation question input by the user; S2.2: Segment the cleaned text into words and characters; S2.3: Pre-train the word vectors and character vectors of the word2vec model using the agricultural terminology corpus; S2.4: Use the pre-trained word vectors and character vectors to embed the text into words and characters to obtain embedded text; S2.5: The embedded text is fed into a convolutional neural network. The convolution kernel of the convolutional neural network calculates the n-gram features of the text along the text sequence dimension, and obtains feature information of different spans through convolution kernels of different sizes. S2.6: Use the maximum pooling method to extract key features from the information extracted by each convolution kernel; S2.7: Fuse information from multiple key features to obtain the full intention key information of the text of the consultation question input by the user, i.e., the semantic vector; S2.8: Perform softmax calculation on the semantic vector to obtain the probability distribution of the consultation question in each intent category, and select the category with the largest probability value as the calculated key information of the intent; S2.9: Optimize the convolutional neural network by performing back propagation calculations on the error between the calculated probability distribution and the true intent category label encoding of the consulting question.
4. The agricultural disaster early warning and consultation response method based on dynamic knowledge graph according to claim 1 is characterized in that: S3 is specifically: S3.1: Obtain the text of the consulting question and the corresponding key information of the intent, integrate the text features and intent features of the consulting question to obtain the comprehensive features, and use the generative neural network model based on the Encoder-Decoder architecture to extract the context information and high-level semantic expression of the comprehensive features, and generate a reply based on the knowledge graph; S3.2: Build a discriminative neural network model. The discriminative neural network model is used to judge the gap between the generated replies and the real replies, and adjust the generative neural network model based on the gap and the output of the discriminative neural network model.
5. The agricultural disaster warning and consultation response method based on dynamic knowledge graph according to claim 4 is characterized in that: The Encoder-Decoder architecture consists of two sub-models, Encoder and Decoder. Each sub-model is a BiLSTM neural network structure expanded in the time dimension. The Encoder-Decoder architecture uses an input sequence data to generate an output sequence data. Through the Encoder's neural network, the input user question is extracted into a latent variable containing global information, and then the latent variable is used as the input of the Decoder's neural network to generate a reply text.
6. The agricultural disaster early warning and consultation response method based on dynamic knowledge graph according to claim 1 is characterized in that: S4 is specifically: S4.1: Extract historical consultation data, meteorological information data, agricultural park sensor data and disaster data from the knowledge graph, and extract disaster-related entities through entity keyword filtering; S4.2: Set a training set and a test set based on the entity, use the training set to train the Bayesian neural network model, and then use the test set to verify the accuracy of the Bayesian neural network model; S4.3: Construct an agricultural disaster warning model; first initialize the structural parameters, weights and thresholds of the Bayesian neural network model, select the activation function of the Bayesian neural network model, use the Bayesian theorem to obtain the distribution of the weights and thresholds of the input data, then use the obtained optimal solution to train the network, and finally perform error correction on the output results and output them.
Citation Information
Cited By
Agricultural operation environment state parameter detection method
CN121033486A