Model training method and device, equipment, medium and product

The decision tree and random forest are constructed through branch boundary algorithms, and the parameters are adjusted, which solves the problem of low accuracy of crop pest classification models in the existing technology, and improves classification accuracy and model robustness.

CN119152254APending Publication Date: 2024-12-17CHINA MOBILE M2M +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411147245.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The existing classification models have low accuracy and limited generalization capabilities when processing complex agricultural data, resulting in low classification accuracy of crop pest and diseases, high model complexity, and affecting efficiency and robustness.

Method used

The branch boundary algorithm is used to build a decision tree to form a random forest, and by adjusting the parameters of the random forest, the model complexity is reduced and the classification accuracy is improved.

Benefits of technology

It effectively reduces the complexity of the classification model, improves the classification accuracy of crop pest and diseases, and the efficiency and robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119152254A_ABST
    Figure CN119152254A_ABST
Patent Text Reader

Abstract

The invention discloses a model training method and device, equipment, a medium and a product. The model training method comprises the following steps: acquiring a plurality of crop image samples, wherein the crop image samples comprise crop images and corresponding disease and pest type labeling information; performing feature extraction on the crop image to obtain image feature information; classifying the plurality of crop image samples according to the image feature information by using a branch-boundary algorithm, and constructing a plurality of decision trees to obtain a random forest; determining pest and disease type prediction results of the plurality of crop image samples according to classification results of the plurality of decision trees on the plurality of crop image samples; and adjusting parameters of the random forest according to the disease and pest type labeling information of the plurality of crop image samples and the disease and pest type prediction result to obtain a classification model. According to the embodiment of the invention, the complexity of the classification model can be reduced, the classification accuracy of the classification model on crop disease and insect pest types is improved, and the classification efficiency and robustness of the model are higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to crop pest and disease monitoring technology, and in particular to a model training method, device, equipment, medium and product. Background Art

[0002] With the continuous development of science and technology, remote sensing technology, artificial intelligence and big data analysis technology have been applied to crop disease and pest monitoring. Compared with traditional monitoring methods that rely on farmers' experience and regular field inspections, these technologies have effectively improved the accuracy and efficiency of crop disease and pest monitoring and prediction, thus providing a basis for realizing precision agricultural management.

[0003] However, the classification models commonly used at present are not very accurate when processing complex agricultural data and have limited generalization capabilities, which leads to high model complexity, affecting its classification accuracy of crop pest and disease types, making the model's classification efficiency and robustness low. Summary of the invention

[0004] The embodiments of the present application provide a model training method, device, equipment, medium and product, which can reduce the complexity of the classification model, improve its classification accuracy of crop pest and disease types, and make the classification efficiency and robustness of the model higher.

[0005] In a first aspect, an embodiment of the present application provides a model training method, the method comprising:

[0006] Acquire a plurality of crop image samples, wherein the crop image samples include crop images and corresponding pest and disease type labeling information;

[0007] Extracting features of the crop image to obtain image feature information;

[0008] Using a branch and bound algorithm to classify the plurality of crop image samples according to the image feature information, constructing a plurality of decision trees to obtain a random forest;

[0009] Determine the prediction results of the pest and disease types of the multiple crop image samples according to the classification results of the multiple decision trees on the multiple crop image samples;

[0010] According to the pest and disease type labeling information of the multiple crop image samples and the pest and disease type prediction results, the parameters of the random forest are adjusted to obtain a classification model, and the classification model is used to identify the pest and disease types of crops based on the crop images.

[0011] In a second aspect, an embodiment of the present application provides a model training device, the device comprising:

[0012] A sample acquisition module, used to acquire a plurality of crop image samples, wherein the crop image samples include crop images and their corresponding pest and disease type labeling information;

[0013] A feature extraction module, used to extract features from the crop image to obtain image feature information;

[0014] A decision tree construction module, used to classify the plurality of crop image samples according to the image feature information using a branch and bound algorithm, construct a plurality of decision trees, and obtain a random forest;

[0015] A result determination module, configured to determine the prediction results of the pest and disease types of the multiple crop image samples according to the classification results of the multiple decision trees on the multiple crop image samples;

[0016] A parameter adjustment module is used to adjust the parameters of the random forest according to the pest type labeling information of the multiple crop image samples and the pest type prediction results to obtain a classification model, and the classification model is used to identify the pest type of crops based on the crop images.

[0017] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising: a processor and a memory storing computer program instructions;

[0018] When the processor executes the computer program instructions, the steps of the model training method described in any one of the embodiments of the first aspect are implemented.

[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the steps of the model training method described in any one of the embodiments of the first aspect are implemented.

[0020] In a fifth aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device performs the steps of the model training method described in any one of the embodiments of the first aspect.

[0021] The model training method, device, equipment, medium and product in the embodiments of the present application use the branch and bound method to construct a decision tree in the process of training a classification model for crop pests and diseases to form a random forest, and then integrate the classification results of the decision tree for each crop image sample, analyze and obtain the prediction results of the pest type of each crop image sample, and continuously adjust the parameters of the random forest by comparing the pest type prediction results and the pest type labeling information of each crop image sample to obtain the final classification model. Since the branch and bound method is used to generate the random forest in the embodiments of the present application, and the branch and bound method can effectively select the best split point in the process of building the decision tree, it can reduce the number of decision trees required in the random forest, reduce the complexity of the classification model, and at the same time improve the classification accuracy of the classification model for the crop pest type, so that the classification efficiency and robustness of the model are higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0023] Figure 1 It is a flowchart of a model training method provided by an embodiment of the present application;

[0024] Figure 2 It is a structural schematic diagram of a model training device provided by an embodiment of the present application;

