A rice quality evaluation method and system based on spectral data analysis
By employing model-independent meta-learning and multi-scale feature fusion techniques, the problems of varietal differences and environmental interference in rice quality assessment are solved, achieving high-precision, stable, and real-time detection suitable for industrial applications.
Patent Information
- Application Number
- CN202510906364.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2045-07-02
AI Technical Summary
Existing methods for assessing rice quality rely on chemical testing, which is destructive and time-consuming. Traditional spectral analysis is difficult to adapt to differences in different varieties, is susceptible to environmental influences, and carries the risk of missed detections, thus limiting its industrialization and real-time testing applications.
We employ a model-independent meta-learning framework for adaptive feature selection, combining multi-scale decomposition and fusion techniques, and introducing reverse verification and dynamic calibration mechanisms. We generate feature weights through iterative training using the Adam optimizer, and utilize multi-scale feature weighted fusion to calibrate model parameters in real time.
It achieves high-precision and stability assessment of different rice varieties, reduces sample size requirements and manual intervention, adapts to environmental changes, and improves the real-time performance and accuracy of detection.
Smart Images

Figure CN120408121B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of spectral data measurement and analysis technology, and in particular to a method and system for rice quality assessment based on spectral data analysis. Background Technology
[0002] Existing methods for assessing rice quality mainly employ chemical testing and traditional spectroscopic analysis. Chemical testing requires destructive sampling and is time-consuming, while traditional spectroscopic analysis often relies on fixed feature selection methods, which are difficult to adapt to the spectral differences of different rice varieties. Furthermore, it is susceptible to changes in environmental temperature and humidity and equipment aging, requiring frequent manual calibration. Additionally, there is a risk of missing detections when detecting local quality anomalies. These problems limit the application of rice quality assessment in industrialization and real-time monitoring. Summary of the Invention
[0003] In view of the aforementioned existing problems, the present invention is proposed.
[0004] Therefore, this invention provides a rice quality assessment method based on spectral data analysis. It achieves adaptive feature selection of spectral data of rice varieties through a model-independent meta-learning framework, and extracts micro, meso and macro features respectively using multi-scale decomposition and fusion technology. At the same time, it introduces a reverse verification and dynamic calibration mechanism to perform closed-loop correction of model parameters based on real-time feedback. This solves the problems of large feature differences between different rice varieties, high sample size requirements, and detection instability caused by environmental interference and equipment drift.
[0005] To address the aforementioned technical problems, this invention provides the following technical solution: a method for assessing rice quality based on spectral data analysis, comprising:
[0006] The raw spectral data of rice varieties were preprocessed by adaptive normalization and multi-level filtering, and the preprocessed data were randomly divided into support set and query set.
[0007] A model-independent meta-learning framework is adopted on the support set, which combines an adaptive detection window and a reinforcement learning controller. The feature weight vector of the target variety is generated through iterative training by the Adam optimizer.
[0008] The preprocessed data is decomposed into multiple scales to extract local peak features at the microscale, sub-band features at the mesoscale, and full-band features at the macroscale.
[0009] The features at each scale are weighted and fused using a bottom-up approach, and a reverse verification mechanism is used to detect and correct the deviations between the outputs of features at each scale.
[0010] Rice quality assessment decisions are generated based on fused features, and the parameters of the decision model are dynamically calibrated using real-time feedback data.
[0011] As a preferred embodiment of the rice quality assessment method based on spectral data analysis described in this invention, the data in the support set is used for training the meta-learning model. During the training process, the parameters are updated using the Adam optimizer and reinforcement learning controller, and the generalization ability of the model is verified on the query set.
[0012] As a preferred embodiment of the rice quality assessment method based on spectral data analysis described in this invention, the macroscopic scale is the full-band 400nm-2500nm; the mesoscopic scale is the near-infrared sub-band 900nm-1700nm; and the microscopic scale is the local characteristic peak band.
[0013] As a preferred embodiment of the rice quality assessment method based on spectral data analysis described in this invention, the multi-scale decomposition includes: the extraction of local peak features at the microscale using a one-dimensional convolutional neural network, with a fixed convolutional kernel size and stride set in each layer, batch normalization and activation functions introduced between layers, and residual connections used to preserve signal details, while a dynamic pooling layer is designed to achieve adaptive signal convergence based on local statistical characteristics.
[0014] As a preferred embodiment of the rice quality assessment method based on spectral data analysis described in this invention, the multi-scale decomposition further includes a dual-channel attention fusion module for fusing mesoscale sub-band features. This module includes one branch that uses a multi-head attention mechanism to calculate static weights, and another branch that uses a graph convolutional network to construct an adjacency matrix between sub-bands to generate dynamic attention weights. The two are then weighted and integrated using a consensus algorithm to generate a weighted feature vector.
[0015] The fusion of macroscopic full-band features adopts a multi-layer long short-term memory network, which is equipped with an adaptive time step adjustment mechanism and a local window attention module. After combining residual connections and skip connections, it is integrated into a macroscopic feature representation through a fully connected layer.
[0016] As a preferred embodiment of the rice quality assessment method based on spectral data analysis described in this invention, the reverse verification mechanism includes: calculating the mutual information, cross-correlation, and dynamic time warping distance between feature outputs at each scale to determine the deviation between macroscopic layer decision-making and mesoscopic layer prediction; when the deviation is detected to exceed a preset standard, a time-domain reverse verification strategy, a frequency-domain reverse verification strategy, or a dual-path re-extraction strategy is selected for closed-loop correction based on the nature of the deviation.
[0017] As a preferred embodiment of the rice quality assessment method based on spectral data analysis described in this invention, the generation of rice quality assessment decisions includes: using fused multi-scale features as input, generating rice quality assessment decisions through a decision module; the decisions are based on pre-set quality judgment rules, and the decision model parameters are dynamically calibrated through real-time feedback data.
[0018] As a preferred embodiment of the rice quality assessment system based on spectral data analysis according to the present invention, it includes: a data acquisition unit, an algorithm module, and a decision unit; the data acquisition unit is used to acquire and transmit data information; the algorithm module is used to run the algorithm; and the decision unit is used to generate decisions and perform dynamic calibration.
[0019] A computer device includes a memory and a processor, the memory storing a computer program, characterized in that the processor executes the computer program to implement the steps of a rice quality assessment method based on spectral data analysis.
[0020] A computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of a rice quality assessment method based on spectral data analysis.
[0021] The beneficial effects of this invention are as follows: By introducing model-independent meta-learning and multi-scale feature fusion techniques, and employing reinforcement learning control and a dual-channel attention mechanism, this invention achieves adaptive feature selection and closed-loop correction for spectral data of rice varieties, thereby overcoming the limitations of traditional methods in terms of sample dependence, environmental adaptation, and local anomaly detection. The technical solution adopts innovative designs in all stages of data preprocessing, feature extraction, feature fusion, and decision calibration, integrating time-domain and frequency-domain information, and achieving dynamic correction of multi-scale feature output consistency through self-supervised iterative optimization. This significantly improves the accuracy and stability of rice quality assessment and reduces the need for a large number of samples and frequent manual intervention, providing a creative and efficient solution for industrial and real-time detection applications. Attached Figure Description
[0022] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a schematic diagram of a rice quality assessment method based on spectral data analysis, provided as an embodiment of the present invention. Detailed Implementation
[0024] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0025] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0026] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0027] This invention is described in detail with reference to the schematic diagrams. When detailing the embodiments of this invention, for ease of explanation, the cross-sectional views illustrating the device structure may be partially enlarged, not adhering to the usual scale. Furthermore, the schematic diagrams are merely examples and should not be construed as limiting the scope of protection of this invention. In actual fabrication, the three-dimensional spatial dimensions of length, width, and depth should be included.
[0028] Furthermore, in the description of this invention, it should be noted that the terms "upper," "lower," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are used solely for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. In addition, the terms "first," "second," or "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0029] Unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" in this invention should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; similarly, they can refer to mechanical connections, electrical connections, or direct connections, or indirect connections through an intermediate medium, or internal connections between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0030] Example 1, referring to Figure 1This is the first embodiment of the present invention, which provides a method for assessing rice quality based on spectral data analysis, including:
[0031] S1: Adaptive normalization and multi-level filtering preprocessing are performed on the raw spectral data of rice varieties, and the preprocessed data is randomly divided into support set and query set.
[0032] Spectral data of rice varieties were standardized using minimum and maximum values as benchmarks to map the raw data to a uniform numerical range, eliminating differences caused by different measurement scales. After standardization, the data was divided into two parts using a pseudo-random number generator: approximately 70% of the data formed the support set for model training, and the remaining 30% formed the query set for subsequent validation. The meta-learning model was trained using a model-independent meta-learning method based on gradient descent. In the initial training phase, the model parameters were initialized randomly, and the initial parameter states were recorded. In each training iteration, the Adam optimization algorithm was used to update the model parameters, enabling the model to optimize parameters with appropriate step sizes when facing spectral data of different rice varieties. During training, multiple rounds of iterative training were performed using data from the support set, recording the training loss and parameter changes. After training, data from the query set was input into the trained model, and the model's performance on unseen samples was verified by calculating the loss metric on the query set.
[0033] S2: A model-independent meta-learning framework is adopted on the support set, which combines an adaptive detection window and a reinforcement learning controller. The feature weight vector of the target variety is generated through iterative training by the Adam optimizer.
[0034] The Adam optimization algorithm includes calculating the gradients of each parameter from the training samples in the support set, performing an exponentially weighted average of the gradients of each parameter using a preset decay factor to form a first-moment estimate of the gradient, which is used to record the average direction of the gradient. Simultaneously, an exponentially weighted average of the squared values of the gradients of each parameter is performed to form a second-moment estimate to reflect the volatility of the gradient. In the initial iteration phase, the first-moment and second-moment estimates are corrected for deviations to compensate for the initial low estimates. Each parameter is updated based on a preset learning rate and the corrected first and second moments. During the update process, the square root of the corrected second moment plus a small constant is used as the denominator to avoid division by zero. Furthermore, the decay factor and learning rate of the exponentially weighted average are adjusted in real time according to changes in the spectral data distribution. This adjustment is performed during the multi-round iterative training of the meta-learning. Each training round first uses the support set data to calculate the gradient and update the parameters, and then uses the query set data to verify the parameter update rules, thereby dynamically adjusting the hyperparameter settings.
[0035] S3: Perform multi-scale decomposition on the preprocessed data to extract local peak features at the microscale, sub-band features at the mesoscale, and full-band features at the macroscale.
[0036] S4: The features at each scale are weighted and fused using a bottom-up approach, and the deviation between the outputs of each scale is detected and corrected through a reverse verification mechanism.
[0037] Feature extraction of local peaks at the microscale is achieved through a one-dimensional convolutional neural network. This network consists of multiple convolutional layers, each processed by convolutional kernels of different sizes and strides. Each convolutional kernel senses local regions of the spectral data, extracting high-frequency and low-frequency information from the spectral signal and capturing the features of local peaks. Simultaneously, batch normalization layers and activation functions (such as ReLU) are introduced between the convolutional layers, combined with residual connection structures, to ensure that detailed information in the input signal is passed through the network layers. Furthermore, a dynamic pooling layer is added internally. This pooling layer adaptively aggregates the signal based on the statistical properties of each local region, extracting the intensity, half-width, and symmetry parameters of local peaks. The pooling layer dynamically adjusts based on changes in local signal regions and incorporates attention mechanisms, automatic weighting, and selection of important feature maps. Weighted fusion is applied to the feature maps output by the convolutional layers, enabling the network to automatically focus on key peak features during training. Finally, the backpropagation algorithm is used in conjunction with the Adam optimizer to train the entire network and optimize each convolution kernel and parameter to ensure that the feature map output by the network can fully and accurately represent the salient features of the local signal. The output of the salient features provides a clear numerical basis for the existence of multi-scale feature fusion.
[0038] Specifically, feature extraction of local peaks at the microscale employs a one-dimensional convolutional neural network. This network consists of multiple convolutional layers, each using a specific kernel size and stride to process local regions of the normalized spectral data, thereby separating high-frequency and low-frequency information within the local region. Batch normalization and activation function modules are placed between each convolutional layer to ensure the stability of the training process, while residual connections are used to preserve the detailed information of the input signal. Dynamic pooling layers are designed in the network to achieve adaptive signal convergence based on local statistical characteristics, thereby extracting the intensity, half-width, and symmetry parameters of local peaks. In addition, an attention mechanism is embedded in the network to weight the feature maps output by each layer, and backpropagation and the Adam optimizer are combined to finely adjust the network parameters, so that the output multi-channel feature maps accurately describe the local signal features in numerical form, providing a quantitative basis for multi-scale feature fusion.
[0039] In the fusion of mesoscale sub-band features, the pre-separated sub-band spectral data are first processed by a feature extraction network to obtain corresponding feature vectors. These feature vectors are then input into a newly designed dual-channel attention fusion module, which consists of two parallel branches: one branch uses a multi-head attention mechanism to calculate the similarity between the sub-band feature vectors and the target chemical composition description vectors, generating static attention weights; the other branch uses a graph convolutional network to construct an adjacency matrix between sub-bands, propagating and fusing information from the feature vectors to generate dynamically adjusted attention weights. Simultaneously, a consensus algorithm is used to weighted integrate the attention weights output from the dual channels, and the feature vectors of each sub-band are weighted and summed to form a comprehensive weighted feature representation. A feedback mechanism is introduced to compare the fused predicted values with previous predictions, performing self-supervised iterative adjustments to generate predicted values for the proportion of chemical components. This achieves deep fusion of sub-band feature information and real-time dynamic correction and optimization of the contribution of each sub-band to describing the target chemical composition.
[0040] In the process of fusing macroscopic full-band features, full-band spectral data is collected at preset time intervals to form continuous time-series data. Noise and outliers are removed through adaptive normalization and multi-level filtering preprocessing. The preprocessed data is input into a deep network composed of multiple long short-term memory (LSM) layers. Each LSM layer is equipped with an adaptive time step adjustment mechanism to dynamically adjust the hidden state update frequency according to changes in the input data. An improved gating structure is used to enhance the transmission of state information. The outputs of each layer are processed by a local window attention module to capture local temporal dependencies. The local attention outputs are then fused with the original LSM features through residual connections and skip connections to form a multi-level feature representation. The fused features are further weighted and integrated by fully connected layers, and after batch normalization and activation mapping, macroscopic-scale feature representations for decision-making are generated. In addition, the fusion process dynamically adjusts the time step and local window size, combined with a global feature integration strategy and an iterative correction feedback mechanism, and uses the latest acquired time-series data to update the model's adaptive parameters in real time, realizing structured modeling of the time-varying trend of full-band spectral data.
[0041] The hierarchical fusion includes: in the micro-scale feature extraction part, a dynamic adaptive detection window is used, the size of which is determined by the statistical variance of the local spectral signal. The window width is adjusted in real time through a reinforcement learning controller, and multi-channel cross-correlation analysis is introduced within the same processing branch to capture the interdependencies between different bands; in the meso-scale feature extraction part, a dual attention mechanism is introduced to weight the signal amplitudes in predefined sub-bands and calculate the cross-attention scores between adjacent sub-bands to obtain the relative information between each sub-band; in the macro-scale feature extraction part, a hybrid structure is constructed, consisting of a long short-term memory network and a Transformer encoder layer, for... Simultaneously, the system models the long-term dependence and subtle temporal variations of the full-band data. The fusion stage employs a bottom-up iterative integration method, fusing micro, meso, and macro features after independent weighting. A consistency verification module is introduced to perform cross-correlation analysis on the fused output and the outputs of each layer to detect inconsistencies. When the detection result exceeds a preset threshold, the system initiates a dual-path re-extraction mechanism. One path re-extracts the micro feature by adjusting the detection window function and adding frequency domain filter parameters, while the other path reprocesses the meso feature by modifying the attention parameter configuration. Subsequently, a consensus algorithm is used to fuse the dual-path outputs through majority voting, forming the final fused feature representation.
[0042] The reverse verification mechanism dynamically adjusts the verification strategy by monitoring the differences between macro-level decisions and meso-level predictions.
[0043] In this invention, the reverse verification mechanism is used to correct the deviation between the macroscopic layer decision and the mesoscopic layer prediction output. After the system calculates the mutual information index, cross-correlation value, and dynamic time warping distance respectively, if any index fails to meet the preset standard and the local peak detection error exceeds twice the statistical standard deviation of the support set or the sub-band prediction deviation exceeds a predetermined percentage, it is determined that the deviation is large. In this case, the system adopts a time-domain reverse verification strategy, which automatically adjusts the detection window size and modifies the filter bandwidth by analyzing the statistical variance of the local spectral signal, and re-extracts the local peak features using an adaptive filtering algorithm. At the same time, for signals that exhibit abnormal spectral characteristics after Fourier transform, the system adopts a frequency-domain reverse verification strategy, which dynamically adjusts the frequency-domain filtering parameters to reconstruct the frequency-domain features. When frequency domain metrics show significant deviations, and the detection results continuously deviate from the preset standard during continuous iterations, with a significant increase in signal-noise levels and unstable detection results, the system identifies this as an extreme or complex situation. In this case, a dual-path re-extraction mechanism is activated. One path adjusts the detection window and filter parameters in the time domain, while the other path dynamically adjusts the filter parameters in the frequency domain. A consensus algorithm is used to weightedly fuse the features output by the two paths to form corrected microscale features. Simultaneously, the system activates a reinforcement learning-based parameter controller to compare the current detection results with historical data, optimize the re-extraction parameters in real time, and perform a secondary consistency check to verify the re-extraction results. This achieves dynamic correction of multi-scale output consistency, forming a closed-loop feedback mechanism.
[0044] Furthermore, a significant deviation refers to a situation where the output difference between macro-level decision-making and meso-level prediction exceeds the system's preset statistical threshold. This manifests as any one or more indicators being lower or higher than the system's set reference standard when using mutual information, cross-correlation, and dynamic time warping distance for calculation. For example, if the local peak feature detection error exceeds twice the statistical standard deviation of the support set data, or if the deviation between sub-band prediction and actual measurement exceeds a predetermined percentage, the system determines that the deviation is significant. Extreme or complex situations refer to the simultaneous occurrence of abnormal deviations at multiple scales, and these deviations persist in continuous iterative verification. Specifically, both time-domain and frequency-domain indicators deviate significantly from expectations, accompanied by a significant increase in signal noise levels or unstable detection results. In addition, they may be affected by equipment instability, environmental changes, or abnormal characteristics of rice varieties. In this case, the system activates a dual-path re-extraction mechanism and a reinforcement learning controller to deeply update the re-extraction parameters, ensuring the restoration of consistency in multi-scale feature output through dual-path parameter adjustment and consensus algorithms.
[0045] S5: Generate rice quality assessment decisions based on fused features, and dynamically calibrate the decision model parameters using real-time feedback data.
[0046] In the dynamic calibration process based on real-time feedback data, the system adopts an adaptive sliding window mechanism, dynamically adjusting the window length according to the statistical distribution of the feedback data, and collecting feedback data including manually detected values and sensor measurements. Within each window, mean squared error is used as the basic loss function, and a robust error calculation method is combined to quantify the difference between the predicted and true values. At the same time, an outlier detection algorithm is used to remove outliers to ensure accurate error calculation. Meanwhile, the gradient of the current loss function with respect to the model parameters is calculated using the momentum stochastic gradient descent method. Combined with the momentum saved in the previous update, the parameters are adjusted by preset learning rate and momentum coefficient. A secondary parameter adjustment mechanism based on Bayesian optimization is introduced, using historical feedback data to search for and optimize the learning rate and momentum coefficient in real time within a local range.
[0047] Furthermore, hierarchical fusion preprocesses and fuses microscale local peak features, mesoscale sub-band features, and macroscale full-band features to form a unified feature representation. This representation serves as input to the quality assessment decision module. Simultaneously, based on the comparison results of various indicators of the fused features with preset thresholds, the system automatically matches corresponding decision strategies. When all fused features are within the predetermined standard range, the system adopts the standard decision strategy and generates preliminary quality assessment results according to predetermined grading rules. When a difference exceeding the preset range is detected between the sub-band prediction and the full-band time-series features, the system activates an emergency decision strategy, re-analyzes the preliminary results using feedback data, and recalculates the quality score in conjunction with real-time dynamic calibration data. When the fused features continuously show abnormalities over multiple consecutive assessment periods, the system switches to a high-sensitivity mode, assigns higher weight to subtle feature fluctuations, and initiates additional analysis processes to adjust decision parameters in real time. Finally, the decision module, through preset rules, dynamic feedback, and iterative optimization mechanisms, comprehensively generates a comprehensive quality assessment result, including quality grading and numerical scoring.
[0048] Example 2 is the second embodiment of the present invention, which provides a method for rice quality assessment based on spectral data analysis. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through experiments.
[0049] Fifty samples each of three rice varieties—Indica, Japonica, and Thai fragrant rice—were selected, totaling 150 samples. Near-infrared spectroscopy was used to collect reflectance spectral data for each sample, with a wavelength range of 400 nm to 2500 nm and a spectral resolution of 5 nm, obtaining continuous spectral curves for each sample within the specified wavelength band. The protein content, moisture content, and other physicochemical indicators of each sample were tested according to standard laboratory methods. The samples were then labeled according to set thresholds, categorized into high-quality, medium-quality, and low-quality groups, serving as real labels for model training and evaluation.
[0050] The collected raw spectral data are standardized and denoised. Normalization employs a min-max normalization method, linearly mapping the spectral values of different samples to the [0,1] interval, eliminating amplitude shifts caused by sample differences. To improve signal smoothness and suppress local noise fluctuations, a multi-stage filtering method is used for spectral curve denoising. In this embodiment, the Savitzky-Golay smoothing filter (SG filter) is selected as an example. This method uses local polynomial regression to smoothly fit the spectral signal within a sliding window, removing high-frequency noise while preserving the overall trend of spectral variation. It should be noted that the filtering process described in this invention is not limited to a specific filtering algorithm; Gaussian filtering, wavelet transform filtering, or other existing signal denoising methods can also be used.
[0051] The preprocessed spectral dataset was randomly divided into a support set (105 sets) and a query set (45 sets), used for training and validation of the meta-learning model, respectively. A Model-Agnostic Meta-Learning (MAML) framework was constructed on the support set, employing an inner and outer loop training mechanism based on gradient descent, and using the Adaptive Moment Estimation (Adam) optimizer for iterative model parameter updates. Simultaneously, a reinforcement learning controller was used to dynamically adjust the learning rate and detection window size to adapt to the spectral distribution characteristics of different rice varieties, ultimately generating feature weight vectors for specific target varieties.
[0052] Based on the multi-scale decomposition structure proposed in this invention, feature extraction is performed on the preprocessed spectral data. At the microscale, a one-dimensional convolutional neural network (1D-CNN) is used to extract local peak features. The network structure consists of three convolutional layers with kernel sizes of 5, 7, and 9, employing the ReLU activation function. Batch normalization and residual connection modules are configured between layers to enhance feature transfer capability. To enhance the network's ability to perceive local spectral changes, a dynamic pooling layer is introduced, dynamically adjusting the pooling window size based on local statistical features to extract parameters such as peak intensity, full width at half maximum (FWHM), and symmetry from the spectral signal.
[0053] The near-infrared sub-band signals from 900nm to 1700nm are processed at the mesoscale, and sub-band features are extracted through a dual-channel attention fusion module. This module contains two parallel channels: the first channel uses a multi-head attention mechanism to calculate the static attention weights of each sub-band to the target component; the second channel establishes an adjacency matrix between sub-bands through a graph convolutional network (GCN) and performs dynamic attention weighting. The fusion module uses a consensus algorithm to integrate the attention vectors output from the two channels, weighting and aggregating the sub-band features to form a mesoscale feature representation.
[0054] This approach processes full-band (400nm to 2500nm) spectral data at a macroscopic scale. A Long Short-Term Memory (LSTM) network is employed to model the sequential features of spectral variations with wavelength. The LSTM structure incorporates an adaptive time step mechanism to enhance its ability to perceive trends across the entire band, while a local window attention module is introduced to extract temporally dependent features. The outputs of each layer are fused through residual and skip connections, and then integrated through a fully connected layer to generate a macroscopic feature representation vector.
[0055] Features from three scales are weighted and fused in a bottom-up manner, with a reverse verification mechanism introduced during the fusion process to evaluate the consistency between the outputs at each scale. Specifically, the mutual information, cross-correlation coefficient, and dynamic time warping (DTW) between the micro, meso, and macro outputs are calculated. If any of these indicators falls below a system-set threshold, a closed-loop correction mechanism is triggered. In this embodiment, the system initiates a time-domain reverse verification strategy, resetting the detection window and adjusting the filtering parameters for the micro-scale features, re-extracting features, and combining them with the original features for dual-path fusion to generate a corrected fused representation.
[0056] The fusion feature input quality assessment decision module outputs a three-class classification through a fully connected layer, corresponding to high-quality, medium-quality, and low-quality categories. To improve model usability, dynamic calibration is performed using real detection feedback data from the query set. Within the feedback window, mean squared error and a robust loss function are used to evaluate the deviation between the predicted results and the actual values, and stochastic gradient descent with momentum is employed for parameter optimization. Simultaneously, a Bayesian optimization strategy is introduced to automatically adjust the learning rate and momentum coefficient, further enhancing the model's adaptive performance.
[0057] In query set testing, the method of this invention achieved an overall classification accuracy of 92.7%, with a high-quality sample recognition rate of 95.3%, medium-quality 91.5%, and low-quality 91.2%. Compared with traditional methods such as classification methods composed of Principal Component Analysis (PCA) combined with Support Vector Machine (SVM) (accuracy of approximately 81.6%), the method of this invention has significant advantages in terms of multi-variety adaptability, feature extraction accuracy, and system robustness.
[0058] Example 3, the third embodiment of the present invention, provides a rice quality assessment system based on spectral data analysis, including a data acquisition unit, an algorithm module, and a decision unit.
[0059] The data acquisition unit is used to collect and transmit data information; the algorithm module is used to run the algorithm; and the decision-making unit is used to generate decisions and perform dynamic calibration.
[0060] Example 4, the fourth embodiment of the present invention, differs from the previous three embodiments in that:
[0061] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0062] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0063] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0064] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0065] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0066] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for rice quality evaluation based on spectral data analysis, characterized in that: The application relates to a rice quality evaluation method based on multi-scale feature fusion and dynamic calibration. The original spectral data of rice varieties are adaptively normalized and preprocessed by multi-stage filtering, and the preprocessed data is randomly divided into a support set and a query set; In the support set, a model-independent meta-learning framework is adopted, an adaptive detection window and a reinforcement learning controller are combined, and the feature weight vector of the target variety is generated through iterative training of an Adam optimizer; The preprocessed data is decomposed in multiple scales to extract local peak features in a micro scale, sub-band features in a meso scale and full-band features in a macro scale; The features in different scales are weighted and fused in a bottom-up manner, and the deviation between the outputs of the features in different scales is detected and corrected through a reverse verification mechanism; Based on the fused features, a rice quality evaluation decision is generated, and the parameters of the decision model are dynamically calibrated using real-time feedback data. The macro scale is a full band of 400nm-2500nm, the meso scale is a near-infrared sub-band of 900nm-1700nm, and the micro scale is a local feature peak band. The multi-scale decomposition includes that a one-dimensional convolutional neural network is adopted to extract the local peak features in the micro scale, fixed convolution kernel sizes and steps are set in each layer, batch normalization and an activation function are introduced between layers, a residual connection is used to keep signal details, and a dynamic pooling layer is designed to realize adaptive signal convergence according to local statistical characteristics; The multi-scale decomposition further includes that a double-channel attention fusion module is adopted to fuse the sub-band features in the meso scale, one branch uses a multi-head attention mechanism to calculate static weights, another branch uses a graph convolution network to construct an adjacency matrix between sub-bands to generate dynamic attention weights, and the two are weighted and integrated through a consensus algorithm to generate a weighted feature vector; The fusion of the full-band features in the macro scale adopts a multi-layer long short-term memory network which is configured with an adaptive time step adjustment mechanism and a local window attention module, and after residual connection and jump connection, the network is integrated into a macro feature representation through a full connection layer.
2. A method for rice quality evaluation based on spectral data analysis as claimed in claim 1, wherein: The data of the support set is used for meta-learning model training, and the parameters are updated by using an Adam optimizer and a reinforcement learning controller during the training process, and the generalization ability of the model is verified on the query set.
3. A method for rice quality evaluation based on spectral data analysis as claimed in claim 2, wherein: The reverse verification mechanism includes calculating the mutual information, cross correlation and dynamic time warping distance between the outputs of the features in different scales to determine the deviation between the macro layer decision and the meso layer prediction; When the detected deviation exceeds a preset standard, a time domain reverse verification strategy, a frequency domain reverse verification strategy or a double-path re-extraction strategy is selected according to the nature of the deviation for closed-loop correction.
4. A method for rice quality evaluation based on spectral data analysis as claimed in claim 3 wherein: The generation of the rice quality evaluation decision includes that the fused multi-scale features are input into a decision module to generate a rice quality evaluation decision, the decision is based on a pre-set quality judgment rule, and the parameters of the decision model are dynamically calibrated through real-time feedback data.
5. A system for rice quality evaluation using spectral data analysis according to any one of claims 1 to 4, characterized in that: The application relates to a rice quality evaluation method based on multi-scale feature fusion and dynamic calibration. The data acquisition unit is used for acquiring and transmitting data information; The algorithm module is used for loading algorithm operation; The decision unit is used for generating decisions and performing dynamic calibration. 6.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-5 when the computer program is executed by the processor. The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 4.
7. A computer readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 4.
Citation Information
Patent Citations
Rice identification and detection method based on convolutional neural network
CN116519661A
Deep learning model-based imperfect soybean hyperspectral imaging classification method
CN120219792A