Method and device for detecting seed of rice seed-borne bacterial blight based on hyperspectral image
By employing a multi-module collaborative detection method based on hyperspectral images, the problems of lagging, complexity, and high cost in identifying rice seedlings infected with Bakanae disease have been solved. This method achieves efficient, accurate, and non-destructive seed identification, improving the accuracy and reliability of the results.
Patent Information
- Application Number
- CN202511738004.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-25
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-11-25
AI Technical Summary
Existing technologies cannot efficiently, accurately, and non-destructively identify rice bakanae disease-carrying seeds. Traditional methods suffer from problems such as delayed identification, complexity, high cost, or high destructiveness, making it difficult to meet the needs of seed production and quarantine.
A method for detecting rice seedling blight-carrying disease based on hyperspectral images is adopted. This method utilizes a multi-scale spectral feature extraction module, an adaptive spectral attention mechanism module, a deep feature cross-fusion network module, and a discrimination result module, including a dynamic meta-learning classifier and an uncertainty quantification module, to achieve efficient and accurate discrimination of seed health status.
It enables efficient, accurate, non-destructive, and quantifiable identification of infected seeds, improves the accuracy and generalization ability of the identification, provides the reliability of the identification results, and meets the needs of seed production and quarantine.
Smart Images

Figure CN121207889B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of rice seed quality detection, and in particular to a rice bakanae disease seed detection method and device based on hyperspectral images. BACKGROUND
[0002] Rice is a key food crop worldwide, and rice bakanae disease is caused by Fusarium fujikuroi and mainly transmitted through seed-borne seeds, which can cause a 30%-50% reduction in rice yield or even complete loss. Therefore, accurate identification of seed-borne seeds before sowing is a key means to block the spread of the disease. However, rice bakanae disease seed-borne seeds and normal seeds are highly consistent in appearance characteristics such as particle size, color, and shape, and cannot be distinguished by the naked eye or conventional optical instruments. Traditional identification methods have significant limitations: field observation method requires the plant to grow to the jointing stage before symptoms appear, which is delayed and easily affected by the environment; pathogenic bacteria isolation and culture method takes about one week, is complex to operate and depends on professional experience, and also destroys the seeds; molecular biology detection method is accurate, but has high equipment and reagent costs, strong sample destructiveness, and low detection efficiency, which cannot meet the needs of seed production, quarantine, and other aspects. In summary, the current methods cannot meet the needs of efficient, accurate, non-destructive, and reliable quantifiable results for seed-borne seed identification in seed production and quarantine, and developing a new rice bakanae disease seed-borne seed detection method has become a problem to be solved in the field. SUMMARY
[0003] In view of the problems existing in the prior art, the present application provides a rice bakanae disease seed-borne seed detection method and device based on hyperspectral images, which realizes efficient, accurate, non-destructive, and reliable quantifiable results for seed-borne seed identification. The technical solution is as follows:
[0004] In the first aspect, a rice bakanae disease seed-borne seed detection method based on hyperspectral images is provided, which includes the following steps:
[0005] Based on the hyperspectral image of the rice seed, the hyperspectral data is obtained;
[0006] The obtained hyperspectral data is preprocessed to obtain preprocessed hyperspectral data;
[0007] The preprocessed hyperspectral data is input into a rice bakanae disease seed-borne seed discrimination model to obtain a discrimination result of the health status of the rice seed;
[0008] The rice bakanae disease seed-borne seed discrimination model sequentially includes a multi-scale spectral feature extraction module, an adaptive spectral attention mechanism module, a deep feature cross-fusion network module, and a discrimination result module,
[0009] The multi-scale spectral feature extraction module is used to extract different scale spectral features and fuse them into spectral pyramid features,
[0010] The adaptive spectral attention mechanism module is configured to determine an importance weight vector of each waveband based on the spectral pyramid feature as input, and to obtain attention-enhanced spectral features by weighted fusion of each waveband of the preprocessed hyperspectral data.
[0011] The deep feature cross fusion network module is configured to perform multi-modal feature interaction based on the preprocessed hyperspectral data, the attention-enhanced spectral features and the spectral pyramid feature as input, and to output deep fusion features.
[0012] The discrimination result module includes a dynamic meta-learning classifier module and an uncertainty quantification module in parallel, the dynamic meta-learning classifier module is configured to output a discrimination result of the seed health state, and the uncertainty quantification module is configured to output a confidence of the discrimination result.
[0013] In some embodiments, the preprocessing includes:
[0014] The obtained hyperspectral data is sequentially subjected to AirPLS detrending processing, SG smoothing processing and MSC multivariate scattering correction processing to obtain preprocessed hyperspectral data.
[0015] In some embodiments, the multi-scale spectral feature extraction module includes a plurality of parallel convolution branches and a feature concatenation layer, a first convolution branch is a local detail feature extraction branch, and a 1x3 convolution kernel is used; a second convolution branch is a mesoscale trend feature extraction branch, and a 1x7 convolution kernel is used; a third convolution branch is a global contour feature extraction branch, and a 1x15 convolution kernel is used; the feature concatenation layer fuses the output features of the three convolution branches along the channel dimension to obtain the spectral pyramid feature.
[0016] In some embodiments, the adaptive spectral attention mechanism module includes a dynamic weight distribution unit, a priori knowledge embedding unit and an attention weighted fusion unit; the dynamic weight distribution unit includes a global average pooling layer, a first full connection layer, a first ReLu function layer, a second full connection layer, a second ReLu function layer and a sigmoid activation function layer; the dynamic weight distribution unit takes the channel statistical features of the spectral pyramid feature as a first input and takes the priori knowledge embedding as a second input to obtain the importance weight vector of each waveband; the attention weighted fusion unit is configured to multiply the importance weight vector and the preprocessed hyperspectral data by waveband to obtain the attention-enhanced spectral features.
[0017] In some embodiments, the deep feature cross fusion network module includes:
[0018] The bidirectional feature gate unit is configured to generate spatial features based on preprocessed hyperspectral data as a first input, generate a gate vector through a sigmoid activation function, dynamically adjust a fusion ratio of the attention-enhanced spectral features and the spatial features, and generate gated enhanced features based on the attention-enhanced spectral features as a second input.
[0019] The cross-attention enhancement unit is configured to map the input features into query vectors, key vectors and value vectors through a multi-head cross-attention mechanism based on the attention-enhanced spectral features as the input, and obtain cross-attention enhanced features through parallel calculation and aggregation of multiple attention heads.
[0020] The hierarchical feature aggregation unit is configured to obtain hierarchical fusion features by element-wise addition of feature maps obtained by dimension reduction of local detailed features and upsampling of global contour features of the spectral pyramid features.
[0021] The multi-modal feature concatenation unit is configured to concatenate the gated enhanced features, the cross-attention enhanced features and the hierarchical fusion features to obtain deep fusion features.
[0022] In some embodiments, the dynamic meta-learning classifier module includes a meta-feature extraction unit, a dynamic weight generation unit, a classifier unit and an adjustable decision threshold unit.
[0023] The meta-feature extraction unit includes two convolutional layers and one fully connected layer, and is configured to extract a meta-feature vector from the deep fusion features.
[0024] The dynamic weight generation unit is configured to generate classifier weight parameters and bias terms for a binary classification task in real time through two fully connected layers and taking the meta-feature vector as the input.
[0025] The adjustable decision threshold unit is configured to generate a classification decision threshold through linear transformation of the meta-feature vector.
[0026] The seed health state discrimination result is obtained by comparing the class probability output by the classifier with the decision threshold.
[0027] In some embodiments, the uncertainty quantification module is implemented through an uncertainty estimation head in parallel with the dynamic meta-learning classifier module. The uncertainty estimation head includes one fully connected layer and a sigmoid activation function, and is configured to take the deep fusion features as the input and output a confidence score in the interval of 0-1.
[0028] In a second aspect, a device for detecting rice seed infected with seed-borne smut is provided based on hyperspectral images, and the device includes:
[0029] A seed hyperspectral image acquisition unit is configured to acquire hyperspectral data based on a hyperspectral image of a rice seed.
[0030] a preprocessing unit, configured to preprocess the obtained hyperspectral data to obtain preprocessed hyperspectral data;
[0031] a seed discrimination unit, configured to input the preprocessed hyperspectral data into a rice seed-borne bacterial seed discrimination model to obtain a discrimination result of a health state of the rice seed;
[0032] The rice seed-borne bacterial seed discrimination model sequentially comprises a multi-scale spectral feature extraction module, an adaptive spectral attention mechanism module, a deep feature cross-fusion network module, and a discrimination result module,
[0033] The multi-scale spectral feature extraction module is configured to extract different scale spectral features and fuse them into spectral pyramid features,
[0034] The adaptive spectral attention mechanism module is configured to determine an importance weight vector of each waveband based on the spectral pyramid features as input, and perform weighted fusion on each waveband of the preprocessed hyperspectral data to obtain attention-enhanced spectral features;
[0035] The deep feature cross-fusion network module is configured to perform multi-modal feature interaction based on the preprocessed hyperspectral data, the attention-enhanced spectral features, and the spectral pyramid features as input, and output deep fusion features;
[0036] The discrimination result module comprises a dynamic meta-learning classifier module and an uncertainty quantification module in parallel, the dynamic meta-learning classifier module is configured to output the discrimination result of the health state of the seed, and the uncertainty quantification module is configured to output a confidence degree of the discrimination result.
[0037] In a third aspect, an electronic device is provided, and the electronic device comprises:
[0038] a processor;
[0039] a memory for storing processor-executable instructions;
[0040] The processor implements the rice seed-borne bacterial seed discrimination method according to the first aspect by running the executable instructions.
[0041] In a fourth aspect, a computer-readable storage medium is provided, and the medium stores computer instructions, which, when executed by a processor, implement the steps of the rice seed-borne bacterial seed discrimination method according to the first aspect.
[0042] The method and apparatus for detecting rice bakanae disease-carrying seeds based on hyperspectral images of the present invention have the following beneficial effects: The multi-module collaborative bakanae disease-carrying seed discrimination model of the present invention forms a hierarchical and adaptive feature learning and decision-making system through a multi-scale spectral feature extraction module, an adaptive spectral attention mechanism module, a deep feature cross-fusion network module, and a discrimination result module. Specifically, the multi-scale spectral feature extraction module extracts spectral features at different scales; the adaptive spectral attention mechanism module dynamically analyzes the importance of each band; the deep feature cross-fusion network module interacts with multimodal features; and the discrimination result module employs a parallel dynamic meta-learning classifier module and an uncertainty quantification module, providing the reliability of the judgment result while outputting the discrimination result of the seed health status. The bakanae disease-carrying seed discrimination model of the present invention achieves efficient, accurate, non-destructive, and quantifiable result reliability identification of infected seeds. Attached Figure Description
[0043] Figure 1 This is a schematic diagram of the structure of the rice bakanae disease-carrying seed discrimination model in the embodiments of this application;
[0044] Figure 2 This is a schematic diagram of the structure of the multi-scale spectral feature extraction module in the embodiments of this application;
[0045] Figure 3 This is a schematic diagram of the adaptive spectral attention mechanism module in an embodiment of this application;
[0046] Figure 4 This is a schematic diagram of the deep feature cross-fusion network module in the embodiments of this application;
[0047] Figure 5 This is a schematic diagram of the structure of the discrimination result module in the embodiments of this application;
[0048] Figure 6 It is the original spectrum of the infected seeds and normal seeds;
[0049] Figure 7 This is the average spectral diagram of infected and normal seeds;
[0050] Figure 8 This is the spectrum after preprocessing with the AirPLS+SG+MSC combination. Detailed Implementation
[0051] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0052] This application provides a method for detecting rice seedling blight-carrying pathogens based on hyperspectral images, including the following steps:
[0053] Step 1: Obtain hyperspectral data based on hyperspectral images of rice seeds;
[0054] Step 2: Preprocess the obtained hyperspectral data to obtain preprocessed hyperspectral data;
[0055] Step 3: Based on the preprocessed hyperspectral data, input it into the rice seed bakanae disease carrier discrimination model to obtain the discrimination result of the rice seed health status. The discrimination result indicates whether the rice seed is a seed carrying bakanae disease. There are two discrimination results: one is a seed carrying bakanae disease, and the other is a normal healthy seed.
[0056] See Figure 1 The rice seed bakanae disease carrier discrimination model sequentially includes a multi-scale spectral feature extraction module 301, an adaptive spectral attention mechanism module 302, a deep feature cross-fusion network module 303, and a discrimination result module 304.
[0057] The multi-scale spectral feature extraction module 301 is used to extract spectral features at different scales and fuse them into spectral pyramid features.
[0058] The adaptive spectral attention mechanism module 302 is used to determine the importance weight vector of each band based on the spectral pyramid features as input, and to obtain attention-enhanced spectral features by weighted fusion of each band of the preprocessed hyperspectral data.
[0059] The deep feature cross-fusion network module 303 is used to perform multimodal feature interaction based on preprocessed hyperspectral data, attention-enhanced spectral features, and spectral pyramid features as input, and output deep fusion features;
[0060] The discrimination result module 304 includes a parallel dynamic meta-learning classifier module 305 and an uncertainty quantization module 306. The dynamic meta-learning classifier module 305 is used to output the discrimination result of the seed health status, and the uncertainty quantization module 306 is used to output the confidence level of the discrimination result.
[0061] The multi-module collaborative seed discrimination model designed in this application embodiment forms a hierarchical and adaptive feature learning and decision-making system through a multi-scale spectral feature extraction module, an adaptive spectral attention mechanism module, a deep feature cross-fusion network module, and a discrimination result module. Specifically, the multi-scale spectral feature extraction module extracts spectral features at different scales; the adaptive spectral attention mechanism module dynamically analyzes the importance of each band; the deep feature cross-fusion network module utilizes three different types of data—hyperspectral data, attention-enhanced spectral features, and spectral pyramid features—to comprehensively capture disease features from multiple dimensions, including spectral, spatial, and multi-scale perspectives, and cross-fused different deep features to achieve multimodal feature interaction; the discrimination result module employs a parallel dynamic meta-learning classifier module and an uncertainty quantification module to provide the reliability of the judgment result while outputting the seed health status discrimination result. The seed discrimination model for Bakanae disease-carrying seeds in this application embodiment achieves efficient, accurate, non-destructive, and quantifiable result reliability for identifying infected seeds.
[0062] In one embodiment, the specific conditions for acquiring hyperspectral data in step 1 above are as follows: the integration time of the hyperspectral imaging system is set to 50-200ms, the acquisition distance is set to 20-50cm, the acquisition environment is a dark room, and reflectivity correction is performed using a standard white board with a reflectivity ≥99%. Specifically, the hyperspectral data acquisition stage uses a hyperspectral imaging system with a wavelength range of 400-1000nm, and acquisition is performed in a dark room to avoid ambient light interference. Before acquisition, reflectivity correction is performed using a standard white board with a reflectivity ≥99%. During acquisition, the seeds are laid flat in a single layer on a black stage to ensure no overlap or obstruction. Hyperspectral images are acquired three times for each seed sample, and the average value is taken. Then, the spectral data of the region of interest (ROI) of the seed is extracted using the accompanying software to exclude invalid background information.
[0063] In one embodiment, step 2 above involves preprocessing the hyperspectral data, including sequentially performing AirPLS detrending processing, SG smoothing processing, and MSC multivariate scattering correction processing on the obtained hyperspectral data to obtain preprocessed hyperspectral data.
[0064] In this embodiment, to improve the quality of hyperspectral data, a preprocessing strategy combining Adaptive Iterative Reweighted Penalized Least Squares (AirPLS), SG smoothing, and Multivariate Scattering Correction (MSC) is adopted to eliminate the effects of baseline drift, high-frequency noise, and scattering effects. The AirPLS algorithm is used to perform baseline correction on the original spectrum. Based on the penalized least squares principle, AirPLS adaptively fits complex baseline changes through an iterative reweighting strategy, accurately separating the baseline signal from the effective spectral features, maximizing the retention of useful information, and restoring the true absorption characteristics of the spectrum. The correction process is as follows:
[0065]
[0066]
[0067]
[0068]
[0069]
[0070] in, It is the original spectral vector; It is the fitted baseline. It is a least squares function with a penalty term; its minimum value is used to determine... ; For penalty parameters; It is the weight that controls how close the fitted baseline and spectral vector are at each sampling location; yes - The negative element; It is the number of iterations; It is the corrected spectral vector.
[0071] The baseline-corrected spectra were further smoothed using the SG method. The SG method, based on local polynomial fitting with a sliding window, effectively suppresses high-frequency noise while preserving the original shape and absorption peak characteristics of the spectral curve, thereby improving the signal-to-noise ratio and resolution. To eliminate light scattering interference caused by sample particle size differences and surface inhomogeneities, scattering correction was finally applied to the SG-smoothed spectra. A linear regression relationship between the sample spectra and the reference mean spectrum was established based on MSC to correct the multiplicative interference caused by scattering, thus improving the correlation between the spectra and seed disease characterization.
[0072] The parameters for AirPLS detrending processing are: 20-50 iterations and a smoothing window width of 5-15 spectral points; the parameters for SG smoothing processing are: a window width of 5-11 spectral points and a polynomial order of 1-3; the specific process of MSC multivariate scattering correction processing is as follows: using the average spectrum of all preprocessed hyperspectral data as the reference spectrum, calculating the linear regression coefficient between each sample spectrum and the reference spectrum, and eliminating the scattering differences of the sample spectra through linear transformation.
[0073] See Figure 2In one embodiment, the multi-scale spectral feature extraction module 301 in the above steps includes multiple parallel convolutional branches and one feature splicing layer. The first convolutional branch is a local detail feature extraction branch, using a 1×3 convolutional kernel; the second convolutional branch is a mesoscale trend feature extraction branch, using a 1×7 convolutional kernel; and the third convolutional branch is a global contour feature extraction branch, using a 1×15 convolutional kernel. The feature splicing layer fuses the output features of the three convolutional branches along the channel dimension to obtain spectral pyramid features.
[0074] In existing technologies, feature extraction often employs a single-scale strategy, which fails to account for both subtle spectral fluctuations caused by diseases (such as the shift of absorption peaks in the 450-550nm blue light band) and macroscopic spectral trend changes (such as the decrease in reflectance in the 680-720nm red light band), resulting in incomplete feature representation. The embodiments of this application employ a multi-scale spectral feature extraction module that extracts spectral features at different scales through a three-level parallel convolutional structure and fuses them into spectral pyramid features, thus solving the problem of incomplete feature representation in existing hyperspectral discrimination models.
[0075] In this embodiment of the application, the input preprocessed hyperspectral data is assumed to be... ( , The spatial height and width of the hyperspectral image, (Number of spectral bands), the local detail feature extraction layer uses a 1×3 convolutional kernel to capture subtle spectral fluctuations caused by the disease, and outputs a local feature map. ( For local convolution kernels, For bias terms, (The number of local feature channels) The mesoscale trend feature extraction layer uses a 1×7 convolutional kernel to learn the overall trend changes of the spectrum and outputs a mesoscale feature map. ( Mesoscale convolution kernel, (As a bias term), the global contour feature extraction layer uses a 1×15 convolution kernel to extract the spectral macroscopic contour and outputs a global feature map. ( For global convolution kernels, (as a bias term), and then fused along the channel dimension through the feature splicing layer. , , Spectral pyramid features were obtained In this embodiment, the feature pyramid has a three-level structure. The "multi-scale spectral feature extraction module" captures spectral features at the "local-mesoscale-global" levels using 1D convolutional kernels of different sizes, ultimately fusing them into a unified spatial dimension, multi-channel pyramid feature. In one implementation, the three-level structure of the feature pyramid consists of a first layer of local detail features, a second layer of mesoscale trend features, and a third layer of global contour features; the first layer is 64×64×32; the second layer is 64×64×32; the third layer is 64×64×32; and the final channel concatenation results in a spectral pyramid feature of 64×64×96.
[0076] See Figure 3 In one embodiment, the adaptive spectral attention mechanism module 302 in step 3 above includes a dynamic weight allocation unit, a prior knowledge embedding unit, and an attention weighted fusion unit. The dynamic weight allocation unit includes a global average pooling layer, a first fully connected layer, a first ReLU function layer, a second fully connected layer, a second ReLU function layer, and a sigmoid activation function layer. The dynamic weight allocation unit uses the channel statistical features of the spectral pyramid features as the first input and the prior knowledge embedding as the second input to obtain the importance weight vector of each band. The attention weighted fusion unit is used to multiply the importance weight vector with the preprocessed hyperspectral data band by band to obtain attention-enhanced spectral features.
[0077] In existing technologies, band redundancy and noise in hyperspectral data are mostly addressed by static band selection, which does not incorporate prior knowledge of sensitive bands for bakanae disease and cannot dynamically adapt to sample characteristics, making it easy for sensitive information to be masked. In this application, an adaptive spectral attention mechanism module is used to obtain attention-enhanced spectral features through dynamic weight allocation, prior knowledge embedding, and attention-weighted fusion, dynamically analyzing the importance weights of each band.
[0078] In this embodiment, the adaptive spectral attention mechanism module includes dynamic weight allocation, prior knowledge embedding, and attention weighted fusion. The dynamic weight allocation uses an attention network composed of two fully connected layers and a sigmoid activation function, based on the channel statistical features of the spectral pyramid. Calculate the importance weight vector using the mean and variance of each band. ,in, This represents the sigmoid function. , Represents the weight parameters of the fully connected layer , This represents the bias parameters of the fully connected layer. Prior knowledge embedding sets the initial weights of the 450-550nm blue light band and the 680-720nm red light band to 0.8-0.9, and the weights of the insensitive band to 0.1-0.2, and incorporates these into the training. Attention-weighted fusion... Attention-enhanced spectral features are obtained by multiplying the preprocessed hyperspectral data band by band. .
[0079] See Figure 4 In one embodiment, the deep feature cross-fusion network module 303 in step 3 above includes:
[0080] A bidirectional feature gating unit is used to generate spatial features based on preprocessed hyperspectral data as the first input and attention-enhanced spectral features as the second input. A gating vector is generated by using a sigmoid activation function, and the fusion ratio of attention-enhanced spectral features and spatial features is dynamically adjusted to generate gated enhanced features.
[0081] The cross-attention enhancement unit is used to map the input features into query vectors, key vectors, and value vectors based on the attention enhancement spectral features as input, through a multi-head cross-attention mechanism. The cross-attention enhancement features are obtained by parallel computation and aggregation by multiple attention heads.
[0082] The hierarchical feature aggregation unit is used to take local detail features and global contour features based on spectral pyramid features as input, and adds the feature maps after dimensionality reduction of local detail features and upsampling of global contour features element by element to obtain hierarchical fusion features;
[0083] The multimodal feature splicing unit is used to splice gated enhancement features, cross-attention enhancement features, and hierarchical fusion features to obtain deep fusion features.
[0084] In this embodiment, the deep feature cross-fusion network module achieves fusion through bidirectional feature gating, cross-attention enhancement, and hierarchical feature aggregation. The bidirectional feature gating first extracts spatial features based on the gray-level co-occurrence matrix. Then generate the gate vector. ,in, , These are the weight parameters and bias parameters of the gating unit, respectively, from which the fused features are obtained. Cross-attention enhancement maps features to query vector Q, key vector K, and value vector V, and computes them through multi-head attention. (Single attention head) ),in, , These are the weight parameters and bias parameters of the multi-head cross-attention mechanism, respectively. It's the number of heads that attract attention. It refers to the dimension of the key vector. Hierarchical feature aggregation is based on a feature pyramid network, which reduces the dimensionality of low-level features and adds them to upsampled high-level features. Finally, splice it together. , , Obtain deep fusion features In this embodiment, a bidirectional feature gating unit is used to fuse spectral features and spatial texture features to address the problem of incomplete representation by a single feature dimension (such as using only spectroscopy). A cross-attention enhancement unit, leveraging a multi-head attention mechanism, captures long-distance dependencies between different features, strengthening semantic associations between features. A hierarchical feature aggregation unit achieves multi-scale fusion of "details + semantics," realizing multi-scale feature complementarity. In this embodiment, the bidirectional feature gating unit, cross-attention enhancement unit, and hierarchical feature aggregation unit comprehensively capture disease features from multiple dimensions such as spectral, spatial, and multi-scale perspectives. Through an intelligent fusion mechanism, feature complementarity and enhancement are achieved, thereby achieving higher accuracy, stronger robustness, and stronger generalization ability in the complex, subtle, and variable rice seedling disease discrimination task. It should be noted that the hierarchical feature aggregation unit in this embodiment reduces the dimensionality of low-level features (i.e., local detail features), eliminates channel redundancy, and removes noise channels unrelated to the disease from low-level features, such as channels corresponding to seed surface impurities, while maintaining the spatial dimension. High-level features (i.e., global contour features) are upsampled to repair spatial resolution loss. Transposed convolutions are then used for "zero-padding + kernel mapping" to optimize spatial correlation, ensuring precise spatial alignment between the "macroscopic trends" of high-level features and the "local details" of low-level features, while maintaining the same spatial dimension. To ensure channel compatibility for subsequent "element-level addition," the number of channels in the upsampled high-level features needs to be adjusted through convolution to match the dimension of the "dimensionality-reduced low-level features."
[0085] See Figure 5 In one embodiment, the dynamic meta-learning classifier module 305 in step 3 above includes a meta-feature extraction unit, a dynamic weight generation unit, a classifier unit, and an adjustable decision threshold unit.
[0086] The meta-feature extraction unit includes two convolutional layers and one fully connected layer, used to extract meta-feature vectors from deep fusion features;
[0087] The dynamic weight generation unit generates classifier weight parameters and bias terms for binary classification tasks in real time through two fully connected layers, taking the meta-feature vector as input.
[0088] The adjustable decision threshold unit generates a classification decision threshold through a linear transformation of the meta-feature vector;
[0089] The seed health status is determined by comparing the class probability output by the classifier with the decision threshold.
[0090] In existing technologies, classifiers are mostly fixed-parameter models (such as SVM and fixed-weight CNN), resulting in rigid discrimination boundaries that are difficult to adapt to the spectral differences of different rice varieties and seeds with different infection levels, leading to weak generalization ability. This application's embodiment employs a dynamic meta-learning classifier module. This classifier extracts sample meta-features through two convolutional layers and one fully connected layer, and then a weight generator generates dedicated classifier weights and bias terms in real time. Simultaneously, an adjustable decision threshold is generated through linear transformation of the meta-features, achieving personalized discrimination with "one classifier per sample." This dynamic decision-making paradigm is completely different from the traditional "one-size-fits-all" fixed-boundary classification method, flexibly adapting to the spectral variations of different rice varieties and seeds with different infection levels, significantly improving the model's discrimination accuracy and generalization ability for complex real-world samples. The dynamic meta-learning classifier module of this application's embodiment solves the core pain point of traditional fixed-parameter classifiers (such as SVM and fixed-weight CNN) having weak generalization ability when facing individual differences in agricultural samples.
[0091] In this embodiment, the dynamic meta-learning classifier module extracts the inherent characteristics of samples through a meta-feature extraction unit, generates dedicated classifier parameters in real time through a dynamic weight generation unit, and determines the classification boundary through an adjustable decision threshold unit, outputting the discrimination result of the seed's health status (bacterial / normal). The dynamic meta-learning classifier module uses two convolutional layers and one fully connected layer to... Extracting meta-feature vectors from flattened features ,in, and These are the weight parameters of the meta-feature extraction unit. and It is the bias parameter of the meta-feature extraction unit. yes Flatten the features, and then generate classifier weights through two fully connected layers. With bias , and by Linear transformation generates decision threshold , and These are the weights and biases of the adjustable decision threshold unit, respectively, through... ( The seed state is determined based on the probability of bacterial carriage, enabling personalized discrimination with "one classifier per sample".
[0092] In one implementation, the uncertainty quantification module 306 in step 3 above is implemented through an uncertainty estimation head that runs in parallel with the dynamic meta-learning classifier module. The uncertainty estimation head consists of a fully connected layer and a sigmoid activation function, takes deep fusion features as input, and outputs a confidence score in the 0-1 interval.
[0093] All existing identification technologies share a common flaw—they only output binary labels of "carrying bacteria" or "normal," without quantifying the reliability of the judgment results. In scenarios such as seed quarantine and seed screening, model misjudgments may lead to disease transmission, and users cannot judge the credibility of the results, making it difficult to formulate verification strategies. The uncertainty quantification module added in this application's embodiment solves the common flaw of all existing identification technologies that only output category labels and cannot assess the reliability of the results, providing risk control assurance for practical applications.
[0094] In this embodiment, the uncertainty quantization module calculates and outputs a 0-1 interval confidence score corresponding to the discrimination result using an uncertainty estimation head composed of a fully connected layer and a sigmoid activation function. The uncertainty quantization module outputs the confidence score. And through the confidence loss function Training ensures that confidence level is correlated with discrimination accuracy, among which, and These are the weights and biases of the uncertainty quantification module, respectively. This represents the true value of seed health status. The model predicts the seed health status.
[0095] In summary, the rice bakanae disease-carrying seed detection method provided in this application overcomes the core pain points of existing hyperspectral discrimination models, such as incomplete feature representation, inefficient band utilization, and rigid classification boundaries, by utilizing a rice bakanae disease-carrying seed discrimination model. This method improves the discrimination accuracy and generalization ability for complex real samples, laying the foundation for accurately assessing the status of rice bakanae disease-carrying seeds and increasing rice yield. It also provides agricultural producers with an accurate means to assess the status of rice bakanae disease-carrying seeds.
[0096] This application also provides a device for detecting rice seedling blight-carrying pathogens based on hyperspectral images, including:
[0097] The seed hyperspectral image acquisition unit is used to acquire hyperspectral data based on hyperspectral images of rice seeds;
[0098] The preprocessing unit is used to preprocess the obtained hyperspectral data to obtain preprocessed hyperspectral data;
[0099] The seed discrimination unit is used to input preprocessed hyperspectral data into the rice seed discrimination model for rice seedling disease to obtain the discrimination results of rice seed health status;
[0100] The rice bakanae disease-carrying seed discrimination model includes, in sequence, a multi-scale spectral feature extraction module, an adaptive spectral attention mechanism module, a deep feature cross-fusion network module, and a discrimination result module.
[0101] The multi-scale spectral feature extraction module is used to extract spectral features at different scales and fuse them into a spectral pyramid feature.
[0102] The adaptive spectral attention mechanism module is used to determine the importance weight vector of each band based on the spectral pyramid features as input, and to obtain attention-enhanced spectral features by weighted fusion of each band of the preprocessed hyperspectral data.
[0103] The deep feature cross-fusion network module is used to perform multimodal feature interaction based on preprocessed hyperspectral data, attention-enhanced spectral features, and spectral pyramid features as input, and output deep fusion features;
[0104] The discrimination result module includes a parallel dynamic meta-learning classifier module and an uncertainty quantization module. The dynamic meta-learning classifier module is used to output the discrimination result of the seed health status, and the uncertainty quantization module is used to output the confidence level of the discrimination result.
[0105] For specific limitations regarding the detection device for rice seedling blight-carrying pathogens based on hyperspectral images, please refer to the limitations of the detection method for rice seedling blight-carrying pathogens based on hyperspectral images mentioned above, which will not be repeated here.
[0106] This application also provides an electronic device, the electronic device comprising:
[0107] processor;
[0108] Memory used to store processor-executable instructions;
[0109] The processor executes the executable instructions to implement the rice seed bakanae disease-carrying detection method as described in the foregoing method embodiments.
[0110] In some embodiments, the electronic device may optionally include an input interface and an output interface. The processor, memory, and input / output interfaces can be connected via a bus or signal lines. Various peripheral devices can be connected to the input / output interfaces via buses, signal lines, or circuit boards. The input / output interfaces can be used to connect at least one input / output-related peripheral device to the processor and memory. In some embodiments, the processor, memory, and input / output interfaces are integrated on the same chip or circuit board; in other embodiments, any one or two of the processor, memory, and input / output interfaces can be implemented on separate chips or circuit boards, and this application does not limit this aspect.
[0111] This application also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the rice bakanae disease-carrying seed detection method as described in the foregoing method embodiments. The computer-readable storage medium includes: electronic storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, and any suitable combination thereof. The computer-readable storage medium includes phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), non-volatile random access memory (NVRAM), etc.
[0112] The following is a specific implementation process to further illustrate the rice seed bakanae disease carrier discrimination model provided in the embodiments of this application.
[0113] S1: 500 plump, uniformly shaped rice seeds infected with rice bakanae disease and 500 normal rice seeds were selected as the experimental sample. The sample was randomly divided into a training set, a validation set, and a test set in a 7:2:1 ratio.
[0114] S2: Image acquisition was performed using a FigSpec FS-20 hyperspectral imaging system with an imaging band range of 400-1000nm and a spatial resolution of 1920×1920 pixels. Acquisition was conducted in a dark room to avoid ambient light interference. To eliminate the effects of dark current, uneven illumination, and sensor noise, the whiteboard and dark current were calibrated using the accompanying software. After calibration, ENVI 5.6 software was used for subsequent processing: (1) a region of interest (ROI) was defined in the central area of each seed; (2) the spectral reflectance of all pixels in each ROI was calculated; (3) the original spectral reflectance of all samples was output. The original data spectrum and average spectrum are shown below. Figure 6 and Figure 7 As shown.
[0115] S3: The acquired hyperspectral data were preprocessed in the following order: (1) AirPLS detrending: The adaptive iterative reweighted penalized least squares algorithm was used to eliminate baseline drift. The parameters were set to 30 iterations, a smoothing window width of 10 spectral points, and a penalty parameter λ=10^5. The processed spectral baseline was flatter, and the effective spectral features were enhanced. (2) SG smoothing: The Savitzky-Golay smoothing algorithm was used to suppress high-frequency noise. The parameters were set to a window width of 7 spectral points and a polynomial order of 2. The signal-to-noise ratio was significantly improved after processing, while maintaining the original shape of the spectral curve. (3) MSC multivariate scattering correction: The average spectrum of all preprocessed hyperspectral data was used as the reference spectrum. The linear regression coefficient between the spectrum of each sample and the reference spectrum was calculated, and the scattering difference between samples was eliminated by linear transformation. The correlation between the spectrum and the seed disease characterization was significantly improved after processing. Figure 8 The spectrum after preprocessing with AirPLS+SG+MSC is shown. It can be seen that the preprocessing effectively eliminates baseline drift, noise and scattering interference, and improves spectral quality.
[0116] S4: Construct a model for identifying rice seedlings infected with Bakanae disease. Its specific structure and parameters are as follows: The multi-scale spectral feature extraction module receives preprocessed hyperspectral data (64×64×120) and extracts features through a three-level parallel convolutional structure. The local detail feature extraction layer uses a 1×3 convolutional kernel to output 32 channels, the mesoscale trend feature extraction layer uses a 1×7 convolutional kernel to output 32 channels, and the global contour feature extraction layer uses a 1×15 convolutional kernel to output 32 channels. The three-level features are spliced together by the channel dimension to form a spectral pyramid feature (64×64×96). The adaptive spectral attention mechanism module calculates the importance weights of each band through a dynamic weight allocation unit. This unit consists of two fully connected layers with 64 and 120 neurons, respectively. It takes the channel statistical features of the spectral pyramid as input, and outputs a 120-dimensional weight vector after sigmoid activation. The prior knowledge embedding unit sets the initial weights of the 450-550nm blue light band and the 680-720nm red light band to 0.85, and the initial weights of the insensitive bands to 0.15, as learnable parameters incorporated into the training. The attention weighted fusion unit multiplies the weight vector with the original hyperspectral data band by band to obtain attention-enhanced spectral features. The deep feature cross-fusion network module achieves feature fusion through three sub-units: a bidirectional feature gating unit extracts 8-dimensional spatial features based on the gray-level co-occurrence matrix and dynamically adjusts the feature fusion ratio by generating a gating vector using sigmoid; a cross-attention enhancement unit adopts a 4-head cross-attention mechanism to map the input features into query, key, and value vectors and calculate the cross-attention enhanced features; and a hierarchical feature aggregation unit, based on a feature pyramid network, reduces the dimensionality of low-level detailed features and adds them to the upsampled high-level semantic features element-wise to obtain hierarchical fusion features. The outputs of the three sub-units are concatenated along the channel dimension to form a 256-dimensional deep fusion feature.
[0117] S5: The dynamic meta-learning classifier module extracts a 128-dimensional meta-feature vector from the deep fusion features through a meta-feature extraction unit, which consists of two convolutional layers and one fully connected layer. The dynamic weight generation unit uses the meta-feature vector as input through two fully connected layers to generate classifier parameters for the binary classification task in real time. The adjustable decision threshold unit generates a classification decision threshold through a linear transformation of the meta-feature vector, and compares the class probability output by the classifier with the threshold to obtain the final discrimination result. The uncertainty quantization module outputs a confidence score through a fully connected layer parallel to the classifier and a sigmoid activation function. During training, a dedicated confidence loss function is used to ensure that the confidence score is correlated with the discrimination accuracy.
[0118] This invention is not limited to the specific embodiments described above. Any modifications made by those skilled in the art based on the above concept without creative effort are within the scope of protection of this invention.
Claims
1. A method for detecting rice bakanae disease-carrying seeds based on hyperspectral images, characterized in that, include: Hyperspectral data was acquired based on hyperspectral images of rice seeds. The obtained hyperspectral data is preprocessed to obtain preprocessed hyperspectral data; The preprocessed hyperspectral data was input into the rice seed health status discrimination model to obtain the discrimination results of rice seed health status. The rice bakanae disease-carrying seed discrimination model includes, in sequence, a multi-scale spectral feature extraction module, an adaptive spectral attention mechanism module, a deep feature cross-fusion network module, and a discrimination result module. The multi-scale spectral feature extraction module is used to extract spectral features at different scales and fuse them into spectral pyramid features; The adaptive spectral attention mechanism module is used to determine the importance weight vector of each band based on the spectral pyramid features as input, and to perform weighted fusion of each band of the preprocessed hyperspectral data to obtain attention-enhanced spectral features. The adaptive spectral attention mechanism module includes a dynamic weight allocation unit, a prior knowledge embedding unit, and an attention weighted fusion unit. The dynamic weight allocation unit includes a global average pooling layer, a first fully connected layer, a first ReLU function layer, a second fully connected layer, a second ReLU function layer, and a sigmoid activation function layer. The dynamic weight allocation unit uses the channel statistical features of the spectral pyramid features as the first input and the prior knowledge embedding as the second input to obtain the importance weight vector of each band. The attention weighted fusion unit multiplies the importance weight vector with the preprocessed hyperspectral data band by band to obtain the attention-enhanced spectral features. The deep feature cross-fusion network module is used to perform multimodal feature interaction based on preprocessed hyperspectral data, attention-enhanced spectral features, and spectral pyramid features as input, and output deep fusion features; The discrimination result module includes a parallel dynamic meta-learning classifier module and an uncertainty quantization module. The dynamic meta-learning classifier module is used to output the discrimination result of the seed health status, and the uncertainty quantization module is used to output the confidence level of the discrimination result.
2. The method for detecting rice seedling blight-carrying pathogens based on hyperspectral images according to claim 1, characterized in that, The preprocessing includes: The obtained hyperspectral data were sequentially processed using AirPLS detrending, SG smoothing, and MSC multivariate scattering correction to obtain preprocessed hyperspectral data.
3. The method for detecting rice seedling blight-carrying pathogens based on hyperspectral images according to claim 1, characterized in that, The multi-scale spectral feature extraction module includes multiple parallel convolutional branches and one feature concatenation layer. The first convolutional branch is a local detail feature extraction branch, using a 1×3 convolutional kernel; the second convolutional branch is a mesoscale trend feature extraction branch, using a 1×7 convolutional kernel; and the third convolutional branch is a global contour feature extraction branch, using a 1×15 convolutional kernel. The feature concatenation layer fuses the output features of the three convolutional branches along the channel dimension to obtain the spectral pyramid features.
4. The method for detecting rice seedling blight-carrying pathogens based on hyperspectral images according to claim 1, characterized in that, The deep feature cross-fusion network module includes: A bidirectional feature gating unit is used to generate spatial features based on preprocessed hyperspectral data as the first input and attention-enhanced spectral features as the second input. A gating vector is generated through a sigmoid activation function, and the fusion ratio of attention-enhanced spectral features and spatial features is dynamically adjusted to generate gated enhanced features. The cross-attention enhancement unit is used to map the input features into query vectors, key vectors, and value vectors based on the attention enhancement spectral features as input, through a multi-head cross-attention mechanism. The cross-attention enhancement features are obtained by parallel computation and aggregation by multiple attention heads. The hierarchical feature aggregation unit is used to take local detail features and global contour features based on spectral pyramid features as input, and adds the feature maps after dimensionality reduction of local detail features and upsampling of global contour features element by element to obtain hierarchical fusion features; The multimodal feature splicing unit is used to splice gated enhancement features, cross-attention enhancement features, and hierarchical fusion features to obtain deep fusion features.
5. The method for detecting rice bakanae disease-carrying seeds based on hyperspectral images according to claim 1, characterized in that, The dynamic meta-learning classifier module includes a meta-feature extraction unit, a dynamic weight generation unit, a classifier unit, and an adjustable decision threshold unit. The meta-feature extraction unit includes two convolutional layers and one fully connected layer, used to extract meta-feature vectors from deep fusion features; The dynamic weight generation unit generates classifier weight parameters and bias terms for binary classification tasks in real time through two fully connected layers, taking the meta-feature vector as input. The adjustable decision threshold unit generates a classification decision threshold through a linear transformation of the meta-feature vector; The seed health status is determined by comparing the class probability output by the classifier with the decision threshold.
6. The method for detecting rice bakanae disease-carrying seeds based on hyperspectral images according to claim 1, characterized in that, The uncertainty quantification module is implemented through an uncertainty estimation head that runs in parallel with the dynamic meta-learning classifier module. The uncertainty estimation head consists of a fully connected layer and a sigmoid activation function, taking deep fusion features as input and outputting a confidence score in the 0-1 range.
7. A device for detecting rice seedling blight-carrying pathogens based on hyperspectral imaging, characterized in that, include: The seed hyperspectral image acquisition unit is used to acquire hyperspectral data based on hyperspectral images of rice seeds; The preprocessing unit is used to preprocess the obtained hyperspectral data to obtain preprocessed hyperspectral data; The seed discrimination unit is used to input preprocessed hyperspectral data into the rice seed discrimination model for rice seedling disease to obtain the discrimination results of rice seed health status; The rice bakanae disease-carrying seed discrimination model includes, in sequence, a multi-scale spectral feature extraction module, an adaptive spectral attention mechanism module, a deep feature cross-fusion network module, and a discrimination result module. The multi-scale spectral feature extraction module is used to extract spectral features at different scales and fuse them into spectral pyramid features; The adaptive spectral attention mechanism module is used to determine the importance weight vector of each band based on the spectral pyramid features as input, and to obtain attention-enhanced spectral features by weighted fusion of each band of the preprocessed hyperspectral data. The adaptive spectral attention mechanism module includes a dynamic weight allocation unit, a prior knowledge embedding unit, and an attention weighted fusion unit. The dynamic weight allocation unit includes a global average pooling layer, a first fully connected layer, a first ReLU function layer, a second fully connected layer, a second ReLU function layer, and a sigmoid activation function layer. The dynamic weight allocation unit uses the channel statistical features of the spectral pyramid features as the first input and the prior knowledge embedding as the second input to obtain the importance weight vector of each band. The attention weighted fusion unit multiplies the importance weight vector with the preprocessed hyperspectral data band by band to obtain the attention-enhanced spectral features. The deep feature cross-fusion network module is used to perform multimodal feature interaction based on preprocessed hyperspectral data, attention-enhanced spectral features, and spectral pyramid features as input, and output deep fusion features; The discrimination result module includes a parallel dynamic meta-learning classifier module and an uncertainty quantization module. The dynamic meta-learning classifier module is used to output the discrimination result of the seed health status, and the uncertainty quantization module is used to output the confidence level of the discrimination result.
8. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store processor-executable instructions; The processor implements the method as described in any one of claims 1-6 by executing the executable instructions.
9. A computer-readable storage medium storing computer instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Forestry pest and disease damage intelligent monitoring system and method based on unmanned aerial vehicle inspection
CN120635759A
Image recognition method and system based on multi-modal data fusion
CN120726378A