[0025] Figure 3 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0026] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0027] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0028] As population growth and global food demand rise, improving crop yield and quality has become particularly important. However, crop production is often affected by various pests and diseases, which not only damage crop health but can also lead to serious economic losses. Traditional pest and disease monitoring and management methods rely on farmers' experience and regular field inspections, which is time-consuming, labor-intensive, and has limited accuracy. With the development of remote sensing technology, artificial intelligence, and big data analysis technology, new opportunities have emerged to improve this situation. Using these technologies, crop pests and diseases can be monitored and predicted more accurately and efficiently, thereby achieving precision agricultural management.

[0029] In the method of using artificial intelligence technology for classification, traditional classification models are usually used for classification. However, traditional classification models are not very accurate when processing complex agricultural data and have limited generalization capabilities, which leads to high model complexity, affecting its classification accuracy of crop pests and diseases, and making the model's classification efficiency and robustness low.

[0030] In order to solve the problems of the prior art, the embodiments of the present application provide a model training method, device, equipment, medium and product. The model training method can be applied to the scenario of generating a classification model capable of identifying the types of crop pests and diseases. The model training method provided by the embodiments of the present application is first introduced below.

[0031] Figure 1 The figure is a flow chart of a model training method provided by an embodiment of the present application. The model training method can be executed by an electronic device with computing capabilities such as a computer and a virtual machine.

[0032] like Figure 1 As shown, the model training method may specifically include the following steps:

[0033] S110, obtaining a plurality of crop image samples, where the crop image samples include crop images and their corresponding pest and disease type labeling information;

[0034] S120, extracting features from the crop image to obtain image feature information;

[0035] S130, using a branch and bound algorithm to classify multiple crop image samples according to image feature information, constructing multiple decision trees, and obtaining a random forest;

[0036] S140, determining the prediction results of the pest and disease types of the multiple crop image samples according to the classification results of the multiple decision trees on the multiple crop image samples;

[0037] S150, adjusting the parameters of the random forest according to the pest and disease type labeling information and the pest and disease type prediction results of the plurality of crop image samples to obtain a classification model, wherein the classification model is used to identify the pest and disease types of the crops according to the crop images.

[0038] Therefore, in the process of training the classification model for crop pests and diseases, the branch and bound method is used to construct a decision tree to form a random forest, and then the classification results of the decision tree for each crop image sample are integrated to analyze and obtain the prediction results of the pest type of each crop image sample, and by comparing the pest type prediction results and the pest type labeling information of each crop image sample, the parameters of the random forest are continuously adjusted to obtain the final classification model. Since the branch and bound method is used to generate the random forest in the embodiment of the present application, and the branch and bound method can effectively select the best split point in the process of building the decision tree, it can reduce the number of decision trees required in the random forest, reduce the complexity of the classification model, and at the same time improve the classification accuracy of the classification model for the crop pest type, so that the classification efficiency and robustness of the model are higher.

[0039] The specific implementation methods of the above steps are introduced below.

[0040] In some embodiments, in S110, the crop image samples may be samples for training the model generated based on the crop images. The crop images may be image data in the collected agricultural remote sensing big data. The crop images collected in the agricultural remote sensing big data may cover different types of crops, different growth stages, and various pests and diseases, and the collected crop images may have a unified format and resolution, wherein the image format may be, for example, JPEG format, and the resolution may be, for example, 1024x1024 pixels.

[0041] After collecting multiple crop images, each crop image can be labeled. The labeled pest and disease type information includes but is not limited to normal growth, fungal diseases, bacterial diseases, viral diseases, pest infestation, malnutrition and other type information. The labeling methods include but are not limited to manual labeling.

[0042] In addition, before training, the image data of the collected crop images may be preprocessed, and the preprocessing includes but is not limited to normalization processing. For example, the normalization formula shown in the following formula (1) may be used for processing.

[0043]

[0044] Among them, bnX is the normalized pixel value, bX is the original pixel value, bμ and bσ are the mean and standard deviation of the data set, respectively, and the image data of a crop image is a data set.

[0045] In this way, the image data of each crop image and its corresponding pest and disease type annotation information can be used as a crop image sample to train the classification model.

[0046] In some embodiments, in S120, a preset image feature extraction algorithm may be used to perform feature extraction on the crop images contained in each crop image sample to obtain image feature information of each crop image, and the image feature information may include feature information that can represent the type of pests and diseases of the crops shown in the crop image.

[0047] In the embodiment of the present application, a trained feature extraction model may be used to extract features from crop images, so the feature extraction model may be trained first. In some embodiments, before the above S120, the model training method provided in the embodiment of the present application may further include:

[0048] Use kernel density estimation algorithm to identify key feature areas of pests and diseases in crop images;

[0049] The key features of pests and diseases are determined from the key feature areas using the ant colony algorithm;

[0050] The target neural network is trained using the key features of pests and diseases to obtain a feature extraction model.

[0051] Based on this, the above S120 may specifically include:

[0052] The feature extraction model is used to extract features of crop images to obtain image feature information.

[0053] Here, kernel density estimation can be applied to analyze data distribution and identify key characteristic areas of pests and diseases in crop images, such as areas affected by pests and diseases. Kernel density estimation algorithms can be used to estimate the probability density function of data, which allows the identification of potential distribution patterns from the data. Therefore, they are particularly suitable for processing agricultural data with complex distribution characteristics.

[0054] For example, in the process of identifying key characteristic regions of pests and diseases in crop images using the kernel density estimation algorithm, for each characteristic point dx in a crop image i , the formula for kernel density estimation can be expressed as shown in the following formula (2).

