Crop disease image recognition method based on convolution Shengne differential equation

By applying the convolutional differential equation model in crop disease image recognition, the problems of insufficient image recognition accuracy and long training and optimization are solved, and crop disease recognition with high accuracy and strong anti-interference ability are achieved.

CN120032239APending Publication Date: 2025-05-23CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411881653.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The prior art has problems such as insufficient accuracy in crop disease image recognition, long training and optimization time, and limited promotion and application in rural areas.

Method used

The crop disease image recognition method based on the convolutional differential equation is adopted. By obtaining the crop disease data set for preprocessing, the convolutional differential equation model superparameters are adjusted, the model is trained and optimized, and the accuracy control parameters are set to realize a model with adjustable accuracy for crop disease recognition.

Benefits of technology

It effectively reduces the parameter scale and deployment storage requirements of the model, improves the anti-interference ability and robustness of the model, realizes high-precision crop disease identification, and adapts to the complex and changeable agricultural production environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120032239A_ABST
    Figure CN120032239A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of crop disease control, and provides a crop disease image recognition method based on a convolution Shengne differential equation, and the method comprises the steps: obtaining a crop disease data set, carrying out the preprocessing and dividing of an original data set, and obtaining a training data set and a test data set; adjusting super parameters of the convolutional Shenzheng differential equation model, and loading the training data set into the model for training to obtain a trained convolutional Shenzheng differential equation model; setting precision control parameters, and reloading parameters of the convolutional Shenzheng ordinary differential equation model to obtain a convolutional Shenzheng ordinary differential equation model with adjustable precision; according to the method, the crop image is acquired, the crop image is preprocessed and then input into the precision-adjustable convolutional Shenchang differential equation model for disease recognition, the crop disease recognition result is obtained, and the recognition accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of crop disease prevention and control, and in particular to a crop disease image recognition method based on convolutional neural ordinary differential equations. Background Art

[0002] The characteristics of crop diseases in China mainly include diversity, seasonality and regionality. Due to China's vast territory and diverse climate and soil conditions, different regions have obvious differences in climate, vegetation and farming systems. Therefore, different regions will face different disease threats. The occurrence of crop diseases is closely related to climatic factors, planting structure, agricultural production management, etc. Climate factors such as temperature and humidity play an important role in the growth and spread of pathogens. At the same time, unreasonable agricultural production management measures such as excessive fertilization and abuse of pesticides can also easily lead to the breeding and spread of diseases. In addition, a single crop planting structure can easily cause the spread of diseases, and the invasion of new pathogens or pests may also cause new diseases. These factors jointly affect the occurrence and spread of crop diseases in China.

[0003] Image recognition technology plays an important role in effectively suppressing the occurrence and spread of crop diseases. Agricultural experts and farmers can use image recognition technology to quickly and accurately identify disease symptoms on crop leaves, fruits and other parts, thereby helping to detect and diagnose diseases early and take corresponding prevention and control measures. This initiative helps to improve the yield and quality of crops and reduce the damage of diseases to crops.

[0004] However, the current image recognition technology still has some shortcomings in the field of crop diseases. First, the growth environment of crops is complex and changeable, and factors such as light, humidity, and soil may affect the accuracy of image recognition. Secondly, the training and optimization of image recognition algorithms for different types of diseases also require a lot of time and effort. In addition, the limited network coverage and equipment conditions in some rural areas limit the promotion and application of image recognition technology. Therefore, in the application of image recognition technology to the actual production of crop diseases, it is necessary to design a lightweight and precision-controlled crop disease recognition model to adapt to the complex and changeable agricultural production environment and needs. Summary of the invention

[0005] The embodiment of the present application provides a crop disease image recognition method based on convolutional neural ordinary differential equations, aiming to solve the above technical problems.

[0006] A first aspect of an embodiment of the present application provides a method for crop disease image recognition based on a convolutional neural ordinary differential equation, the method comprising:

[0007] S1: Obtain a crop disease dataset, preprocess and divide the original dataset to obtain a training dataset and a test dataset;

[0008] S2: Adjust the hyperparameters of the convolutional neural network ordinary differential equation model, load the training data set into the model for training, and obtain the trained convolutional neural network ordinary differential equation model;

