Rice tracing method and system based on terahertz detection technology

The rice sample library and attribute mapping classification model are constructed through terahertz detection technology, which solves the uncertainty and artificial interference of traditional rice origin identification methods, and achieves efficient and accurate traceability of rice origin.

CN120385646APending Publication Date: 2025-07-29ANHUI POLYTECHNIC UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510467932.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

Traditional rice origin identification methods rely on sensory qualities, with uncertainty and artificial interference, making it difficult to accurately identify the real origin of rice.

Method used

By using terahertz detection technology, the rice sample library is constructed, the characteristic parameters of the terahertz spectral data are extracted, the attribute mapping classification model is constructed, and the loss function is used to optimize the model to achieve accurate traceability of rice origin.

Benefits of technology

It realizes efficient, accurate and non-destructive traceability of rice production areas, improves detection efficiency and accuracy, and avoids material damage and data loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120385646A_ABST
    Figure CN120385646A_ABST
Patent Text Reader

Abstract

The invention discloses a rice traceability method and system based on a terahertz detection technology, and the method comprises the steps: S1, collecting rice from different producing areas, carrying out the pretreatment, and constructing a matrix type rice sample library according to a pretreatment result; s2, performing terahertz detection on the samples in the rice sample library by using a terahertz technology, and extracting terahertz spectrum data characteristic parameters; s3, constructing an attribute mapping classification model based on a rice database and the terahertz spectrum data characteristic parameters; s4, optimizing the attribute mapping classification model by using a loss function to obtain an optimized attribute mapping classification model; and step S5, using the optimized attribute mapping classification model to detect and analyze the terahertz spectral characteristics of the rice to be detected to obtain the rice producing area, and completing the rice traceability based on the terahertz detection technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of green food safety and non-destructive testing of agricultural products, and particularly relates to a rice traceability method and system based on terahertz detection technology. Background Art

[0002] As one of the most important food crops in the world, rice is also an indispensable part of China's agricultural landscape. Its quality, safety status, and origin information are related to the health and well-being of hundreds of millions of consumers and directly affect the market image of producers. Rice traceability testing can promptly detect potential food safety risks and prevent contaminated rice from entering the market, thus ensuring the food safety of consumers.

[0003] Traditional methods for identifying the origin of rice mainly rely on sensory quality, including aspects such as the appearance, smell, and taste of rice. However, these methods also have certain drawbacks. Judging the origin of rice solely by taste also has a certain degree of uncertainty. In addition, traditional methods for identifying the origin of rice are also easily interfered by human factors. For example, some unscrupulous merchants may cover up its true origin by adding chemical substances or changing the rice processing method, thus misleading consumers. Therefore, researching a new method for identifying the origin of rice has important scientific significance.

[0004] Terahertz technology is an emerging electromagnetic radiation technology with a frequency between radio waves and light waves, featuring non-destructive, high-sensitivity, and non-contact detection. In the field of agricultural product quality detection, terahertz technology has demonstrated extensive application potential, including evaluating the growth conditions, storage periods, taste of agricultural products, and detecting pesticide residues. For rice, different varieties of rice have differences in absorption spectra and refractive index spectra in the terahertz band, and these differences provide the possibility for identifying the origin of rice.

[0005] Furthermore, in view of the successful application of terahertz technology in agricultural product quality detection and variety identification, this technology has also shown certain potential in the detection of the origin of rice. Rice from different origins is affected by various factors such as climate, soil, and planting methods, and there are differences in its physical and chemical properties, which may be reflected in the terahertz spectrum. Therefore, by analyzing the terahertz spectrum of rice and combining data analysis methods such as machine learning, it is expected to achieve accurate detection of the origin of rice.

[0006] In summary, it is necessary to explore new traceability origin identification technologies to ensure the accuracy of the origin of rice. Summary of the Invention

[0007] To solve the above problems, the present invention proposes a rice traceability method based on terahertz detection technology, and the method includes:

[0008] Step S1: Collect rice from different origins and perform preprocessing. Construct a matrix-style rice sample library according to the preprocessing results;