[0055]

[0056] Wherein, dK is the Gaussian kernel function, dn is the number of feature points in the crop image, and dh is the bandwidth parameter. In some embodiments, the selection of the bandwidth parameter can be optimized by cross-validation, which can be estimated by minimizing the mean square error, wherein the calculation formula of the mean square error can be expressed as shown in the following formula (3).

[0057]

[0058] in, is the standard deviation between each feature point in the crop image, and n is the number of feature points in the crop image.

[0059] In addition, after identifying the key areas, the ant colony algorithm can be used to select the most influential features, i.e. the key features of pests and diseases, in the key feature areas of pests and diseases identified by kernel density estimation. The selected features are then input into the target neural network, the target neural network is trained, and finally a trained feature extraction model is obtained.

[0060] In some embodiments, the above-mentioned determination of key features of pests and diseases from key feature areas using the ant colony algorithm may specifically include:

[0061] Obtain the pheromone concentration and heuristic information corresponding to each feature in the key feature area;

[0062] According to the pheromone concentration and heuristic information, the probability value of the ant path corresponding to each feature being selected is calculated;

[0063] Features with probability values ​​greater than a preset probability threshold are identified as key features of pests and diseases.

[0064] Here, the ant colony algorithm mainly optimizes feature selection by simulating the path of ants looking for food. The path of each ant can be expressed as a probability of feature selection. Specifically, the following formula (4) can be used to calculate a feature dx i The corresponding ant path da k The probability of being selected is:

[0065]

[0066] Among them, dτ(dx i ) represents the feature dx iThe pheromone concentration, dη(dx i ) represents the heuristic information of the feature, and α and β are preset parameters for controlling the pheromone concentration and the heuristic information. In some examples, the heuristic information may represent the importance of the feature, which may be obtained by cross-validation.

[0067] In addition, the pheromone concentration dτ(dx i ) is the continuously updated data, which can be updated by the following formula (5).

[0068]

[0069] Where dρ is the pheromone volatility, Δdτ k (dx i ) is the kth ant in feature dx i The amount of pheromone left on , dK is the kernel density estimate.

[0070] In this way, after obtaining the probability value of the ant path corresponding to each feature being selected, the feature with a probability value greater than a preset probability threshold can be determined as a key feature of pests and diseases, and then the key feature of pests and diseases can be used for subsequent model training.

[0071] In some embodiments, the above-mentioned use of key features of pests and diseases to train the target neural network to obtain a feature extraction model may specifically include:

[0072] The key features of pests and diseases are input into the target neural network, and the target neural network performs feature depth extraction on the crop image according to the key features of pests and diseases to obtain target feature information;

[0073] Input the target feature information into the target classification function to obtain the target classification result;

[0074] Determine a first loss function according to the target classification result and the pest and disease type labeling information corresponding to the crop image;

[0075] The network parameters of the target neural network are adjusted according to the first loss function to obtain a feature extraction model.

[0076] Here, the target neural network may be a fully connected network, such as a back propagation neural network. In addition, during the training of the target neural network, an additional target classification function may be added to assist the training. The target classification function may be a function capable of classifying features, such as a softmax classification function.

[0077] Exemplarily, the selected key features of pests and diseases can be input into the target neural network so that the target neural network can perform feature depth extraction and output the target feature information, such as the feature vector dF. The feature vector dF is input into the softmax classification function and the target classification result dY is output. The softmax classification function can be expressed as shown in the following formula (6).

[0078]

[0079] Among them, dKS is the number of neurons in the output layer, representing possible feature categories.

[0080] In some examples, the training of the target neural network can be achieved by minimizing a first loss function. The first loss function in the embodiment of the present application can be, for example, a cross-entropy loss function. For the target classification result dY and the true label dT of the crop image, that is, the pest and disease type annotation information, the first loss function dL can be expressed as shown in the following formula (7).

[0081]

[0082] Among them, dm is the number of crop image samples used in this round of training. The training can be divided into multiple rounds. One round of training can use all crop image samples or a part of crop image samples, which is not limited here.

[0083] After the first loss function is calculated, the first loss function can be used to continuously adjust and optimize the parameters and structure of the target neural network to improve the accuracy of feature extraction of the target neural network. In some examples, the optimization of network parameters can be achieved by back propagation and gradient descent method. The network parameters may include weight dW and bias dB. The weight dW and bias dB may be updated according to the following formula (8) and formula (9).

[0084]

[0085]

[0086] Wherein, dη is the learning rate, which can be set to 0.001 or selected by cross-validation. Here, the update of weight dW and bias dB can be calculated by the chain rule, which can be calculated by the following formula (10) and formula (11).

[0087]

[0088] in, is the gradient of the first loss function to the target classification result, and are the gradients of the target classification results with respect to the weights and biases, respectively.

[0089] Therefore, by using the feature extraction model obtained by combining kernel density estimation with ant colony algorithm training to extract features from crop images, it is possible to first identify key areas in the kernel density statistical processing stage, and extract the most influential features for predicting crop pest types from the identified key areas in the ant colony algorithm stage. This method is progressive, making the features extracted using the feature extraction model more accurate and more influential, providing accurate input for the training of subsequent classification models.

[0090] In some embodiments, in S130, after obtaining the image feature information corresponding to each crop image, the crop image samples can be classified based on the branch and bound algorithm, and multiple decision trees can be constructed to form a random forest, and the prediction accuracy and generalization ability can be improved by combining multiple decision trees. The embodiment of the present application improves the traditional random forest and introduces the branch and bound algorithm to optimize the construction process of the decision tree in the random forest, and effectively selects the best segmentation point in the process of building the decision tree, so that the number of decision trees in the random forest can be reduced, and the prediction performance of the classification model can be improved.