[0009] S3: Set the precision control parameters, reload the convolutional neural network ordinary differential equation model parameters, and obtain the convolutional neural network ordinary differential equation model with adjustable precision;

[0010] S4: Acquire crop images, pre-process the crop images, and input them into a convolutional neural ordinary differential equation model with adjustable accuracy for disease identification to obtain crop disease identification results.

[0011] In a possible implementation, the crop disease dataset comes from the PlantVillage dataset, which is divided into a training dataset and a test dataset according to a ratio of 7:3.

[0012] In a possible implementation, the specific process of model training in step S2 is:

[0013] S21: Set appropriate batch parameters and introduce neural network parameter optimizer;

[0014] S22: define the target loss function;

[0015] S23: Define the convolutional neural ordinary differential equation model structure;

[0016] S24: Read data in batches and input the model to calculate the target loss function value, optimize the target loss function value using the neural network parameter optimizer, and iteratively search for the optimal model parameters.

[0017] In a possible implementation, the neural network parameter optimizer in step S21 adopts the Adam optimization algorithm, and the k-th iteration process is as follows:

[0018]

[0019] m k =β 1 m k-1 +(1-β 1 ) k

[0020]

[0021] In the above process, θ is the parameter of the convolutional neural ordinary differential equation model, β 1 , β 2 ,∈ are the optimized hyperparameters, g, m, v are the gradient of the objective function with respect to the parameters, the estimate of the first-order moment, and the estimate of the second-order moment, respectively. It is the result of correcting m and v.

[0022] In a possible implementation, the target loss function in step S22 uses a cross entropy loss function, and its specific expression is:

[0023]

[0024] In the above expression, N is the number of samples and C is the number of categories, where input is the original output of the model, target is the label of the true category, input[n, j] represents the original output value of the nth sample corresponding to category j, loss is the loss value, and log is the logarithmic operation.

[0025] In a possible implementation, the convolutional neural network ordinary differential equation model in step S23 is composed of a convolutional neural network module, a neural network ordinary differential equation module and a feedforward neural network module.

[0026] In one possible implementation, a convolutional neural network module is used to extract features from input data and reduce spatial dimensions; the convolutional neural network module uses a 3x3 convolution kernel with a step size of 1, accepts input channels in_channels, and outputs a feature map with channels out_channels; the input data is convolved using the convolution kernel, batch normalization is applied to speed up the training process, and finally a ReLU activation function is used to introduce nonlinearity; if the pooling process is selected, a 4x4 maximum pooling layer is added after the above sequence.

[0027] In one possible implementation, the Neural ODE is a neural network with parameterized hidden state derivatives, allowing the neural network to process input data in a dynamic manner; its specific implementation method is: first define the ODEfunc class as a function unit representing the Neural ODE; the class contains a series of convolution, batch normalization and activation operations for processing input data; during the forward propagation process, the class performs a series of operations on the input data and returns the processed results; the Neural ODE module uses the above ODEfunc and combines it with the differential equation solver function to solve the Neural ODE; during back propagation, the Neural ODE module uses the adjoint sensitivity method combined with the differential equation solver to obtain the gradient information of the model parameters, and then uses the gradient information to update the model parameters.

[0028] In one possible implementation, the Neural ODE can be abstractly represented as:

[0029]

[0030] Among them, h is the neural network input that changes with time, t is the running time, and θ is the parameter of the neural network model.

[0031] This application has the following beneficial effects:

[0032] The present invention introduces neural differential equations into the convolutional neural network model, which can effectively reduce the parameter scale of the model and reduce the storage requirements for model deployment;

[0033] The present invention uses the adjoint sensitivity method to realize back propagation during the model training process, which can reduce the memory resources occupied during model training;

[0034] The present invention uses an ordinary differential equation solver in the model reasoning process, and can dynamically adjust the solver error range to control the model reasoning speed and accuracy;

[0035] The present invention adopts the Adam optimization algorithm, which can adaptively adjust the learning rate to avoid overfitting and achieve better training effect;

[0036] The present invention has good anti-interference ability and robustness, and can meet the needs of crop disease identification in actual scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1 A flow chart of a method for crop disease image recognition based on convolutional neural ordinary differential equations is provided for an embodiment of the present application;