[0009] Step S2: Use terahertz technology to perform terahertz detection on the samples in the rice sample library, and extract the characteristic parameters of terahertz spectral data;

[0010] Step S3: Construct an attribute mapping classification model based on the rice database and the characteristic parameters of the terahertz spectral data;

[0011] Step S4: Use a loss function to optimize the attribute mapping classification model to obtain an optimized attribute mapping classification model;

[0012] Step S5: Use the optimized attribute mapping classification model to detect and analyze the terahertz spectral characteristics of the rice to be detected, obtain the rice origin, and complete the traceability of rice based on terahertz detection technology.

[0013] Optionally, in step S1, the preprocessing process specifically includes:

[0014] Dry the rice samples from different origins in an oven, and sieve the rice powder into uniform powder;

[0015] Weigh the sieved rice powder using a high-precision balance and pour it into a tablet press mold for tableting;

[0016] Take out the tablet, measure the thickness of the tablet using a vernier caliper, then put the tablet into a disposable sealed bag, and attach a label indicating the sample number and sample thickness.

[0017] Optionally, in step S2, the process of extracting the characteristic parameters of terahertz spectral data specifically includes:

[0018] Perform Fourier transform on the time-domain signal in the terahertz data obtained by terahertz detection to obtain the phase spectrum of the terahertz signal;

[0019] Calculate the fourth traceability parameter refractive index and the fifth traceability parameter absorption coefficient based on the first traceability parameter full width at half maximum, the second traceability parameter peak value, the third traceability parameter center frequency of the terahertz signal and the phase spectrum.

[0020] Optionally, the phase spectrum calculation process includes:

[0021] The time-domain signal X(f) of the terahertz data after Fourier transform is expressed as:

[0022] X(f)=FFT(x(t))

[0023] Calculate the phase spectrum based on X(f)

[0024]

[0025] Among them, x(t) is a time-domain signal.

[0026] Optionally, the first traceability parameter half-width peak is the width between two corresponding frequency points when the intensity drops to half of the maximum value at the spectral peak, and the calculation method is:

[0027] FWHM = f high -f low

[0028] Among them, f high and f low are the upper and lower boundary frequencies at half height respectively.

[0029] Optionally, the second traceability parameter peak is the frequency and amplitude corresponding to the maximum signal intensity in the frequency-domain spectrum obtained by converting the time-domain signal into the frequency-domain spectrum through Fourier transform.

[0030] Optionally, the third traceability parameter peak is expressed as:

[0031]

[0032] Among them, S(f) is the power spectral density and f is the frequency.

[0033] Optionally, the fourth traceability parameter refractive index n(ω) is expressed as:

[0034]

[0035] Among them, d is the sample thickness and c is the speed of light in vacuum; is the phase of the ratio of the sample signal to the reference signal.

[0036] Optionally, the fifth traceability parameter absorption coefficient is expressed as:

[0037]

[0038] Among them, ρ(ω) is the modulus of the ratio of the sample signal to the reference signal.

[0039] The present invention also discloses a rice traceability system based on terahertz detection technology, and the system includes:

[0040] An initial data acquisition module, configured to collect rice from different origins and perform preprocessing, and construct a matrix-type rice sample library according to the preprocessing results;

[0041] A feature extraction module, configured to use terahertz technology to perform terahertz detection on the samples in the rice sample library and extract terahertz spectral data characteristic parameters;

[0042] A discrimination model construction module, configured to construct an attribute mapping classification model based on a rice database and the terahertz spectrum data characteristic parameters;

[0043] A discrimination model optimization module, configured to optimize the attribute mapping classification model using a loss function to obtain an optimized attribute mapping classification model;

[0044] A discrimination model application module, configured to detect and analyze the terahertz spectrum characteristics of the rice to be detected using the optimized attribute mapping classification model to obtain the rice origin, and complete the traceability of rice based on terahertz detection technology.