[0091] When constructing a decision tree, multiple decision trees may be established for multiple sample sets. Based on this, in some embodiments, the above S130 may specifically include:

[0092] Constructing multiple sample sets according to multiple crop image samples;

[0093] For each sample set in the multiple sample sets, the crop image samples contained in the sample set are classified according to the principle of maximizing information gain based on image feature information, and a corresponding decision tree is constructed to obtain a random forest. The random forest includes decision trees constructed for the multiple sample sets respectively.

[0094] Here, the acquired multiple crop image samples can be divided into multiple sample groups, and one sample group can be constructed as a sample set, or the acquired multiple crop image samples can be constructed as a sample set, and the same sample set can be repeatedly set to form multiple sample sets. For one sample set, a decision tree can be constructed, and thus, multiple decision trees can be constructed for multiple sample sets.

[0095] Exemplarily, when constructing each decision tree, at each node in the decision tree, all crop image samples on the node can be classified based on the principle of maximizing information gain, that is, sample segmentation is performed on the node, and so on, thereby finally forming a decision tree.

[0096] In addition, in some implementations, the crop image samples included in the sample set are classified according to the information gain maximization principle based on the image feature information to construct a corresponding decision tree, including:

[0097] At each node of the decision tree, a target segmentation feature and a target segmentation point are determined so that the information gain is greater than a preset gain threshold according to the image feature information;

[0098] The crop image samples contained in the sample set are classified according to the target segmentation features and target segmentation points, and the corresponding decision tree is constructed.

[0099] Exemplarily, for each node in the decision tree, the optimal segmentation feature and the optimal segmentation point can be selected, and the selection of the optimal segmentation feature and the optimal segmentation point can be achieved by maximizing the information gain. That is, the target segmentation feature and the target segmentation point that make the information gain greater than the preset gain threshold pT can be determined as the optimal segmentation feature and the optimal segmentation point to be selected. In some examples, the information gain pIG(px,pv) corresponding to each possible segmentation feature px and segmentation point pv can be calculated by the following formula (12).

[0100]

[0101] Among them, pI is the impurity of the parent node, pn is the number of samples of the parent node, and pn left and pn right is the number of samples of the left and right child nodes after segmentation, pI left and pI right is the impurity of the child node.

[0102] It should be noted that information gain is the reduction in impurity after the data set is divided into two parts (left subset and right subset) according to the split point. Among them, impurity can usually be calculated using Gini impurity or information entropy. In some examples, taking Gini impurity as an example, for a given feature px and split point pv, Gini impurity pI can be calculated by the following formula (13).

[0103]

[0104] Among them, p j is the proportion of samples of the jth class in the sample set. Similarly, the Gini impurity pI of the left and right child nodes left and pI right It can also be calculated using the above formula (13).

[0105] When the branch and bound method is used to select the target segmentation features and target segmentation points at each node, the search can be performed using the following formula (14).

[0106]

[0107] The search space consists of all possible values ​​of the feature px and potential segmentation points pv. The branch-and-bound method narrows the search range by gradually eliminating candidate segmentation points that are unlikely to be the optimal solution. Here, by setting a gain threshold pT, only considering segmentation points that make the information gain exceed pT, the amount of calculation can be significantly reduced.

[0108] After multiple decision trees are constructed, a random forest containing the multiple decision trees can be formed, wherein each tree can be trained on a random subset of features.

[0109] In some embodiments, in S140, after a random forest including multiple decision trees is constructed, the prediction results of the pest and disease types of the multiple crop image samples can be analyzed and determined based on the classification results of the multiple decision trees for the multiple crop image samples. Here, a voting method can be used to finally determine the prediction result of the pest and disease type of each crop image sample.

[0110] Based on this, in some implementations, the above S140 may specifically include:

[0111] Counting the classification results of multiple decision trees for the same crop image sample among multiple crop image samples;

[0112] The majority of the classification results are determined as the prediction results of the pest and disease types of the crop image samples.

[0113] Here, the classification results output by all decision trees can be summarized by selecting the most votes to obtain the final classification result. For example, for a crop image sample ps, the prediction result of the pest type of the crop image sample by the random forest is determined by the majority vote of the classification results of all decision trees. The specific formula can be expressed as the following formula (15).

[0114] pR(ps)=mode{pTree1(ps)pTree2(ps),...,pTree pN (ps)} (15)

[0115] Where pN is the number of decision trees, which can be set to 100 in some examples.

[0116] It should be noted that the number of decision trees pN and the maximum depth pD of the decision trees are determined by artificial preset methods. Generally speaking, more decision trees will improve the stability and accuracy of the model, but will also increase the amount of calculation. In some embodiments, pN can also be set to 200, and pD can be adjusted according to the complexity of the data, for example, it can be set to 10.

[0117] In some embodiments, in S150, after obtaining the prediction results of the pest type of multiple crop image samples, the prediction accuracy of the random forest under different parameters can be determined in combination with the pest type annotation information of the crop images in the multiple crop image samples, and then the parameters of the random forest are adjusted in a cross-validation manner according to the accuracy to optimize the performance of the random forest. The parameters of the random forest may include, for example, the number of decision trees pN and the maximum depth pD of each decision tree.

[0118] Exemplarily, for each set of random forest parameters, the cross-validation accuracy pAcc can be calculated by the following formula (16).

[0119]

[0120] Where pK is the number of cross-validation folds, which can be set to 5 or 10, for example. k is the accuracy corresponding to the kth group of parameters.

[0121] In this way, the random forest with adjusted parameters can be used as the final classification model, which can accurately identify the types of crop diseases and pests based on the crop images.