[0039] Figure 2 A schematic diagram of a sample of a partial crop disease image dataset is provided for the embodiment of the present application;

[0040] Figure 3 A schematic diagram of an ODEBlock visualization structure is provided for an embodiment of the present application;

[0041] Figure 4 A schematic diagram of a visualization structure of a convolutional neural ordinary differential equation is provided for an embodiment of the present application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0043] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0044] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0045] See also Figure 1 , Figure 1 The present invention provides a flow chart of a method for crop disease image recognition based on convolutional neural ordinary differential equations. Figure 1 As shown, the method includes:

[0046] S1: Obtain a crop disease dataset, preprocess and divide the original dataset to obtain a training dataset and a test dataset.

[0047] The crop disease dataset comes from the PlantVillage dataset, which is divided into a training dataset and a test dataset in a ratio of 7:3. The dataset includes 26 diseases of 14 common crops. Considering the existence of common crops without diseases, the original dataset has a total of 38 categories. Figure 2 These are samples of some crop disease image datasets in one embodiment of the present invention.

[0048] The specific method for processing the original data set is:

[0049] S11: read the original data set from the disk into the computer memory, and divide the data set into a training data set and a test data set in a ratio of 7:3;

[0050] S12: query the computer cuda device. If the cuda device exists, move the training data set and the test data set into the cuda device for training acceleration. Otherwise, use the CPU for training.

[0051] S13: Set up a training data loader and a test data loader to load the training data set and the test data set respectively, so as to facilitate data acquisition during model training.

[0052] S2: Adjust the hyperparameters of the convolutional neural network ordinary differential equation model, load the training data set into the model for training, and obtain the trained convolutional neural network ordinary differential equation model.

[0053] S3: Set the precision control parameters, reload the convolutional neural network ordinary differential equation model parameters, and obtain the convolutional neural network ordinary differential equation model with adjustable precision.

[0054] S4: Acquire crop images, pre-process the crop images, and input them into a convolutional neural ordinary differential equation model with adjustable accuracy for disease identification to obtain crop disease identification results.

[0055] In a possible implementation, the specific process of model training in step S2 is:

[0056] S21: Set appropriate batch parameters and introduce neural network parameter optimizer;

[0057] S22: define the target loss function;

[0058] S23: Define the convolutional neural ordinary differential equation model structure;

[0059] S24: Read data in batches and input the model to calculate the target loss function value, optimize the target loss function value using the neural network parameter optimizer, and iteratively search for the optimal model parameters.

[0060] In a possible implementation, the neural network parameter optimizer in step S21 adopts the Adam optimization algorithm, and the k-th iteration process is as follows:

[0061]

[0062] m k =β 1 m k-1 +(1-β 1 ) k

[0063]

[0064]

[0065] In the above process, θ is the parameter of the convolutional neural ordinary differential equation model, β 1 , β 2 , c are the optimized hyperparameters, g, m, and v are the gradient of the objective function with respect to the parameters, the estimate of the first-order moment, and the estimate of the second-order moment, respectively. It is the result of correcting m and v.

[0066] In a possible implementation, the target loss function in step S22 uses a cross entropy loss function, and its specific expression is:

[0067]

[0068] In the above expression, N is the number of samples and C is the number of categories, where input is the original output of the model, target is the label of the true category, input[n, j] represents the original output value of the nth sample corresponding to category j, loss is the loss value, and log is the logarithmic operation.

[0069] Among them, the convolutional neural network ordinary differential equation model structure consists of a convolutional neural network module, a neural network ordinary differential equation module and a feedforward neural network module; Figure 3 Schematic diagram of the visualization structure of the convolutional neural ordinary differential equation according to an embodiment of the present invention.

[0070] The convolutional neural network module is used to extract features from the input data and reduce the spatial dimension. It uses a 3x3 convolution kernel with a stride of 1, accepts input channels in_channels, and outputs feature maps with channels out_channels. Through this component, the input data is convolved, then batch normalization is applied to speed up the training process, and finally the ReLU activation function is used to introduce nonlinearity. If the pooling process is selected, a 4x4 maximum pooling layer is added after the above sequence.