[0045] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0046] The present invention can accurately identify the rice origin: the present invention constructs an attribute mapping classification model of the characteristic parameters obtained by terahertz technology with the rice origin, annual production type, climate conditions, season, etc.; this model can more accurately identify the origin of rice by classifying various attributes of rice;

[0047] Efficient, accurate, and non-destructive: compared with traditional sampling detection methods, this method uses terahertz technology for on-line monitoring, without destructive sampling, avoiding material damage and data loss during the experiment, and improving the detection efficiency and accuracy;

[0048] The proposed rice traceability method and system based on terahertz detection technology can accurately identify the origin of rice, providing an advanced and non-destructive detection means for fields such as food security. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions of the present invention, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.

[0050] Figure 1 It is a flowchart of the rice traceability detection method according to an embodiment of the present invention;

[0051] Figure 2 It is a flowchart of model training according to an embodiment of the present invention;

[0052] Figure 3 It is a flowchart of optimizing algorithm training during model training according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0053] To make the above objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0054] Example 1

[0055] A method for tracing the origin of rice based on terahertz detection technology, as Figure 1 shown, the method is specifically as follows:

[0056] Step S1: Collect rice from different origins and perform preprocessing, and construct a matrix-type rice sample library according to the preprocessing results.

[0057] The preprocessing process is as follows: The rice sample preparation includes drying in an oven, sieving the rice powder into uniform powder, weighing it with a high-precision balance and pouring it into a tablet press mold for tableting under the tablet press, then taking out the tablet, measuring its precise thickness with a vernier caliper, putting it into a disposable sealed bag, and attaching a label indicating the sample number and sample thickness.

[0058] Step S2: Use terahertz technology to perform terahertz detection on the samples in the rice sample library, and extract the terahertz spectral data characteristic parameters.

[0059] Use terahertz to detect rice samples in real time, and analyze the obtained terahertz data and extract characteristic parameters.

[0060] Obtain terahertz detection data of different rice samples; the phase spectrum of the terahertz signal is obtained by performing a Fourier transform on the time-domain signal, and the phase spectrum represents the phase distribution of the signal in the frequency domain.

[0061] Assume that the terahertz time-domain signal is x(t), its Fourier transform is X(f), and the phase spectrum is It can be expressed as:

[0062]

[0063] Assume f high and f low are the upper and lower boundary frequencies at half height respectively. The expression for obtaining the first traceability parameter, the full width at half maximum, is:

[0064] FWHM = f high -f low

[0065] The second traceability parameter, the peak value, is the frequency and amplitude corresponding to the maximum signal intensity in the frequency-domain spectrum obtained by converting the time-domain signal through Fourier transform.

[0066] Assume that S(f) is the power spectral density, and the expression for obtaining the third traceability parameter, the center frequency, is:

[0067]

[0068] Assume the sample thickness is d; the speed of light in vacuum is c; the phase of the ratio of the sample signal to the reference signal is The acquisition expression for the fourth traceability parameter refractive index is:

[0069]

[0070] Assume the phase of the ratio of the sample signal to the reference signal is The modulus of the ratio of the sample signal to the reference signal is ρ(ω), and the acquisition expression for the fifth traceability parameter absorption coefficient is:

[0071]

[0072] The above mathematical expressions show the calculation of extracting the phase spectrum, refractive index, and absorption coefficient from the terahertz time-domain signal, and then performing feature extraction.

[0073] Feature extraction includes the first, second, and third traceability parameters half-width peak, peak value, and center frequency, which respectively reflect the dispersion degree, intensity or amplitude, and frequency characteristics of the rice tablet signal from different angles.

[0074] Step S3: Construct an attribute mapping classification model based on the rice database and the terahertz spectral data characteristic parameters.

[0075] Construct an attribute mapping classification model for rice features - rice origin, annual production type, climate conditions, and season, etc.

[0076] Based on the convolutional neural network algorithm, construct an initial mapping classification model between the terahertz features of rice and the attributes such as rice origin, annual production type, climate conditions, and season, as Figure 2 shown. The following is a detailed explanation of the training process:

[0077] S31: First, initialize the weights and parameters of the model, which can use random initialization or pre-trained weights;