[0122] In addition, in the above embodiments, since the image feature information extracted from the crop image is usually a high-dimensional vector, its dimension depends on the number of neurons in the last layer of the feature extraction model. In some examples, the dimension of the feature vector dF obtained after feature extraction can reach 200 dimensions. Therefore, the image feature information can be further reduced in dimension before being used to train the classification model.

[0123] Based on this, in some implementations, after the above S120, the model training method provided in the embodiment of the present application may further include:

[0124] Perform dimensionality reduction processing on the image feature information to obtain the image feature information after dimensionality reduction.

[0125] Here, the trained feature dimensionality reduction model can be used to reduce the dimensionality of the image feature information, reduce the dimension of the data, and retain the most critical information for the subsequent classification task. Among them, the feature dimensionality reduction model can adopt a sparse autoencoder structure based on latent Dirichlet allocation.

[0126] In an embodiment of the present application, when training a feature dimensionality reduction model, latent Dirichlet allocation can be introduced and applied to the context of image features to identify and strengthen implicit patterns and structures in the data, thereby enhancing the model's representation capabilities when processing crop image data.

[0127] Based on this, in some implementations, before performing dimensionality reduction processing on the image feature information to obtain the image feature information after dimensionality reduction, the model training method provided in the embodiment of the present application may further include:

[0128] Inputting the first feature information into a target encoder, and mapping the first feature information from a high-dimensional space to a low-dimensional space by the target encoder to obtain low-dimensional feature information, wherein the first feature information is image feature information obtained after feature extraction of a first crop image, and the first crop image includes a crop image in any crop image sample;

[0129] The low-dimensional feature information is input into the latent Dirichlet allocation model, and the latent Dirichlet allocation model is used to identify the potential topics in the low-dimensional feature information to obtain the topic distribution information;

[0130] The low-dimensional feature information is input into the target decoder, and the target decoder restores the low-dimensional feature information from the low-dimensional space to the high-dimensional space to obtain the reconstructed feature information;

[0131] Determining a second loss function according to the first feature information, the reconstruction feature information and the topic distribution information;

[0132] The parameters of the target encoder and the target decoder are adjusted according to the second loss function to obtain a feature dimensionality reduction model.

[0133] Based on this, the above-mentioned dimensionality reduction processing is performed on the image feature information to obtain the image feature information after dimensionality reduction, which may specifically include:

[0134] The target encoder in the feature dimensionality reduction model is used to reduce the dimension of the image feature information to obtain the reduced-dimensional image feature information.

[0135] For example, before training the feature dimensionality reduction model, the image feature information extracted from each crop image may be standardized to ensure that the data is at the same scale.

[0136] Taking the first image feature information extracted from the first crop image as an example, after being standardized, the first image feature information can be mapped from a high-dimensional space to a low-dimensional space through a nonlinear transformation to form a sparse feature representation. Specifically, the first image feature information ex after the standardized processing can be input into the target encoder, and the target encoder maps ex to low-dimensional feature information ez. The mapping process can be expressed as the following formula (17).

[0137] ez=f(eW e ·ex+eb e ) (17)

[0138] Among them, eW e and ebe are the weight and bias of the target encoder respectively, and f() can be a ReLU activation function. Here, the ReLU activation function can be expressed as the following formula (18).

[0139] f(z)=max(0,z) (18)

[0140] After obtaining the low-dimensional feature information, the low-dimensional feature information can be used as the input of the latent Dirichlet allocation model, and the latent Dirichlet allocation model can be used to identify the latent topics and patterns in the data. Specifically, according to the following formula (19), the latent Dirichlet allocation can be applied to the low-dimensional feature information ez to obtain the topic distribution information eθ.

[0141] eθ=LDA(ez;eα,eβ) (19)

[0142] Among them, eα and eβ are hyperparameters of the latent Dirichlet allocation model, which control the sparsity of topic distribution and the sparsity of word distribution respectively. In some examples, eα and eβ can be set to 0.1.

[0143] In addition, the low-dimensional feature information needs to be reconstructed back to the original dimensional space in order to minimize the reconstruction error while retaining the key information. Specifically, the low-dimensional feature information ez can be input into the target decoder, which reconstructs ez back to the original high-dimensional space to obtain the reconstructed feature information The reconstruction process can be expressed as the following formula (20).

[0144]

[0145] Among them, eW d and eb d is the weight and bias of the decoder, and g() can be the sigmoid activation function. Here, the sigmoid activation function can be expressed as the following formula (21).

[0146]

[0147] Based on this, the first feature information ex is used to reconstruct the feature information And the topic distribution information eθ constructs a second loss function eL, which may include reconstruction error and sparsity penalty, for example, it can be expressed as the following formula (22).

[0148]

[0149] Where λ is the sparsity penalty coefficient, KL is the Kullback-Leibler divergence, and eπ is the prior distribution information of the topic distribution information eθ. In some examples, the KL divergence can be used to measure the difference between two probability distributions. For the topic distribution information eθ and the prior distribution information eπ in the latent Dirichlet allocation, the KL divergence can be calculated according to the following formula (23).

[0150]

[0151] Where K is the number of topics, eθ k and eπ k are the kth elements in eθ and eπ respectively.

[0152] After obtaining the second loss function eL, the parameters of the target encoder and the target decoder can be adjusted according to the second loss function eL to optimize the performance of feature dimensionality reduction, thereby finally training a feature dimensionality reduction model including the target encoder. For example, the parameters eW of the target encoder can be adjusted using a gradient descent optimization algorithm according to the following formulas (24) and (25). e ,eb e , and the target decoder parameters eW d ,eb d to update.