[0071] The Neural ODE module allows the neural network to process input data in a dynamic way, thereby improving the expressiveness and adaptability of the model. First, define the ODEfunc class as a functional unit representing the Neural ODE. This class contains a series of convolution, batch normalization, and activation operations to process the input data. During the forward propagation process, this class performs a series of operations on the input data and returns the processed results. The Neural ODE module uses the above ODEfunc and combines it with the differential equation solver function to solve the Neural ODE. During the forward propagation, the Neural ODE module accepts the initial state as input, obtains the final state through the ODE solution, and then returns the state as output. This design allows each node of the neural network to be regarded as a solution to a differential equation, allowing the model to adapt more flexibly to data changes at different time points. Figure 4It is a schematic diagram of the visual structure of ODEBlock of the present invention.

[0072] The following is the process of inputting a crop disease image and predicting the recognition output through the convolutional neural ordinary differential equation model.

[0073] S41: Input the crop disease image into the computer memory and convert it into a tensor form. The cropping specification is 3x256x256;

[0074] S42: The output is further filtered by the convolution block of the first layer to extract the feature tensor with a specification of 64x256x256;

[0075] S43: The output is further filtered by the convolution block of the second layer to extract the feature tensor with a specification of 128x64x64;

[0076] S44: the output is further transformed by the neural ordinary differential equation block of the third layer, and the specifications remain unchanged;

[0077] S45: The output is further filtered by the convolution block of the fourth layer to extract the feature tensor with a specification of 256x16x16;

[0078] S46: The output is further filtered by the convolution block of the fifth layer to extract the feature tensor with a specification of 512x4x4;

[0079] S47: the output is further transformed by the sixth layer of the Neural Ordinary Differential Equation block, with the specifications unchanged;

[0080] S48: Perform maximum pooling on the output and expand it into a one-dimensional vector and input it into a fully connected neural network to obtain a tensor with a specification of 1x38. The output tensor can be used for recognition;

[0081] The model accuracy of the present invention on this data set can reach 98.49%, and the parameter size is only 7.16MB. In addition, the crop disease image recognition method provided by the present invention can effectively extract crop disease information. The embedded neural ordinary differential equation significantly reduces the model size and the recognition accuracy can be dynamically adjusted. At the same time, it also has good anti-interference ability and robustness, which can improve the efficiency of crop disease recognition and increase economic benefits.

[0082] In a possible implementation, the convolutional neural network ordinary differential equation model in step S23 is composed of a convolutional neural network module, a neural network ordinary differential equation module and a feedforward neural network module.

[0083] In one possible implementation, a convolutional neural network module is used to extract features from input data and reduce spatial dimensions; the convolutional neural network module uses a 3x3 convolution kernel with a step size of 1, accepts input channels in_channels, and outputs a feature map with channels out_channels; the input data is convolved using the convolution kernel, batch normalization is applied to speed up the training process, and finally a ReLU activation function is used to introduce nonlinearity; if the pooling process is selected, a 4x4 maximum pooling layer is added after the above sequence.

[0084] In one possible implementation, the Neural ODE is a neural network with parameterized hidden state derivatives, allowing the neural network to process input data in a dynamic manner; its specific implementation method is: first define the ODEfunc class as a function unit representing the Neural ODE; the class contains a series of convolution, batch normalization and activation operations for processing input data; during the forward propagation process, the class performs a series of operations on the input data and returns the processed results; the Neural ODE module uses the above ODEfunc and combines it with the differential equation solver function to solve the Neural ODE; during back propagation, the Neural ODE module uses the adjoint sensitivity method combined with the differential equation solver to obtain the gradient information of the model parameters, and then uses the gradient information to update the model parameters.

[0085] In one possible implementation, the Neural ODE can be abstractly represented as:

[0086]

[0087] Among them, h is the neural network input that changes with time, t is the running time, and θ is the parameter of the neural network model.

[0088] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0089] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0090] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.

[0091] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0092] In addition, the functional units in the various embodiments of the application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software program modules.

[0093] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.

[0094] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, which can include: a flash drive, a read-only memory, a random access memory, a magnetic disk or an optical disk, etc.

