Rice quality evaluation method and system based on spectral data analysis
Through model-independent meta-learning and multi-scale decomposition technology, the problem of sample dependence and environmental interference in rice quality assessment is solved, and high-precision and stable rice quality assessment is achieved, which is suitable for industrialization and real-time detection of different rice varieties.
Patent Information
- Application Number
- CN202510906364.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-02
AI Technical Summary
The existing rice quality evaluation methods have problems such as strong sample dependence, large environmental interference, unstable equipment drift and local abnormality detection, which is difficult to adapt to the spectral differences of different rice varieties, and traditional methods take a long time and require frequent calibration.
The model-independent learning framework is adopted to combine multi-scale decomposition and fusion technology, and the model parameters are dynamically calibrated through adaptive feature selection and reverse calibration mechanism to realize adaptive feature extraction and stable detection of spectral data of rice varieties.
It improves the accuracy and stability of rice quality assessment, reduces the need for large numbers of samples and manual intervention, adapts to the spectral differences of different rice varieties, and realizes an efficient solution for industrialization and real-time detection.
Smart Images

Figure CN120408121A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of measurement and analysis of spectral data, and particularly to a method and system for evaluating rice quality based on spectral data analysis. Background Art
[0002] Existing rice quality evaluation methods mainly adopt chemical detection and traditional spectral analysis techniques. Among them, chemical detection requires destructive sampling and takes a long time. Traditional spectral analysis often relies on fixed feature selection methods, which are difficult to adapt to the spectral differences of different rice varieties, and are easily affected by changes in environmental temperature and humidity and equipment aging, requiring frequent manual calibration. At the same time, there is a risk of missed detection when detecting local quality abnormalities. These problems limit the application of rice quality evaluation in industrialization, real-time detection, etc. Summary of the Invention
[0003] In view of the above existing problems, the present invention is proposed.
[0004] Therefore, the present invention provides a method for evaluating rice quality based on spectral data analysis, which realizes adaptive feature selection of spectral data of rice varieties through a model-agnostic meta-learning framework, and uses multi-scale decomposition and fusion techniques to extract microscopic, mesoscopic, and macroscopic features respectively. At the same time, a reverse verification and dynamic calibration mechanism is introduced to perform closed-loop correction on model parameters according to real-time feedback, thereby solving the problems of large feature differences between different rice varieties, high sample size requirements, and unstable detection caused by environmental interference and equipment drift.
[0005] To solve the above technical problems, the present invention provides the following technical solutions. A method for evaluating rice quality based on spectral data analysis includes: Performing adaptive normalization and multi-level filtering preprocessing on the original spectral data of rice varieties, and randomly dividing the preprocessed data into a support set and a query set; Adopting a model-agnostic meta-learning framework on the support set, combining an adaptive detection window and a reinforcement learning controller, and iteratively training through an Adam optimizer to generate a feature weight vector of the target variety; Performing multi-scale decomposition on the preprocessed data, and respectively extracting local peak features at the microscopic scale, sub-band features at the mesoscopic scale, and full-band features at the macroscopic scale; Fusing the features of each scale in a bottom-up manner, and detecting and correcting the deviation between the outputs of the features of each scale through a reverse verification mechanism; Generating a rice quality evaluation decision based on the fused features, and dynamically calibrating the parameters of the decision model using real-time feedback data.
[0006] As a preferred embodiment of the rice quality assessment method based on spectral data analysis according to the present invention, wherein: the data of the support set is used for meta-learning model training, and the Adam optimizer and the reinforcement learning controller are used to update the parameters during the training process, and the generalization ability of the model is verified on the query set.
[0007] As a preferred embodiment of the rice quality assessment method based on spectral data analysis according to the present invention, wherein: the macro scale is the full band of 400nm - 2500 nm; the meso scale is the near-infrared sub-band of 900nm - 1700 nm; the micro scale is the local characteristic peak band.
[0008] As a preferred embodiment of the rice quality assessment method based on spectral data analysis according to the present invention, wherein: the multi-scale decomposition includes extracting the local peak features at the micro scale using a one-dimensional convolutional neural network, setting a fixed convolutional kernel size and stride for each layer, introducing batch normalization and activation functions between layers, and using residual connections to maintain signal details, and at the same time designing a dynamic pooling layer to achieve adaptive signal aggregation according to local statistical characteristics.
[0009] As a preferred embodiment of the rice quality assessment method based on spectral data analysis according to the present invention, wherein: the multi-scale decomposition further includes fusing the sub-band features at the meso scale using a dual-channel attention fusion module, including one branch using a multi-head attention mechanism to calculate static weights, and the other branch using a graph convolutional network to construct an adjacency matrix between sub-bands to generate dynamic attention weights, and weighted integration of the two is performed through a consensus algorithm to generate a weighted feature vector; The fusion of the full-band features at the macro scale uses a multi-layer long short-term memory network, configured 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 macro feature representation through a fully connected layer.
[0010] As a preferred embodiment of the rice quality assessment method based on spectral data analysis according to the present invention, wherein: the reverse verification mechanism includes calculating the mutual information, cross-correlation and dynamic time warping distance between the feature outputs of each scale to determine the deviation between the macro layer decision and the meso layer prediction; when it is detected that the deviation exceeds the preset standard, a time-domain reverse verification strategy, a frequency-domain reverse verification strategy or a dual-path re-extraction strategy is selected according to the nature of the deviation for closed-loop correction.
[0011] As a preferred embodiment of the rice quality assessment method based on spectral data analysis according to the present invention, wherein: generating the rice quality assessment decision includes using the fused multi-scale features as input, generating a rice quality assessment decision through a decision module, the decision is based on pre-set quality determination rules, and the decision model parameters are dynamically calibrated through real-time feedback data.
[0012] As a preferred solution of the rice quality evaluation system based on spectral data analysis according to the present invention, it includes: a data acquisition unit, an algorithm module, and a decision-making unit; the data acquisition unit is used to collect and transmit data information; the algorithm module is used to run the algorithm; the decision-making unit is used to generate decisions and perform dynamic calibration.
[0013] A computer device includes a memory and a processor. The memory stores a computer program. It is characterized in that when the processor executes the computer program, the steps of the rice quality evaluation method based on spectral data analysis are realized.
[0014] A computer-readable storage medium stores a computer program thereon. It is characterized in that when the computer program is executed by a processor, the steps of the rice quality evaluation method based on spectral data analysis are realized.
[0015] Advantages of the present invention: By introducing model-agnostic meta-learning and multi-scale feature fusion technologies, and adopting reinforcement learning control and dual-channel attention mechanism, the present invention realizes adaptive feature selection and closed-loop correction of rice variety spectral data, thus breaking through the limitations of traditional methods in aspects such as sample dependence, environmental adaptation, and local anomaly detection; the technical solution adopts innovative designs in each link of data preprocessing, feature extraction, feature fusion, and decision calibration, integrates time-domain and frequency-domain information, and realizes dynamic correction of the consistency of multi-scale feature output through self-supervised iterative optimization, significantly improving the accuracy and stability of rice quality evaluation, and reducing the requirements for a large number of samples and frequent manual intervention, providing a creative and efficient solution for industrialized and real-time detection applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0017] Figure 1 It is a schematic flow chart of a rice quality evaluation method based on spectral data analysis provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] To make the above objects, features, and advantages of the present invention more apparent and understandable, the following provides a detailed description of the specific embodiments of the present invention in conjunction with the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all embodiments. Based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present invention.
[0019] In the following description, many specific details are set forth to facilitate a thorough understanding of the present invention. However, the present invention may be implemented in other ways different from those described herein. Those skilled in the art can make similar generalizations without departing from the spirit of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.
[0020] Secondly, the so-called "one embodiment" or "embodiment" herein refers to specific features, structures, or characteristics that may be included in at least one implementation of the present invention. The phrase "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that mutually excludes other embodiments.
[0021] The present invention is described in detail in conjunction with schematic diagrams. When detailing the embodiments of the present invention, for ease of explanation, the cross-sectional views showing the device structure are enlarged locally in a non-general proportion, and the schematic diagrams are only examples and should not limit the scope of protection of the present invention herein. In addition, in actual production, three-dimensional spatial dimensions including length, width, and depth should be included.
[0022] At the same time, in the description of the present invention, it should be noted that the orientation or positional relationships indicated by terms such as "upper, lower, inner, and outer" are based on the orientation or positional relationships shown in the accompanying drawings. This is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation to the present invention. In addition, the terms "first, second, or third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.
[0023] Unless otherwise clearly defined and limited in the present invention, the terms "mounted, connected, and coupled" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can also be a mechanical connection, an electrical connection, or a direct connection, and can also be indirectly connected through an intermediate medium, or can be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0024] Embodiment 1, referring to Figure 1 , which is the first embodiment of the present invention. This embodiment provides a method for evaluating the quality of rice based on spectral data analysis, including: S1: Perform adaptive normalization and multi-level filtering preprocessing on the original spectral data of rice varieties, and randomly divide the preprocessed data into a support set and a query set.
[0025] Standardize the spectral data of rice varieties. Using the minimum and maximum values as a reference, map the original data into a unified numerical interval to eliminate the differences brought by different measurement scales. After the standardization is completed, divide the data into two parts through a pseudo-random number generator. Approximately 70% of the data constitutes the support set for model training, and the remaining 30% of the data constitutes the query set for subsequent verification. The meta-learning model is trained using a gradient descent-based model-agnostic meta-learning method. At the beginning of training, the model parameters are initialized randomly, and the initial parameter status is recorded. In each training iteration, the Adam optimization algorithm is used to update the model parameters so that the model can optimize the parameters with an appropriate step size when facing the spectral data of different rice varieties. During the training process, perform multiple rounds of iterative training on the data in the support set, and record the changes in training loss and parameters during this period; after the training is completed, input the data in the query set into the trained model, and verify the processing of the model on unseen samples by calculating the loss metrics on the query set.
[0026] S2: Adopt a model-agnostic meta-learning framework on the support set, combine an adaptive detection window and a reinforcement learning controller, and iteratively train through the Adam optimizer to generate the feature weight vector of the target variety.
[0027] The Adam optimization algorithm includes calculating the gradient corresponding to each parameter from the training samples in the support set, performing exponential weighted averaging on the gradients of each parameter using a preset decay factor to form a first-order moment estimate of the gradient, which is used to record the average direction of the gradient. At the same time, perform exponential weighted averaging on the squared values of the gradients of each parameter to form a second-order moment estimate to reflect the volatility of the gradient. In the initial iteration stage, correct the biases of the first-order moment estimate and the second-order moment estimate to compensate for the low initial estimate values. Each parameter is updated according to the preset learning rate and the corrected first-order and second-order moments. During the update process, use the square root of the corrected second-order moment plus a small constant as the denominator to avoid division by zero. In addition, adjust the decay factor and learning rate of the exponential weighted averaging in real time according to the change in the spectral data distribution. This adjustment is performed during multiple rounds of iterative training of meta-learning. In each round of training, first calculate the gradient and update the parameters using the support set data, and then use the query set data to verify the parameter update rule, thereby dynamically adjusting the hyperparameter settings.
[0028] S3: Perform multi-scale decomposition on the preprocessed data, and extract local peak features at the micro scale, sub-band features at the meso scale, and full-band features at the macro scale respectively.
[0029] S4: Weight the features at each scale using a bottom-up approach, and detect and correct the deviation between the outputs of the features at each scale through a reverse verification mechanism.
[0030] The feature extraction of the local peaks at the microscopic scale is realized by a one-dimensional convolutional neural network, which consists of multiple convolutional layers. Each convolutional layer is processed with convolutional kernels and strides of different sizes. Each convolutional kernel perceives a local area of the spectral data, extracts the high-frequency and low-frequency information in the spectral signal, and captures the features of the local peaks. At the same time, a batch normalization layer and an activation function (such as ReLU) are introduced between the convolutional layers, combined with a residual connection structure, to ensure that the detailed information in the input signal is passed through the network levels. In addition, a dynamic pooling layer is added inside the network. This pooling layer adaptively aggregates the signals according to the statistical properties of each local area, and extracts the intensity, full width at half maximum, and symmetry parameters of the local peaks. Among them, the pooling layer is dynamically adjusted based on the changes in the local area of the signal, and an attention mechanism, automatic weighting, and selection of important feature maps are added. The weighted fusion is applied to the feature maps output by the convolutional layer, so that the network automatically focuses on the key peak features during the training process. Finally, the entire network is trained using the backpropagation algorithm in cooperation with the Adam optimizer, and the convolutional kernels and parameters are optimized, so as to ensure that the feature maps output by the network can fully and accurately represent the significant features of the local signal. The output of the significant features provides a clear numerical basis for the multi-scale feature fusion.
[0031] Specifically, the feature extraction of the local peaks at the microscopic scale uses a one-dimensional convolutional neural network, which consists of multiple convolutional layers. Each layer uses a convolutional kernel of a specific size and a set stride to process the normalized spectral data in a local area, so as to separate the high-frequency and low-frequency information in the local area. A batch normalization module and an activation function module are set between the convolutional layers to ensure the stability of the training process. At the same time, a residual connection is used to retain the detailed information of the input signal. A dynamic pooling layer is designed in the network to achieve adaptive signal aggregation according to the local statistical characteristics, so as to extract the intensity, full width at half maximum, and symmetry parameters of the local peaks. In addition, an attention mechanism is embedded in the network to weight the feature maps output by each layer, and the network parameters are carefully adjusted in combination with the backpropagation and the Adam optimizer, so that the output multi-channel feature maps accurately describe the local signal features in numerical form, providing a quantitative basis for the multi-scale feature fusion.
[0032] In the process of fusing sub-band features at the mesoscopic scale, first, the spectral data of each pre-separated sub-band are used to obtain the corresponding feature vectors through a feature extraction network, and these feature vectors are input into a newly designed dual-channel attention fusion module. This module consists of two parallel branches: one branch uses the multi-head attention mechanism to calculate the similarity between the sub-band feature vectors and the target chemical component description vectors to generate static attention weights, and the other branch uses the graph convolutional network to construct the adjacency matrix between sub-bands, propagate and fuse the feature vectors to generate dynamically adjusted attention weights. At the same time, the attention weights output by the dual channels are weighted and integrated through a consensus algorithm, and the sub-band feature vectors are weighted and summed to form a comprehensive weighted feature representation. A feedback mechanism is introduced to compare the fused prediction value with the previous prediction result, perform self-supervised iterative adjustment, generate the prediction value of the chemical component ratio, realize the deep fusion of sub-band feature information, and perform real-time dynamic correction and optimization on the contribution of each sub-band in describing the target chemical component.
[0033] In the process of fusing full-band features at the macroscopic scale, the full-band spectral data are collected at preset time intervals to form continuous time-series data, and noise and outliers are removed through adaptive normalization and multi-level filtering preprocessing. The preprocessed data are input into a deep network composed of multiple long short-term memory networks. Each long short-term memory layer is equipped with an adaptive time step adjustment mechanism to dynamically adjust the hidden state update frequency according to the changes in the input data, and an improved gating structure is used to enhance the state information transmission. The outputs of each layer are processed by a local window attention module to capture local time-series dependencies, and the local attention output is fused with the original long short-term memory features through residual connections and skip connections to form a multi-level feature representation; the fused features are further weighted and integrated by a fully connected layer, and after batch normalization and activation mapping, a macroscopic scale feature representation for decision-making is generated; in addition, the fusion process dynamically adjusts the time step and local window size, combines the global feature integration strategy with the iterative correction feedback mechanism, and uses the latest collected time-series data to update the adaptive parameters of the model in real time to realize the structured modeling of the changing trend of the full-band spectral data over time.
[0034] The hierarchical fusion includes: adopting a dynamic adaptive detection window in the micro-scale feature extraction part, the size of which is determined by the statistical variance of the local spectral signal. At the same time, 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 interdependence between different bands; in the meso-scale feature extraction part, a dual attention mechanism is introduced to weight the signal amplitudes in the predefined sub-bands, calculate the cross-attention scores between adjacent sub-bands, and obtain the relative information between each sub-band; in the macro-scale feature extraction part, a hybrid structure is constructed, which consists of a long short-term memory network and a Transformer encoder layer, and is used to model the long-term dependence and subtle temporal changes of the full-band data simultaneously; in the fusion stage, a bottom-up iterative integration method is adopted, and the micro, meso, and macro features are fused after being independently weighted, and a consistency verification module is introduced to perform cross-correlation analysis on the fusion output and the outputs of each layer to detect inconsistent situations. When the detection result exceeds the preset threshold, the system starts a dual-path re-extraction mechanism. One path re-extracts by adjusting the detection window function in the micro-scale feature extraction and increasing the frequency domain filter parameters, and the other path re-processes by modifying the attention parameter configuration in the meso-scale feature extraction. Subsequently, a consensus algorithm is used to perform majority voting fusion on the dual-path outputs to form the final fusion feature representation.
[0035] The reverse verification mechanism dynamically adjusts the verification strategy by monitoring the differences between the macro-layer decisions and the meso-layer predictions.
[0036] In the present invention, a reverse verification mechanism is used to correct the deviation between the macro-layer decision and the meso-layer prediction output. When 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, automatically adjusts the detection window size and modifies the filter bandwidth by analyzing the statistical variance of the local spectral signal, and uses an adaptive filtering algorithm to re-extract the local peak features. At the same time, for signals with abnormal spectral features after Fourier transform, the system adopts a frequency-domain reverse verification strategy to dynamically adjust the frequency-domain filtering parameters to reconstruct the frequency-domain features. When significant deviations occur simultaneously in the time-domain and frequency-domain indicators, and the detection results continuously deviate from the preset standard, the signal noise level significantly increases, and the detection results are unstable during continuous iterations, the system determines it as an extreme or complex situation. At this time, the dual-path re-extraction mechanism is activated. One path adjusts the detection window and filter parameters in the time domain, and the other path adjusts the dynamic filtering parameters in the frequency domain. The consensus algorithm is used to weight and fuse the features output by the dual paths to form the corrected micro-scale features. At the same time, the system activates a parameter controller based on reinforcement learning, compares the current detection results with historical data, optimizes the re-extraction parameters in real time, and performs a secondary consistency check on the re-extraction results, so as to realize the dynamic correction of the multi-scale output consistency and form a closed-loop feedback mechanism.
[0037] Furthermore, a large deviation situation refers to the output difference between the macro-layer decision and the meso-layer prediction exceeding the statistical threshold preset by the system. It is manifested as when calculating using mutual information, cross-correlation, and dynamic time warping distance, the value of any one or more indicators is lower or higher than the reference standard set by the system. For example, when the local peak feature detection error exceeds twice the statistical standard deviation of the support set data or the deviation between the sub-band prediction and the actual measurement exceeds a predetermined percentage, the system determines that the deviation is large. And an extreme or complex situation refers to the simultaneous occurrence of abnormal deviations at multiple scales, and these deviations persist during continuous iterative verification. Specifically, it is manifested that the indicators in both the time domain and the frequency domain deviate significantly from the expected values, accompanied by a significant increase in the signal noise level or unstable detection results. In addition, it may also be affected by equipment instability, environmental changes, or abnormal characteristics of rice varieties. At this time, the system activates the dual-path re-extraction mechanism and the reinforcement learning controller to deeply update the re-extraction parameters, ensuring the restoration of multi-scale feature output consistency through dual-path parameter adjustment and the consensus algorithm.
[0038] S5: Generate a rice quality assessment decision based on the fused features, and dynamically calibrate the decision model parameters using real-time feedback data.
[0039] In the dynamic calibration process based on real-time feedback data, the system adopts an adaptive sliding window mechanism, dynamically adjusts the window length according to the statistical distribution of the feedback data, and collects the feedback data including the manual detection value and the sensor measurement value; within each window, the mean square error is used as the basic loss function, and the robust error calculation method is combined to quantify the difference between the predicted value and the true value. At the same time, the outlier detection algorithm is used to eliminate the outliers to ensure the accuracy of the error calculation; at the same time, through the stochastic gradient descent method with momentum, the gradient of the current loss function with respect to the model parameters is calculated, combined with the momentum saved in the previous update, and the parameters are adjusted through the preset learning rate and momentum coefficient. A secondary parameter adjustment mechanism based on Bayesian optimization is introduced to search and optimize the learning rate and momentum coefficient in real time within a local range using historical feedback data.
[0040] Furthermore, after preprocessing and fusing the micro-scale local peak features, meso-scale sub-band features, and macro-scale full-band features, hierarchical fusion forms a unified feature representation, which is used as the input of the quality assessment decision module. At the same time, according to the comparison results of the indicators of the fusion features with the preset thresholds, the corresponding decision strategies are automatically matched. When all the fusion features are within the predetermined standard range, the system adopts the standard decision strategy to generate the preliminary quality assessment result according to the predetermined grading rules; when it is detected that there is a difference beyond the preset range between the sub-band prediction and the full-band time series features, the system activates the emergency decision strategy, re-analyzes the preliminary result using the feedback data, and recalculates the quality score in combination with the real-time dynamic calibration data; when the fusion features continuously show abnormalities in multiple consecutive evaluation cycles, the system switches to the high-sensitivity mode, assigns higher weights to the subtle feature fluctuations, and activates an additional analysis process to adjust the decision parameters in real time. Finally, the decision module comprehensively generates a comprehensive quality assessment result including quality grading and numerical scoring through the preset rules, dynamic feedback, and iterative optimization mechanism.
[0041] Embodiment 2 is the second embodiment of the present invention, which provides a rice quality assessment method based on spectral data analysis. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through experiments.
[0042] 50 rice samples of each of the three varieties of indica rice, japonica rice, and Thai fragrant rice are selected, for a total of 150 samples. The reflectance spectral data of each sample is collected using a near-infrared spectrometer, with a wavelength range of 400 nm to 2500 nm and a spectral resolution of 5 nm, to obtain the continuous spectral curve of each sample within the specified band. According to the laboratory standard method, the physical and chemical indexes such as protein content and moisture content of each sample are detected, and the samples are marked according to the set thresholds and divided into three categories: high quality, medium quality, and low quality, as the true labels for model training and evaluation.
[0043] The collected original spectral data is standardized and denoised. Normalization adopts the min-max normalization method to linearly map the spectral values of different samples to the interval [0, 1], eliminating the amplitude offset caused by sample differences. To improve the signal smoothness and suppress local noise fluctuations, a multi-level filtering method is used for spectral curve denoising. In this embodiment, the Savitzky-Golay smoothing filter (abbreviated as SG filter) is selected as an example for the filtering method. This method performs smooth fitting on the spectral signal within a sliding window through local polynomial regression, and can remove high-frequency noise while retaining the overall change trend of the spectrum. It should be noted that the filtering process described in the present invention is not limited to a specific filtering algorithm, and Gaussian filtering, wavelet transform filtering or other existing signal denoising methods can also be used.
[0044] The preprocessed spectral dataset is randomly divided into a support set (105 samples) and a query set (45 samples), which are used for training and validating the meta-learning model respectively. A Model-Agnostic Meta-Learning (MAML) framework is constructed on the support set, adopting an inner and outer loop training mechanism based on gradient descent, and using the Adaptive Moment Estimation (Adam optimizer) algorithm to iteratively update the model parameters. At the same time, a reinforcement learning controller is combined to dynamically adjust the learning rate and the detection window size to adapt to the spectral distribution characteristics of different rice varieties, and finally generate a feature weight vector for a specific target variety.
[0045] Based on the multi-scale decomposition structure proposed in the present invention, feature extraction is performed on the preprocessed spectral data. At the micro scale, a one-dimensional convolutional neural network (1D-CNN) is used to extract local peak features. The network structure consists of three convolutional layers, and the kernel sizes are set to 5, 7, and 9 respectively. The ReLU activation function is adopted, and batch normalization and residual connection modules are configured between layers to enhance the feature transfer ability. To enhance the network's perception ability of local spectral changes, a dynamic pooling layer is introduced, which dynamically adjusts the pooling window size according to local statistical features, and extracts parameters such as peak intensity, full width at half maximum, and symmetry in the spectral signal.
[0046] The mid-scale processes the near-infrared sub-band signals in the range of 900nm to 1700nm, and extracts sub-band features through a dual-channel attention fusion module. This module contains two parallel channels: the first channel uses the 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 by the two channels, weights and aggregates the sub-band features, and forms a mid-scale feature representation.
[0047] The macro-scale processes the spectral data of the complete band (400nm to 2500nm). The long short-term memory network (LSTM) is used to model the sequential features of the spectrum varying with wavelength. The LSTM structure is embedded with an adaptive time step mechanism to enhance its perception ability of the full-band change trend. At the same time, a local window attention module is introduced into the network to extract temporal dependence features. After the outputs of each layer are fused through residual connections and skip connections, they are integrated by a fully connected layer to generate a macro-scale feature expression vector.
[0048] The features of the three scales are weighted and fused in a bottom-up manner. A reverse verification mechanism is introduced during the fusion process to evaluate the consistency between the outputs of each scale. Specifically, the mutual information, cross-correlation coefficient, and dynamic time warping distance (DTW) between the micro-scale, mid-scale, and macro-scale outputs are calculated. If any index is lower than the system-set threshold, the closed-loop correction mechanism is triggered. In this embodiment, the system starts the time-domain reverse verification strategy, resets the detection window and adjusts the filtering parameters for the micro-scale features, extracts features again and combines them with the original features for dual-path fusion to generate a corrected fusion representation.
[0049] The fused features are input into the quality assessment and decision-making module, and three-classification outputs are performed through a fully connected layer, corresponding to high-quality, medium-quality, and low-quality categories respectively. To improve the practicality of the model, dynamic calibration is performed in combination with the real detection feedback data on the query set. The mean square error and robust loss function are used to evaluate the deviation between the prediction result and the actual value within the feedback window, and the stochastic gradient descent method with momentum is used for parameter optimization; at the same time, the Bayesian optimization strategy is introduced to automatically adjust the learning rate and momentum coefficient to further improve the adaptive performance of the model.
[0050] In the query set test, the overall classification accuracy of the method of the present invention is 92.7%, among which the recognition rate of high-quality samples is 95.3%, medium-quality samples is 91.5%, and low-quality samples is 91.2%. Compared with traditional methods such as the classification method composed of Principal Component Analysis (PCA) combined with Support Vector Machine (SVM) (the accuracy rate is about 81.6%), the method of the present invention has significant advantages in terms of multi-variety adaptability, feature extraction accuracy, and system robustness.
[0051] Example 3 is the third example of the present invention, which provides a rice quality evaluation system based on spectral data analysis, including a data acquisition unit, an algorithm module, and a decision-making unit.
[0052] The data acquisition unit is used to collect and transmit data information; the algorithm module is used to run the algorithm; the decision-making unit is used to generate decisions and perform dynamic calibration.
[0053] Example 4, the fourth example of the present invention, is different from the previous three examples in that: If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that makes contributions to the prior art, or a part of this 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 for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical disks, etc., which can store program codes.
[0054] This application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of this application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate for realizing the process Figure 1 one process or multiple processes and / or blocks Figure 1apparatus for the functions specified in one or more boxes.
[0055] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction apparatus that implements the functions specified in one Figure 1 or more processes and / or boxes Figure 1 or more boxes.
[0056] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one Figure 1 or more processes and / or boxes Figure 1 or more boxes.
[0057] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed to cover the preferred embodiments as well as all changes and modifications falling within the scope of the present application.
[0058] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A rice quality assessment method based on spectral data analysis, characterized in that: Including Performing adaptive normalization and multi-level filtering preprocessing on the original spectral data of rice varieties, and randomly dividing the preprocessed data into a support set and a query set; Adopting a model-agnostic meta-learning framework on the support set, combining an adaptive detection window and a reinforcement learning controller, and iteratively training through an Adam optimizer to generate a feature weight vector of the target variety; Performing multi-scale decomposition on the preprocessed data, and respectively extracting local peak features at the micro scale, sub-band features at the meso scale, and full-band features at the macro scale; Fusing the features at each scale using a bottom-up method, and detecting and correcting the deviation between the outputs of the features at each scale through a reverse verification mechanism; Generating a rice quality assessment decision based on the fused features, and dynamically calibrating the decision model parameters using real-time feedback data.
2. The rice quality evaluation method based on spectral data analysis according to claim 1, wherein: The data in the support set is used for meta-learning model training, and the parameters are updated 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. The rice quality evaluation method based on spectral data analysis according to claim 2, characterized in that: The macro scale is the full band of 400nm - 2500nm; the meso scale is the near-infrared sub-band of 900nm - 1700nm; the micro scale is the local feature peak band.
4. The rice quality assessment method based on spectral data analysis according to claim 3, characterized in that: The multi-scale decomposition includes that the extraction of local peak features at the micro scale uses 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 maintain signal details, and at the same time, a dynamic pooling layer is designed to achieve adaptive signal aggregation according to local statistical characteristics.
5. The rice quality evaluation method based on spectral data analysis according to claim 4, characterized in that: The multi-scale decomposition also includes that the fusion of sub-band features at the meso scale uses a dual-channel attention fusion module, including one branch that calculates static weights using a multi-head attention mechanism, and another branch that constructs an adjacency matrix between sub-bands using a graph convolutional network 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 full-band features at the macro scale uses a multi-layer long short-term memory network, configured with an adaptive time step adjustment mechanism and a local window attention module, and after combining residual connections and skip connections, it is integrated into a macro feature representation through a fully connected layer.
6. The rice quality evaluation method based on spectral data analysis according to claim 5, wherein: The reverse verification mechanism includes calculating the mutual information, cross-correlation, and dynamic time warping distance between the outputs of the features at each scale to determine the deviation between the macro-layer decision and the meso-layer prediction; When the detected deviation exceeds the preset standard, a time-domain reverse verification strategy, a frequency-domain reverse verification strategy, or a dual-path re-extraction strategy is selected according to the nature of the deviation for closed-loop correction.
7. The rice quality evaluation method based on spectral data analysis according to claim 6, characterized in that: The generation of the rice quality assessment decision includes using the fused multi-scale features as input, generating a rice quality assessment decision through a decision module, the decision is based on pre-set quality determination rules, and the decision model parameters are dynamically calibrated using real-time feedback data.
8. A system adopting a rice quality evaluation method based on spectral data analysis as described in any one of claims 1 to 7, characterized in that: Including a data acquisition unit, an algorithm module, and a decision unit; The data acquisition unit is used to collect and transmit data information; The algorithm module is used to load and run algorithms; The decision unit is used to generate decisions and perform dynamic calibration.
9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Rice identification and detection method based on convolutional neural network
CN116519661A
Service prediction method, device and equipment based on LNM large numerical model
CN119089156A
Tobacco plant number prediction method based on deep learning
CN119918023A
Deep learning model-based imperfect soybean hyperspectral imaging classification method
CN120219792A
Internet of things system
WO2023030513A1
Cited By
Mass spectrum detection and analysis system and method based on glucan
CN121141552A