[0153]

[0154]

[0155] Wherein, eη is a learning rate. In some examples, the learning rate eη can be set to 0.001, for example.

[0156] In this way, after the feature dimension reduction model is obtained through training, the target encoder in the feature dimension reduction model can be used to reduce the dimension of the image feature information extracted from the crop image, thereby obtaining low-dimensional image feature information for subsequent classification model training. In this way, the embodiment of the present application uses a sparse autoencoder based on latent Dirichlet allocation as a feature dimension reduction model to perform feature dimension reduction on image feature information, which not only reduces the dimension of the data, but also retains the most critical information for the classification task, thereby enhancing the representation ability of the model when processing crop image data, thereby being able to effectively reduce the dimension of the feature data, improve the execution efficiency of the subsequent classification process, and improve the accuracy of the classification results.

[0157] In addition, after the classification model is trained, the classification model can be used to accurately identify the types of crop diseases and pests in the crop images.

[0158] Based on this, in some implementations, after the above S150, the model training method provided in the embodiment of the present application may further include:

[0159] Acquire target crop images;

[0160] Extracting features of the target crop image using a feature extraction model to obtain first image feature information;

[0161] Using a feature dimensionality reduction model to perform dimensionality reduction processing on the target image feature information to obtain second image feature information;

[0162] The target crop image is classified according to the second image feature information using a classification model to obtain the type of pests and diseases corresponding to the target crop image.

[0163] Here, the target crop image may be any collected crop image.

[0164] Exemplarily, after the target crop image to be classified is collected, the image data of the target crop image may be preprocessed by normalization. The preprocessed image data is subjected to feature extraction using a trained feature extraction model to obtain first image feature information. The first image feature information is subjected to dimensionality reduction processing using an encoder in a trained feature dimensionality reduction model to obtain second image feature information. The second image feature information is classified using a trained classification model to obtain the type of pest and disease to which the target crop image belongs.

[0165] In some examples, the identified pest and disease types may include: normal growth, fungal diseases, bacterial diseases, viral diseases, pest infestation, malnutrition, etc. The identified pest and disease types can be used to guide agricultural production, for example, by identifying specific pest and disease types, farmers can take corresponding prevention and treatment measures.

[0166] It should be noted that the application scenarios described in the above-mentioned embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0167] Based on the same inventive concept, the present application also provides a model training device. Figure 2 Provide detailed explanation.

[0168] Figure 2 It is a structural diagram of a model training device provided in one embodiment of the present application.

[0169] like Figure 2 As shown, the model training device 200 may include:

[0170] The sample acquisition module 201 is used to acquire a plurality of crop image samples, wherein the crop image samples include crop images and their corresponding pest and disease type labeling information;

[0171] A feature extraction module 202 is used to extract features from the crop image to obtain image feature information;

[0172] A decision tree construction module 203 is used to classify the plurality of crop image samples according to the image feature information using a branch and bound algorithm, construct a plurality of decision trees, and obtain a random forest;

[0173] A result determination module 204 is used to determine the prediction results of the pest and disease types of the multiple crop image samples according to the classification results of the multiple decision trees on the multiple crop image samples;

[0174] The parameter adjustment module 205 is used to adjust the parameters of the random forest according to the pest type labeling information of the multiple crop image samples and the pest type prediction results to obtain a classification model, and the classification model is used to identify the pest type of crops based on crop images.

[0175] The model training device 200 is described in detail below, as shown below:

[0176] In some embodiments, the decision tree construction module 203 includes:

[0177] A first construction submodule is used to construct a plurality of sample sets according to the plurality of crop image samples;

[0178] The second construction submodule is used to classify the crop image samples contained in each sample set in the multiple sample sets according to the image feature information according to the principle of maximizing information gain, construct a corresponding decision tree, and obtain a random forest. The random forest includes decision trees constructed respectively for the multiple sample sets.

[0179] In some embodiments, the second building block comprises:

[0180] A first determination unit is used to determine, at each node of the decision tree, a target segmentation feature and a target segmentation point that make the information gain greater than a preset gain threshold according to the image feature information;

[0181] The first construction unit is used to classify the crop image samples included in the sample set according to the target segmentation features and the target segmentation points, and construct a corresponding decision tree.

[0182] In some embodiments, the result determination module 204 includes:

[0183] A result statistics submodule, used for counting classification results of the multiple decision trees on the same crop image sample among the multiple crop image samples;

[0184] The second determination submodule is used to determine the majority of the types in the classification results as the disease and insect pest type prediction results of the crop image samples.

[0185] In some embodiments, the model training device 200 further includes:

[0186] A region identification module is used to identify key feature regions of pests and diseases in the crop image using a kernel density estimation algorithm before extracting features from the crop image to obtain image feature information;

[0187] A feature determination module, used for determining key features of pests and diseases from the key feature area using an ant colony algorithm;

[0188] A network training module is used to train a target neural network using the key features of the pests and diseases to obtain a feature extraction model;

[0189] The feature extraction module 202 is specifically used for:

[0190] The feature extraction model is used to extract features from the crop image to obtain image feature information.

[0191] In some embodiments, the feature determination module includes:

[0192] An information sub-acquisition module, used to acquire the pheromone concentration and heuristic information corresponding to each feature in the key feature area;

[0193] A probability calculation submodule, used to calculate the probability value of the ant path corresponding to each feature being selected according to the pheromone concentration and the heuristic information;

[0194] The third determination submodule is used to determine the feature whose probability value is greater than a preset probability threshold as a key feature of the pest.

[0195] In some embodiments, the network training module includes:

[0196] A depth extraction submodule, used for inputting the key features of the pests and diseases into a target neural network, and the target neural network performs feature depth extraction on the crop image according to the key features of the pests and diseases to obtain target feature information;

[0197] An information classification submodule is used to input the target feature information into a target classification function to obtain a target classification result;

[0198] A fourth determination submodule, configured to determine a first loss function according to the target classification result and the pest and disease type labeling information corresponding to the crop image;

[0199] The network adjustment submodule is used to adjust the network parameters of the target neural network according to the first loss function to obtain a feature extraction model.

[0200] In some embodiments, the model training device 200 further includes:

[0201] The dimension reduction processing module is used to extract features from the crop image to obtain image feature information, and then perform dimension reduction processing on the image feature information to obtain image feature information after dimension reduction.

[0202] In some embodiments, the model training device 200 further includes:

[0203] a first mapping module, configured to input the first feature information into a target encoder before performing dimensionality reduction processing on the image feature information to obtain the image feature information after dimensionality reduction, and the target encoder maps the first feature information from a high-dimensional space to a low-dimensional space to obtain low-dimensional feature information, wherein the first feature information is image feature information obtained after feature extraction on a first crop image, and the first crop image includes a crop image in any crop image sample;

[0204] A topic identification module, used for inputting the low-dimensional feature information into a latent Dirichlet allocation model, identifying potential topics in the low-dimensional feature information by the latent Dirichlet allocation model, and obtaining topic distribution information;

[0205] A second mapping module is used to input the low-dimensional feature information into a target decoder, and the target decoder restores the low-dimensional feature information from the low-dimensional space to the high-dimensional space to obtain reconstructed feature information;

[0206] A loss determination module, configured to determine a second loss function based on the first feature information, the reconstruction feature information and the topic distribution information;

[0207] A model adjustment module, used for adjusting the parameters of the target encoder and the target decoder according to the second loss function to obtain a feature dimension reduction model;

[0208] The dimension reduction processing module is specifically used for:

[0209] The target encoder in the feature dimensionality reduction model is used to perform dimensionality reduction processing on the image feature information to obtain the image feature information after dimensionality reduction.

[0210] In some embodiments, the model training device 200 further includes:

[0211] An image acquisition module, configured to adjust the parameters of the random forest according to the pest and disease type labeling information of the plurality of crop image samples and the pest and disease type prediction results, obtain a classification model, and then acquire a target crop image;

[0212] An information extraction module, used for extracting features from the target crop image using a feature extraction model to obtain first image feature information;

[0213] An information dimension reduction module, used for performing dimension reduction processing on the target image feature information by using a feature dimension reduction model to obtain second image feature information;

[0214] The image classification module is used to classify the target crop image according to the second image feature information using the classification model to obtain the type of pest and disease corresponding to the target crop image.

[0215] Therefore, in the process of training the classification model for crop pests and diseases, the branch and bound method is used to construct a decision tree to form a random forest, and then the classification results of the decision tree for each crop image sample are integrated to analyze and obtain the prediction results of the pest type of each crop image sample, and by comparing the pest type prediction results and the pest type labeling information of each crop image sample, the parameters of the random forest are continuously adjusted to obtain the final classification model. Since the branch and bound method is used to generate the random forest in the embodiment of the present application, and the branch and bound method can effectively select the best split point in the process of building the decision tree, it can reduce the number of decision trees required in the random forest, reduce the complexity of the classification model, and at the same time improve the classification accuracy of the classification model for the crop pest type, so that the classification efficiency and robustness of the model are higher.

[0216] Figure 3 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application.

[0217] The electronic device 300 may include a processor 301 and a memory 302 storing computer program instructions.

[0218] Specifically, the processor 301 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0219] The memory 302 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 302 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 302 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 302 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 302 is a non-volatile solid-state memory.

[0220] In certain embodiments, the memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present application.

[0221] The processor 301 implements any one of the model training methods in the above embodiments by reading and executing computer program instructions stored in the memory 302.

[0222] In some examples, the electronic device 300 may further include a communication interface 303 and a bus 310. Figure 3 As shown, the processor 301, the memory 302, and the communication interface 303 are connected via a bus 310 and communicate with each other.

[0223] The communication interface 303 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0224] Bus 310 includes hardware, software or both, and the components of online data flow billing equipment are coupled to each other. For example, but not limitation, bus 310 may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 310 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.

[0225] Exemplarily, the electronic device 300 may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA).

[0226] The electronic device 300 can execute the model training method in the embodiment of the present application, thereby realizing the combination Figure 1 and Figure 2 Described model training method and device.

[0227] In addition, in combination with the model training method in the above embodiment, the embodiment of the present application may provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the model training methods in the above embodiment is implemented. Examples of computer-readable storage media include non-transitory computer-readable storage media, such as portable disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, etc.

[0228] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0229] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0230] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0231] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.

[0232] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A model training method, characterized in that: include: Acquire a plurality of crop image samples, wherein the crop image samples include crop images and corresponding pest and disease type labeling information; Extracting features of the crop image to obtain image feature information; Using a branch and bound algorithm to classify the plurality of crop image samples according to the image feature information, constructing a plurality of decision trees to obtain a random forest; Determine the prediction results of the pest and disease types of the multiple crop image samples according to the classification results of the multiple decision trees on the multiple crop image samples; According to the pest and disease type labeling information of the multiple crop image samples and the pest and disease type prediction results, the parameters of the random forest are adjusted to obtain a classification model, and the classification model is used to identify the pest and disease types of crops based on the crop images.