[0095] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for crop disease image recognition based on convolutional neural ordinary differential equations, characterized in that: The method comprises: S1: Obtain a crop disease dataset, preprocess and divide the original dataset to obtain a training dataset and a test dataset; S2: Adjust the hyperparameters of the convolutional neural network ordinary differential equation model, load the training data set into the model for training, and obtain the trained convolutional neural network ordinary differential equation model; S3: Set the precision control parameters, reload the convolutional neural network ordinary differential equation model parameters, and obtain the convolutional neural network ordinary differential equation model with adjustable precision; S4: Acquire crop images, pre-process the crop images, and input them into a convolutional neural ordinary differential equation model with adjustable accuracy for disease identification to obtain crop disease identification results.

2. The crop disease image recognition method based on convolutional neural ordinary differential equation according to claim 1 is characterized in that: The crop disease dataset comes from the PlantVillage dataset, which is divided into a training dataset and a test dataset according to a ratio of 7:

3.

3. The crop disease image recognition method based on convolutional neural ordinary differential equation according to claim 2 is characterized in that: The specific process of model training in step S2 is: S21: Set appropriate batch parameters and introduce neural network parameter optimizer; S22: define the target loss function; S23: Define the convolutional neural ordinary differential equation model structure; S24: Read data in batches and input the model to calculate the target loss function value, optimize the target loss function value using the neural network parameter optimizer, and iteratively search for the optimal model parameters.

4. The crop disease image recognition method based on convolutional neural ordinary differential equation according to claim 3, characterized in that: In step S21, the neural network parameter optimizer adopts the Adam optimization algorithm, and the k-th iteration process is as follows: m k =β1m k-1 +(1-β1)g k In the above process, θ is the parameter of the convolutional neural ordinary differential equation model, β1, β2, ∈ are the optimized hyperparameters, g, m, v are the gradient of the objective function with respect to the parameters, the estimate of the first-order moment, and the estimate of the second-order moment, respectively. It is the result of correcting m and v.

5. The crop disease image recognition method based on convolutional neural ordinary differential equation according to claim 3, characterized in that: The target loss function in step S22 uses the cross entropy loss function, and its specific expression is: In the above expression, N is the number of samples and C is the number of categories, where input is the original output of the model, target is the label of the true category, innut[n, j] represents the original output value of the nth sample corresponding to category j, loss is the loss value, and log is the logarithmic operation.

6. The crop disease image recognition method based on convolutional neural ordinary differential equation according to claim 3 is characterized in that: The convolutional neural network ordinary differential equation model in step S23 is composed of a convolutional neural network module, a neural network ordinary differential equation module and a feedforward neural network module.

7. The crop disease image recognition method based on convolutional neural ordinary differential equations according to claim 6 is characterized in that: The convolutional neural network module is used to extract features from the input data and reduce the spatial dimension. The convolutional neural network module uses a 3x3 convolution kernel with a step size of 1, accepts input channels in_channels, and outputs feature maps with channels out_channels. The convolution kernel is used to perform convolution operations on the input data, batch normalization is applied to speed up the training process, and finally the ReLU activation function is used to introduce nonlinearity. If the pooling process is selected, a 4x4 size max pooling layer is added after the above sequence.

8. The crop disease image recognition method based on convolutional neural ordinary differential equation according to claim 6, characterized in that: Neural ODEs are neural networks with parameterized hidden state derivatives, allowing neural networks to process input data in a dynamic manner. The specific implementation method is as follows: first, define the ODEfunc class as a function unit representing the Neural ODE; the class contains a series of convolution, batch normalization, and activation operations for processing input data; during forward propagation, the class performs a series of operations on the input data and returns the processed results; the Neural ODE module uses the above ODEfunc and combines it with the differential equation solver function to solve the Neural ODE; during back propagation, the Neural ODE module uses the adjoint sensitivity method combined with the differential equation solver to obtain the gradient information of the model parameters, and then uses the gradient information to update the model parameters.

9. The crop disease image recognition method based on convolutional neural ordinary differential equation according to claim 8, characterized in that: The Neural Ordinary Differential Equation can be expressed abstractly as: Among them, h is the neural network input that changes with time, t is the running time, and θ is the parameter of the neural network model.