[0078] S32: Construct an attribute mapping classification model for the rice database and the terahertz spectral data characteristic parameters through a convolutional neural network; use multiple convolutional layers, and add a pooling layer after the convolutional layer to reduce the data dimension and improve the generalization ability;

[0079] S33: After the convolutional layer and the pooling layer, introduce the residual block of ResNet to solve the problem of gradient disappearance in the training of deep networks through skip connections;

[0080] S34. After the ResNet structure, add one or more fully connected layers for classification tasks. A SoftMax activation function follows the fully connected layer to output classification probabilities;

[0081] S35. Use the cross - validation method to evaluate the model performance and select the optimal hyperparameter optimization algorithm to train the CNN. Perform gradient descent according to the loss function to optimize the model parameters;

[0082] S36. Evaluate the model performance on the validation set, adjust the model structure or hyperparameters according to the evaluation results. Save the trained model for subsequent use or deployment to practical applications.

[0083] Step S4. Use the loss function to optimize the attribute mapping classification model to obtain the optimized attribute mapping classification model.

[0084] As Figure 3 shown, use cross - validation to select the optimal hyperparameters. Use the optimization algorithm to train the convolutional neural network structure and optimize the classification task through the loss function. Using the trained model, input the terahertz spectral features to obtain the report of the rice origin tracing system.

[0085] Further, select the optimal hyperparameter optimization algorithm to train the CNN. Specifically, the process of the optimization algorithm is as follows.

[0086] S41. Set the hyperparameters of the Adam optimization algorithm, learning rate, exponential decay rate of the first - moment estimate, exponential decay rate of the second - moment estimate, and small constant.

[0087] S42. Set the number of iterations and enable early stopping.

[0088] S43. For each sample in the dataset, calculate the gradient and then use the Adam optimization algorithm to update the model parameters.

[0089] S44. Evaluate the model performance on the validation set.

[0090] S45. If the performance on the validation set improves, save the model; otherwise, until the performance of the model on the validation set no longer improves.

[0091] S46. Train the final model with the optimal combination of hyperparameters.

[0092] Step S5. Use the optimized attribute mapping classification model to detect and analyze the terahertz spectral features of the rice to be detected, obtain the rice origin, and complete the rice traceability based on terahertz detection technology.

[0093] Example 2

[0094] A rice traceability system based on terahertz detection technology, the system includes:

[0095] An initial data acquisition module, which is used to collect rice from different origins, perform preprocessing, and construct a matrix-type rice sample library according to the preprocessing results.

[0096] The preprocessing process is as follows: The rice sample preparation includes drying in an oven, sieving the rice powder into uniform powder, weighing it with a high-precision balance, pouring it into a tablet press mold, pressing it under the tablet press, then taking out the tablet, measuring its precise thickness with a vernier caliper, putting it into a disposable sealed bag, and attaching a label indicating the sample number and sample thickness.

[0097] A feature extraction module, which is used to perform terahertz detection on the samples in the rice sample library using terahertz technology and extract terahertz spectral data characteristic parameters.

[0098] Using terahertz to detect rice samples in real time, and for the obtained terahertz data, analyzing the terahertz data and extracting characteristic parameters.

[0099] Obtaining terahertz detection data of different rice samples; The phase spectrum of the terahertz signal is obtained by performing a Fourier transform on the time-domain signal, and the phase spectrum represents the phase distribution of the signal in the frequency domain.

[0100] Assume that the terahertz time-domain signal is x(t), its Fourier transform is X(f), and the phase spectrum is It can be expressed as:

[0101]

[0102] Assume f high and f low are respectively the upper and lower boundary frequencies at half height. The expression for obtaining the first traceability parameter, the full width at half maximum, is:

[0103] FWHM = f high - f low

[0104] The second traceability parameter, the peak value, is the frequency and amplitude corresponding to the maximum signal intensity in the frequency-domain spectrum obtained by converting the time-domain signal through Fourier transform.

[0105] Assume that S(f) is the power spectral density, and the expression for obtaining the third traceability parameter, the center frequency, is:

[0106]

[0107] Assume that the sample thickness is d; the speed of light in vacuum is c; the phase of the ratio of the sample signal to the reference signal is The expression for obtaining the fourth traceability parameter, the refractive index, is:

[0108]

[0109] Assume that the phase of the ratio of the sample signal to the reference signal is The modulus of the ratio of the sample signal to the reference signal is ρ(ω), and the acquisition expression of the fifth traceability parameter absorption coefficient is:

[0110]

[0111] The above mathematical expressions show the calculation of extracting the phase spectrum, refractive index, and absorption coefficient from the terahertz time-domain signal, and then performing feature extraction.

[0112] Feature extraction includes the first, second, and third traceability parameter half-width peaks, peak values, and center frequencies, which respectively reflect the dispersion degree, intensity or amplitude, and frequency characteristics of the rice tablet signal from different angles.

[0113] The discrimination model construction module is used to construct an attribute mapping classification model based on the rice database and the terahertz spectral data characteristic parameters.

[0114] Construct an attribute mapping classification model for rice characteristics - attributes such as rice origin, annual production type, climate conditions, and seasons.

[0115] Based on the improved convolutional neural network algorithm, construct an initial mapping classification model between the terahertz characteristics of rice - attributes such as rice origin, annual production type, climate conditions, and seasons. The following is a detailed explanation of the training process:

[0116] First, initialize the weights and parameters of the model, which can use random initialization or pre-trained weights; construct an attribute mapping classification model for the rice database and the terahertz spectral data characteristic parameters through a convolutional neural network; use multiple convolutional layers, and add a pooling layer after the convolutional layer to reduce the data dimension and improve the generalization ability; after the convolutional layer and the pooling layer, introduce the residual block of ResNet to solve the problem of gradient disappearance in the training of deep networks through skip connections; after the ResNet structure, add one or more fully connected layers for classification tasks. A SoftMax activation function follows the fully connected layer to output classification probabilities; use the cross-validation method to evaluate the model performance, and select the optimal hyperparameter optimization algorithm to train the CNN. Perform gradient descent according to the loss function to optimize the model parameters; evaluate the model performance on the validation set, and adjust the model structure or hyperparameters according to the evaluation results. Save the trained model for subsequent use or deployment to actual applications.

[0117] The discrimination model optimization module is used to optimize the attribute mapping classification model using the loss function to obtain an optimized attribute mapping classification model.

[0118] Cross-validation is used to select the optimal hyperparameters. An optimization algorithm is used to train the convolutional neural network structure, and the loss function is used to optimize the classification task. Using the trained model, input the terahertz spectral features to obtain the report of the rice origin tracing system.

[0119] Furthermore, an optimal hyperparameter optimization algorithm is selected to train the CNN. Specifically, the process of the optimization algorithm is as follows.

[0120] Set the hyperparameters of the Adam optimization algorithm, including the learning rate, the exponential decay rate of the first moment estimate, the exponential decay rate of the second moment estimate, and a small constant. Set the number of iterations and enable early stopping. For each sample in the dataset, calculate the gradient and then update the model parameters using the Adam optimization algorithm. Evaluate the performance of the model on the validation set. If the performance on the validation set improves, save the model; otherwise, continue until the performance on the validation set no longer improves. Train the final model with the optimal combination of hyperparameters.

[0121] The discrimination model application module is used to detect and analyze the terahertz spectral features of the rice to be detected using the optimized attribute mapping classification model, obtain the rice origin, and complete the rice tracing based on terahertz detection technology.

[0122] The embodiments described above are only descriptions of the preferred embodiments of the present invention and do not limit the scope of the present invention. Without departing from the design spirit of the present invention, various deformations and improvements made by those of ordinary skill in the art to the technical solutions of the present invention shall fall within the protection scope determined by the claims of the present invention.

Claims