2. The method according to claim 1, characterized in that: The method of using a branch and bound algorithm to classify the plurality of crop images according to the image feature information, constructing a plurality of decision trees, and obtaining a random forest includes: Constructing a plurality of sample sets according to the plurality of crop image samples; For each sample set in the multiple sample sets, the crop image samples contained in the sample set are classified according to the principle of maximizing information gain based on the image feature information, and a corresponding decision tree is constructed to obtain a random forest. The random forest includes decision trees constructed respectively for the multiple sample sets.

3. The method according to claim 2, characterized in that The step of classifying the crop image samples contained in the sample set according to the image feature information according to the information gain maximization principle and constructing a corresponding decision tree includes: At each node of the decision tree, determining a target segmentation feature and a target segmentation point that make the information gain greater than a preset gain threshold according to the image feature information; The crop image samples contained in the sample set are classified according to the target segmentation features and the target segmentation points, and a corresponding decision tree is constructed.

4. The method according to claim 1, characterized in that: Determining the prediction results of the pest and disease types of the multiple crop image samples according to the classification results of the multiple decision trees on the multiple crop image samples includes: counting classification results of the multiple decision trees on the same crop image sample among the multiple crop image samples; The majority of the classification results are determined as the prediction results of the pest and disease types of the crop image samples.

5. The method according to claim 1, characterized in that Before extracting features from the crop image to obtain image feature information, the method further includes: Using a kernel density estimation algorithm to identify key characteristic regions of pests and diseases in the crop image; Determining key features of pests and diseases from the key feature areas using an ant colony algorithm; Using the key features of the pests and diseases to train a target neural network to obtain a feature extraction model; The step of extracting features from the crop image to obtain image feature information includes: The feature extraction model is used to extract features from the crop image to obtain image feature information.

6. The method according to claim 5, characterized in that The step of using an ant colony algorithm to determine key features of pests and diseases from the key feature area includes: Obtaining pheromone concentration and heuristic information corresponding to each feature in the key feature area; Calculating the probability value of the ant path corresponding to each feature being selected according to the pheromone concentration and the heuristic information; The feature whose probability value is greater than a preset probability threshold is determined as a key feature of the pest.

7. The method according to claim 5, characterized in that The method of using the key features of the pests and diseases to train the target neural network to obtain a feature extraction model includes: Inputting the key features of the pests and diseases into a target neural network, and having the target neural network perform feature depth extraction on the crop image according to the key features of the pests and diseases to obtain target feature information; Inputting the target feature information into a target classification function to obtain a target classification result; Determining a first loss function according to the target classification result and the pest and disease type labeling information corresponding to the crop image; The network parameters of the target neural network are adjusted according to the first loss function to obtain a feature extraction model.

8. The method according to claim 1, characterized in that After extracting features from the crop image to obtain image feature information, the method further includes: Performing dimensionality reduction processing on the image feature information to obtain image feature information after dimensionality reduction.

9. The method according to claim 8, characterized in that Before performing dimensionality reduction processing on the image feature information to obtain the image feature information after dimensionality reduction, the method further includes: Inputting first feature information into a target encoder, and mapping the first feature information from a high-dimensional space to a low-dimensional space by the target encoder to obtain low-dimensional feature information, wherein the first feature information is image feature information obtained after feature extraction of a first crop image, and the first crop image includes a crop image in any crop image sample; Inputting the low-dimensional feature information into a latent Dirichlet allocation model, using the latent Dirichlet allocation model to identify potential topics in the low-dimensional feature information to obtain topic distribution information; Inputting the low-dimensional feature information into a target decoder, and restoring the low-dimensional feature information from the low-dimensional space to the high-dimensional space by the target decoder to obtain reconstructed feature information; Determining a second loss function according to the first feature information, the reconstructed feature information and the topic distribution information; Adjusting parameters of the target encoder and the target decoder according to the second loss function to obtain a feature dimension reduction model; The performing dimensionality reduction processing on the image feature information to obtain the image feature information after dimensionality reduction includes: The target encoder in the feature dimensionality reduction model is used to perform dimensionality reduction processing on the image feature information to obtain the image feature information after dimensionality reduction.

10. The method according to any one of claims 1 to 9, characterized in that: After adjusting the parameters of the random forest according to the pest type labeling information of the plurality of crop image samples and the pest type prediction results to obtain a classification model, the method further includes: Acquire target crop images; Extracting features of the target crop image using a feature extraction model to obtain first image feature information; Performing dimensionality reduction processing on the target image feature information using a feature dimensionality reduction model to obtain second image feature information; The target crop image is classified using the classification model according to the second image feature information to obtain the type of pest and disease corresponding to the target crop image.

11. A model training device, characterized in that: include: A sample acquisition module, used to acquire a plurality of crop image samples, wherein the crop image samples include crop images and their corresponding pest and disease type labeling information; A feature extraction module, used to extract features from the crop image to obtain image feature information; A decision tree construction module, used to classify the plurality of crop image samples according to the image feature information using a branch and bound algorithm, construct a plurality of decision trees, and obtain a random forest; A result determination module, configured to determine the prediction results of the pest and disease types of the multiple crop image samples according to the classification results of the multiple decision trees on the multiple crop image samples; A parameter adjustment module is used to adjust the parameters of the random forest according to the pest type labeling information of the multiple crop image samples and the pest type prediction results to obtain a classification model, and the classification model is used to identify the pest type of crops based on the crop images.

12. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the steps of the model training method as described in any one of claims 1-10 are implemented.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the steps of the model training method according to any one of claims 1 to 10.

14. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device performs the steps of the model training method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Construction method of crop growth state monitoring model based on big data

    CN118332311A

  • Crop disease and pest prediction method based on artificial intelligence

    CN118378742A