A plant disease detection method based on state space model and Fourier transform
By combining the state space model and Fourier transform, the Mamba algorithm is used to optimize the model parameters, which solves the shortcomings of existing plant disease detection methods in terms of efficiency, accuracy and robustness, and achieves an efficient, accurate and good generalization ability. Plant disease detection.
Patent Information
- Application Number
- CN202411631891.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-11-15
AI Technical Summary
The existing plant disease detection methods have shortcomings in efficiency, accuracy and robustness, and rely on a large amount of labeled data, which is difficult to gain wide acceptance in actual agricultural applications.
A detection method based on state space model and Fourier transform is used to build an initial state space model by collecting plant leaf images, performing preprocessing and feature extraction, and using the Mamba algorithm to optimize model parameters, and finally train a plant disease detection model.
This method improves the efficiency and accuracy of plant disease detection, has good generalization ability and robustness, can process large-scale image data in a short time, and adapts to different environments and noise conditions.
Smart Images

Figure CN119169471B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of plant disease detection, and in particular to a plant disease detection method based on a state space model and Fourier transform. Background Art
[0002] Image processing technology and machine learning algorithms have played an important role in the development of plant disease detection technology. Traditional methods mainly rely on visual observation and manual diagnosis, which is not only time-consuming and labor-intensive, but also easily affected by subjective factors. In order to overcome these shortcomings, researchers have developed an automated disease detection system based on image processing and machine learning.
[0003] Image processing-based methods usually detect and classify plant diseases by extracting color, shape, and texture features of images. For example, techniques such as RGB color space, gray-level co-occurrence matrix, and edge detection are used. However, these methods often rely on manually designed features, and their detection accuracy is limited by the quality of feature extraction and the lighting conditions of the image. In addition, these methods usually require a long computation time and are difficult to apply in real time.
[0004] With the development of machine learning technology, especially the successful application of deep learning in image recognition, more and more studies have begun to use deep learning models such as convolutional neural networks (CNNs) to automatically extract image features and classify them. These methods have improved the accuracy and efficiency of detection to some extent. However, deep learning models often require a large amount of labeled data for training, and the training process is computationally intensive and consumes a lot of computing resources. In addition, the black box characteristics of deep learning models make their decision-making process difficult to explain, affecting their acceptance in actual agricultural applications.
[0005] In summary, the existing plant disease detection methods still have many shortcomings in practical applications, and new technical solutions are needed to improve the efficiency, accuracy and robustness of detection, while reducing dependence on large amounts of labeled data and enhancing the generalization ability and interpretability of the model. Summary of the invention
[0006] In order to overcome the deficiencies of the prior art, the purpose of the present invention is to provide a plant disease detection method based on a state-space model and Fourier transform, aiming to provide an efficient, accurate and well-generalized solution for plant disease detection.
[0007] To achieve the above object, the present invention provides the following solutions:
[0008] A plant disease detection method based on a state space model and Fourier transform, comprising:
[0009] Collecting plant leaf images and preprocessing the plant leaf images to obtain diseased spot area images;
[0010] Extracting features from the lesion area image to obtain frequency domain features and time domain features;
[0011] Constructing an initial state space model according to the characteristic parameters of the lesion area image and the frequency domain features;
[0012] Optimizing the model parameters of the initial state space model using the Mamba algorithm to obtain an optimized state space model;
[0013] Using the labeled plant disease data set to train the optimized state space model to obtain a trained plant disease detection model;
[0014] The image to be tested is input into the plant disease detection model to obtain the detection result.
[0015] Preferably, the plant leaf image is preprocessed to obtain a diseased spot area image, including:
[0016] The plant leaf image is subjected to denoising, image enhancement and segmentation to obtain the diseased spot area image; the denoising method is Gaussian filtering; the image enhancement method is histogram equalization; and the segmentation method is K-means clustering.
[0017] Preferably, the frequency domain features include spectrum amplitude and phase information.
[0018] Preferably, feature extraction is performed on the lesion area image to obtain frequency domain features and time domain features, including:
[0019] Apply a two-dimensional discrete Fourier transform to the lesion area image to convert the lesion area image from the time domain to the frequency domain to obtain a frequency domain representation F ( u, v );The frequency domain representation F ( u, v ) is: ;in, f ( x, y ) represents the time domain image, M and N are the width and height of the time domain image respectively, j is an imaginary unit, u is the horizontal frequency index in the frequency domain, v is the vertical frequency index in the frequency domain, x is the horizontal coordinate of the image in the time domain, y is the vertical coordinate of the image in the time domain;
[0020] Extract the spectrum magnitude according to the frequency domain representation |F ( u, v )| and phase information ; where the spectrum amplitude | F ( u, v )| is calculated as: The phase information The calculation formula is: ;in, and Respectively F ( u, v )'s real and imaginary parts.
[0021] Preferably, constructing an initial state space model according to the characteristic parameters of the lesion area image and the frequency domain features includes:
[0022] Define the state variables of the initial state-space model and observed variables ; is the state vector of the system at time t; the state vector includes characteristic parameters of the lesion area image; is the observation vector at time t; the observation vector includes frequency domain features;
[0023] The dynamic changes of the system are described by the initial state space model; the state equation of the system is: The observation equation of the system is ;in, is the state transfer matrix, is the control matrix, is the observation matrix, is the input vector, and are process noise and observation noise, respectively.
[0024] Preferably, the formula of the Mamba algorithm includes:
[0025] .
[0026] in, and are the state transfer function and observation function respectively, and the parameters and They are state transfer functions Parameters and observation functions Parameters.
[0027] Preferably, after inputting the image to be tested into the plant disease detection model and obtaining the detection result, the method further comprises:
[0028] A corresponding diagnosis report is generated according to the detection results.
[0029] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0030] The present invention provides a plant disease detection method based on a state space model and Fourier transform, comprising: collecting plant leaf images, and preprocessing the plant leaf images to obtain diseased spot area images; extracting features from the diseased spot area images to obtain frequency domain features and time domain features; constructing an initial state space model according to the feature parameters of the diseased spot area images and the frequency domain features; optimizing the model parameters of the initial state space model using a Mamba algorithm to obtain an optimized state space model; training the optimized state space model using a labeled plant disease data set to obtain a trained plant disease detection model; inputting the image to be tested into the plant disease detection model to obtain a detection result. The present invention aims to provide an efficient, accurate and well-generalized solution for plant disease detection by combining fast Fourier transform feature extraction and the Mamba optimization algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0032] Figure 1 A flow chart of a method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] The purpose of the present invention is to provide a plant disease detection method based on state space model and Fourier transform, aiming to provide an efficient, accurate and well generalized solution for plant disease detection.
[0035] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0036] Figure 1A flow chart of a method provided by an embodiment of the present invention, such as Figure 1 As shown, the present invention provides a plant disease detection method based on a state space model and Fourier transform, comprising:
[0037] Step 100: collecting plant leaf images, and preprocessing the plant leaf images to obtain diseased spot area images;
[0038] Step 200: extracting features from the lesion area image to obtain frequency domain features and time domain features;
[0039] Step 300: constructing an initial state space model according to the characteristic parameters of the lesion area image and the frequency domain features;
[0040] Step 400: Optimizing the model parameters of the initial state space model using the Mamba algorithm to obtain an optimized state space model;
[0041] Step 500: using the labeled plant disease data set to train the optimized state space model to obtain a trained plant disease detection model;
[0042] Step 600: input the image to be tested into the plant disease detection model to obtain the detection result.
[0043] Preferably, the plant leaf image is preprocessed to obtain a diseased spot area image, including:
[0044] The plant leaf image is subjected to denoising, image enhancement and segmentation to obtain the diseased spot area image; the denoising method is Gaussian filtering; the image enhancement method is histogram equalization; and the segmentation method is K-means clustering.
[0045] Preferably, the frequency domain features include spectrum amplitude and phase information.
[0046] Specifically, step 100 of this embodiment includes:
[0047] Data collection and preprocessing are performed by image acquisition devices (such as high-resolution cameras) and computers. The specific steps are as follows:
[0048] ① Use image acquisition equipment to capture images of plant leaves, ensuring that the images have sufficient resolution and clarity.
[0049] ②Transfer the image to the computer.
[0050] ③ Perform image preprocessing on a computer, including denoising (such as Gaussian filtering), image enhancement (such as histogram equalization) and segmentation (such as using K-means clustering) to extract the lesion area.
[0051] Preferably, step 200 of this embodiment includes:
[0052] Apply a two-dimensional discrete Fourier transform to the lesion area image to convert the lesion area image from the time domain to the frequency domain to obtain a frequency domain representation F ( u, v ); the frequency domain representation F( u, v ) is: ;in, f ( x, y ) represents the time domain image, M and N are the width and height of the time domain image respectively, j Is the imaginary unit, used to represent complex numbers in Fourier transforms. u It is the horizontal frequency index in the frequency domain, representing the frequency component across the image width. v It is the vertical frequency index in the frequency domain, indicating the frequency component at the image height. x It is the horizontal coordinate of the image in the time domain, indicating the index of the pixel position of the image in the horizontal direction. y is the vertical coordinate of the image in the time domain, indicating the index of the pixel position of the image in the vertical direction;
[0053] Extract the spectrum magnitude according to the frequency domain representation | F ( u, v )| and phase information ; where the spectrum amplitude | F ( u, v )| is calculated as: The phase information The calculation formula is: ;in, and Respectively F ( u, v )'s real and imaginary parts.
[0054] Specifically, the execution subject of the feature extraction in this embodiment is a computer, and the specific steps are as follows:
[0055] ① Apply two-dimensional discrete Fourier transform (2D-DFT) to the preprocessed image to convert the image from time domain to frequency domain and obtain the frequency domain representation F(u,v):
[0056]
[0057] in, f(x, y) represents the time domain image, M and N are the width and height of the image respectively.
[0058] ②Extract frequency domain features, such as spectrum amplitude|F(u, v)| and phase information :
[0059]
[0060]
[0061] in, and Respectively F(u, v) The real and imaginary parts of .
[0062] Preferably, step 300 of this embodiment includes:
[0063] Define the state variables of the initial state-space model and observed variables ; is the state vector of the system at time t; the state vector includes characteristic parameters of the lesion area image; is the observation vector at time t; the observation vector includes frequency domain features;
[0064] The dynamic changes of the system are described by the initial state space model; the state equation of the system is: The observation equation of the system is ;in, is the state transfer matrix, is the control matrix, is the observation matrix, is the input vector, and are process noise and observation noise, respectively.
[0065] Preferably, the formula of the Mamba algorithm includes:
[0066] .
[0067] in, and are the state transfer function and observation function respectively, and the parameters and They are state transfer functions Parameters and observation functions Parameters.
[0068] Optionally, in step 400 of this embodiment, the specific steps of using the Mamba algorithm are as follows:
[0069] ① Use the Mamba algorithm to optimize model parameters. Mamba is a linear time series modeling algorithm that can selectively use state space models to model sequence data.
[0070] ②In the Mamba algorithm, the following formula is used to optimize the parameters:
[0071] .
[0072] in, and are the state transfer function and observation function respectively, and the parameters and Need to be determined through optimization. Process noise and observation noise is assumed to be Gaussian noise.
[0073] Optionally, is the state transition function , which is used to define how the system evolves from one state to the next. For example, in disease detection, Controls how lesion characteristics change over time. is the observation function The parameters describe how to extract observable data from the system state to ensure that the observed data can accurately reflect the system state. The specific optimization steps are as follows:
[0074] Initial model building:
[0075] Set the initial state space model and define the state transfer function and the observation function , and the initial parameters and .
[0076] Parameter iterative optimization:
[0077] The model prediction status is measured by calculating the loss function The actual observed value The loss function may be based on the mean square error (MSE) or other evaluation indicators:
[0078]
[0079] Gradient descent update:
[0080] Calculate the loss function against the parameters by gradient descent or other optimization algorithms and The gradient of , and update it. The update formula is:
[0081]
[0082] in, is the learning rate, which indicates the step size of parameter update.
[0083] Furthermore, in this embodiment, Fourier transform is combined with the state space model. In this step, the frequency domain features extracted previously are combined with the state space model, and disease detection and classification are performed through an optimization process. The specific steps are as follows:
[0084] ① Input frequency domain features into the state space model:
[0085] First, the frequency domain features (i.e., spectrum amplitude) extracted in the above steps are and phase information As observation variables, they are input into the optimized state-space model. These frequency domain features contain the spatial distribution characteristics of the lesions and can provide rich input information for the state-space model.
[0086] ②Build state variables:
[0087] State variables More complex feature combinations can be included, such as a mixture of multi-scale frequency domain features and time domain features. This means not only using frequency domain features of a single scale, but also combining information at different scales to improve the robustness and accuracy of the model:
[0088]
[0089] in, It includes multi-scale frequency domain features obtained through Fourier transform and other possible time domain features.
[0090] Specifically, the specific implementation steps and formulas for mixing frequency domain features and time domain features are as follows:
[0091] The frequency domain and time domain features are combined to form a multi-scale feature vector. The feature information of different scales can capture the local and global features of the image and improve the robustness of the model.
[0092] At every scale Above, frequency domain and time domain features are mixed to form a joint feature vector:
[0093]
[0094] in, It represents the time domain features, and the frequency domain features include spectrum amplitude and phase information. represents the extraction of spectral magnitudes from the frequency domain representation at each scale. Phase information is extracted from the frequency domain representation at each scale.
[0095] The feature vectors of all scales are stacked to form the final multi-scale feature vector:
[0096] in, Indicates the total number of scales.
[0097] ③Optimization of state space model:
[0098] The parameters of the state space model are further optimized through the Mamba optimization algorithm. This process uses the following formula for optimization:
[0099] Among them, A is the state transfer matrix, B is the control matrix, and C is the observation matrix. is the input vector, and They are process noise and observation noise respectively. The Mamba algorithm can selectively use the state space model to model sequence data and optimize these matrix parameters to make the model better fit the actual data;
[0100] ④Feature combination and optimization:
[0101] The multi-scale frequency domain features and time domain features are combined as the input of the state variable, and the parameters of the model are optimized through the Mamba algorithm to achieve accurate detection and classification of plant diseases. The optimization process takes into account the interaction between frequency domain features and time domain features, which improves the robustness and accuracy of the model.
[0102] ⑤Model output and disease classification:
[0103] The optimized state space model is used to predict and classify the diseases of the plant leaf images to be detected. By calculating the estimated value of the state variable , determine the presence and type of lesions, and generate a corresponding diagnostic report.
[0104] In addition, in step 500 of this embodiment, the specific steps of model training and verification are as follows:
[0105] ① Use the labeled plant disease dataset to train the state space model and optimize the model parameters .
[0106] ② Use the cross-validation method to evaluate the model performance by splitting the data into training set and validation set to ensure the generalization ability of the model.
[0107] Furthermore, the specific steps of disease detection and classification in this embodiment are as follows:
[0108] ① Input the plant leaf image to be detected into the trained state space model.
[0109] ②Use the model to predict the presence and type of lesions by calculating the state variables The estimated value is used to determine the disease type.
[0110] ③ Based on the model output results, classify plant diseases and generate corresponding diagnostic reports.
[0111] In the plant disease detection and classification step, the state space model is used to calculate the estimated values and determine the disease type based on these estimated values, as follows:
[0112] First, calculate the state variable Estimated value:
[0113] 1. Input image data: Input the preprocessed plant leaf images into the trained state-space model. These image data have been Fourier transformed to extract frequency domain features.
[0114] 2. Operation of the state space model:
[0115] The state equation describes the change of the system state over time:
[0116]
[0117] in, is the state variable at time t, is the state transition matrix, is the control matrix, is the input vector, is the process noise.
[0118] The observation equation describes the relationship between the system observations and state variables:
[0119]
[0120] in, is the observed variable at time t (i.e. the extracted frequency domain feature), is the observation matrix, is the observation noise.
[0121] 3. Estimate state variables:
[0122] Using the above equation, the state variable is filtered by a filtering algorithm (such as a Kalman filter). Make an estimate.
[0123] The Kalman filter will be based on the new observation data , combined with the state estimate at the previous moment and model parameters , , , calculate the state variable at the current time t .
[0124] Furthermore, the steps of determining the disease type in this embodiment are as follows:
[0125] 1. Relationship between state variables and disease types:
[0126] Through model training, state variables The characteristic parameters of the lesions (such as shape, size, color, etc.) have been learned, and these parameters can directly reflect the type of disease.
[0127] 2. Classification determination:
[0128] According to the estimated state variables , and match it with the predefined disease type feature template. By comparing the similarity between the state variable and the template, the most likely disease type is determined. The known quantities of the model include: preprocessed image data, frequency domain features (spectral amplitude and phase information), and annotated plant disease data sets; the unknown quantities include: model parameters: ; Estimated values of disease type and state variables: .
[0129] The beneficial effects of the present invention are as follows:
[0130] (1) High detection efficiency: Fourier transform quickly converts images from time domain to frequency domain, reducing the amount of complex time domain analysis calculations. The Mamba algorithm has linear time complexity and can quickly process large amounts of sequence data. The fast computational characteristics of Fourier transform and the linear time complexity of the Mamba algorithm enable this method to process large amounts of image data in a relatively short time, thus improving overall detection efficiency.
[0131] (2) High detection accuracy: The frequency domain features (spectral amplitude and phase information) extracted by Fourier transform can capture the spatial distribution characteristics of plant spots and provide rich feature information. Through the dynamic change description of the state space model, the temporal and spatial variation laws of plant diseases can be captured more accurately.
[0132] (3) Mamba optimization: The Mamba algorithm optimizes the parameters of the state-space model, allowing the model to better fit the actual data. The combination of the rich information of the frequency domain features and the description of the dynamic changes of the state-space model, coupled with the optimization of the parameters by the Mamba algorithm, makes the model more accurate in detecting plant diseases and can effectively distinguish different types of diseases.
[0133] (4) Strong robustness: The state-space model can capture the dynamic changes of the system and adapt to disease detection in different environments. The optimization process can adjust the model parameters so that it can still maintain good performance under different noise conditions. The description of dynamic changes by the state-space model and the adaptability of the Mamba algorithm to noise enable this method to maintain high detection performance in the face of different environments and noise conditions.
[0134] The present invention significantly improves the efficiency and accuracy of plant disease detection by combining Fourier transform and Mamba optimization technology, while having good generalization ability and robustness. Fourier transform provides rich frequency domain features, and Mamba algorithm optimizes state space model parameters. The combination of these technical points is the main source of the advantages of the present invention.
[0135] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0136] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A plant disease detection method based on state space model and Fourier transform, characterized in that: include: Collecting plant leaf images and preprocessing the plant leaf images to obtain diseased spot area images; Extracting features from the lesion area image to obtain frequency domain features and time domain features; Constructing an initial state space model according to the characteristic parameters of the lesion area image and the frequency domain features; Optimizing the model parameters of the initial state space model using the Mamba algorithm to obtain an optimized state space model; Using the labeled plant disease data set to train the optimized state space model to obtain a trained plant disease detection model; Inputting the image to be tested into the plant disease detection model to obtain a detection result; The frequency domain features include spectrum amplitude and phase information; Feature extraction is performed on the lesion area image to obtain frequency domain features and time domain features, including: Apply a two-dimensional discrete Fourier transform to the lesion area image to convert the lesion area image from the time domain to the frequency domain to obtain a frequency domain representation F ( u,v ); the frequency domain representation F ( u,v ) is: ;in, f ( x,y ) represents the time domain image, M and N are the width and height of the time domain image respectively, j is an imaginary unit, u is the horizontal frequency index in the frequency domain, v is the vertical frequency index in the frequency domain, x is the horizontal coordinate of the image in the time domain, y is the vertical coordinate of the image in the time domain; Extract the spectrum amplitude according to the frequency domain representation and phase information ; where the spectrum amplitude The calculation formula is: ; The phase information The calculation formula is: ;in, Respectively The real and imaginary parts of .
2. The plant disease detection method based on state space model and Fourier transform according to claim 1, characterized in that: Preprocessing the plant leaf image to obtain a diseased spot area image includes: The plant leaf image is subjected to denoising, image enhancement and segmentation to obtain the diseased spot area image; the denoising method is Gaussian filtering; the image enhancement method is histogram equalization; and the segmentation method is K-means clustering.
3. The plant disease detection method based on state space model and Fourier transform according to claim 1, characterized in that: Constructing an initial state space model according to the characteristic parameters of the lesion area image and the frequency domain features, including: Define the state variables of the initial state-space model and observed variables ; is the state vector of the system at time t; the state vector includes characteristic parameters of the lesion area image; is the observation vector at time t; the observation vector includes frequency domain features; The dynamic changes of the system are described by the initial state space model; the state equation of the system is: The observation equation of the system is ; Where A is the state transfer matrix, B is the control matrix, and C is the observation matrix. is the input vector, and are process noise and observation noise, respectively.
4. The plant disease detection method based on state space model and Fourier transform according to claim 3, characterized in that: The formula of the Mamba algorithm includes: Among them, f and g are the state transfer function and observation function respectively, and the parameters and are the parameters of the state transfer function f and the observation function g respectively.
5. The plant disease detection method based on state space model and Fourier transform according to claim 1, characterized in that: After the image to be tested is input into the plant disease detection model and the detection result is obtained, the method further includes: A corresponding diagnosis report is generated according to the detection results.
Citation Information
Patent Citations
Apple disease identification method based on the histogram of layered gradient directions in logarithmic frequency domain
AU2020102883A4
Deep hash image retrieval method based on frequency domain decoupling and visual Mamba
CN118820508A