1. A rice traceability method based on terahertz detection technology, characterized in that, The method includes: Step S1: Collect rice from different origins and perform preprocessing, and construct a matrix-style rice sample library according to the preprocessing results; Step S2: Use terahertz technology to perform terahertz detection on the samples in the rice sample library, and extract the characteristic parameters of terahertz spectral data; Step S3: Construct an attribute mapping classification model based on the rice database and the terahertz spectral data characteristic parameters; Step S4: Use a loss function to optimize the attribute mapping classification model to obtain an optimized attribute mapping classification model; Step S5: Use the optimized attribute mapping classification model to detect and analyze the terahertz spectral characteristics of the rice to be detected, obtain the rice origin, and complete the traceability of rice based on terahertz detection technology.

2. The rice traceability method based on terahertz detection technology according to claim 1, wherein In step S1, the preprocessing process specifically includes: Dry the rice samples from different origins in a drying oven, and sieve the rice powder into uniform powder; Weigh the sieved rice powder using a high-precision balance and pour it into a tablet press mold for tablet pressing; Take out the tablet, measure the thickness of the tablet using a vernier caliper, then put the tablet into a disposable sealed bag and attach a label, indicating the sample number and sample thickness on the label.

3. The rice traceability method based on terahertz detection technology according to claim 1, characterized in that: In step S2, the process of extracting the characteristic parameters of terahertz spectral data specifically includes: Perform Fourier transform on the time-domain signal in the terahertz data obtained by terahertz detection to obtain the phase spectrum of the terahertz signal; Calculate the fourth source parameter refractive index and the fifth source parameter absorption coefficient based on the first traceability parameter full width at half maximum, the second traceability parameter peak value, the third traceability parameter center frequency of the terahertz signal and the phase spectrum.

4. The rice traceability method based on terahertz detection technology according to claim 3, characterized in that, The phase spectrum calculation process includes: The time-domain signal X(f) of the terahertz data after Fourier transform is expressed as: X(f) = FFT(x(t)) Calculate the phase spectrum based on X(f) where x(t) is the time-domain signal.

5. The rice traceability method based on terahertz detection technology according to claim 4, characterized in that: The first traceability parameter full width at half maximum FWHM is the width between two corresponding frequency points when the intensity drops to half of the maximum value at the spectral peak, and the calculation method is: FWHM = f high -f low where f high and f low are the upper and lower boundary frequencies at half height, respectively.

6. The rice traceability method based on terahertz detection technology according to claim 5, wherein The second traceability parameter peak value is to convert the time-domain signal into a frequency-domain spectrum through Fourier transform, and the frequency and amplitude corresponding to the maximum signal intensity in the frequency-domain spectrum.

7. The rice traceability method based on terahertz detection technology according to claim 6, characterized in that The peak value f of the third traceability parameter center is expressed as: where S(f) is the power spectral density and f is the frequency.

8. The rice traceability method based on terahertz detection technology according to claim 7, characterized in that: The fourth traceability parameter refractive index n(ω) is expressed as: Where d is the sample thickness, c is the speed of light in vacuum; is the phase of the ratio of the sample signal to the reference signal.

9. The rice traceability method based on terahertz detection technology according to claim 8, characterized in that The fifth traceability parameter, absorption coefficient It is expressed as: where ρ(ω) is the modulus of the ratio of the sample signal to the reference signal.

10. A rice traceability system based on terahertz detection technology, used to implement the rice traceability method according to any one of claims 1 to 9, characterized in that the system It includes: An initial data acquisition module, used to collect rice from different origins and perform preprocessing, and construct a matrix-style rice sample library according to the preprocessing results; A feature extraction module, used to use terahertz technology to perform terahertz detection on the samples in the rice sample library, and extract the characteristic parameters of terahertz spectral data; A discrimination model construction module, used to construct an attribute mapping classification model based on the rice database and the terahertz spectral data characteristic parameters; A discrimination model optimization module, used to use a loss function to optimize the attribute mapping classification model to obtain an optimized attribute mapping classification model; A discrimination model application module, used to use the optimized attribute mapping classification model to detect and analyze the terahertz spectral characteristics of the rice to be detected, obtain the rice origin, and complete the traceability of rice based on terahertz detection technology.