A non-destructive testing method, apparatus, equipment and medium for chalkiness detection in rice grains

By employing near-infrared spectroscopy and machine learning methods, an autoencoder and a one-dimensional convolutional neural network were used to construct a chalky rice grain detection model, which solved the problems of low efficiency and poor accuracy in rice chalky rice detection, and achieved rapid and accurate non-destructive detection.

CN119901706BActive Publication Date: 2025-10-31ANHUI AGRICULTURAL UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510069032.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-10-31
Estimated Expiration
2045-01-16

AI Technical Summary

Technical Problem

Existing technologies for detecting chalky rice are inefficient, susceptible to subjective factors, and traditional image processing techniques struggle to accurately distinguish between normal and chalky grains.

Method used

By combining near-infrared spectroscopy with an autoencoder and a one-dimensional convolutional neural network, spectral data of rice grains are collected using a near-infrared spectrometer. Feature extraction is performed using the autoencoder, and a chalkiness detection model is constructed using a one-dimensional convolutional neural network to achieve non-destructive testing.

Benefits of technology

It enables rapid and accurate detection of chalkiness in rice grains, improves detection efficiency, reduces subjective errors, and provides strong support for rice grain quality monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119901706B_ABST
    Figure CN119901706B_ABST
Patent Text Reader

Abstract

This invention discloses a non-destructive testing method, apparatus, equipment, and medium for chalkiness detection in rice grains. The method utilizes a near-infrared spectrometer to acquire initial spectral data of the rice grains to be tested, and processes this initial spectral data using a rice grain chalkiness detection model to obtain the chalkiness detection results. Based on the rapid, accurate, and non-destructive characteristics of near-infrared spectroscopy, the method acquires spectral data of the rice grains using a near-infrared spectral acquisition instrument, then uses feature extraction and data preprocessing techniques to extract key features of the rice grains, and combines this with machine learning techniques to achieve non-destructive detection of chalkiness in the rice grains. This method provides strong support for rice grain quality monitoring and is of great significance for improving the quality and efficiency of rice production.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of rice quality assessment technology, and in particular relates to a non-destructive testing method, device, equipment and medium for chalkiness detection of rice grains. Background Technology

[0002] High-quality rice seeds are a key factor in achieving high rice yields, directly affecting both the quantity and quality of the rice. However, during the rice grain-filling stage, environmental conditions such as excessively high or low temperatures, insufficient sunlight, and prolonged water shortages can lead to incomplete grain filling. This results in loosely packed starch granules and protein bodies in the rice endosperm, causing chalkiness in the rice and making it prone to breakage during processing. Chalkiness is a crucial trait in assessing rice quality, directly impacting its appearance, processing quality, and commercial value, leading to economic losses. Therefore, chalkiness detection is an important part of rice quality assessment, providing guidance for rice production and variety breeding, and is of great significance for improving rice quality and promoting the development of the rice industry.

[0003] Currently, chalkiness detection in rice is mostly done manually, by visually observing the chalkiness of rice samples and manually recording the chalky grains. This method suffers from low efficiency, strong subjectivity, and high error rates, making it difficult to meet the needs of modern agricultural development. Therefore, it is necessary to research an efficient and accurate method for detecting chalkiness in rice. In recent years, some automated seed quality detection methods have emerged, such as computer vision technology combined with machine learning algorithms and hyperspectral imaging combined with chemometrics. However, computer vision technology is mostly used for detecting superficial quality and cannot directly identify whether chalkiness is present in rice grains. While hyperspectral imaging technology can perceive the internal quality characteristics of rice grains, it requires extensive preprocessing, is slow, and expensive, making it unsuitable for field operations. Summary of the Invention

[0004] The purpose of this invention is to provide a non-destructive testing method for chalky rice grains. This method uses near-infrared spectroscopy to detect chalky rice grains, solving the problems of low efficiency and susceptibility to subjective factors in traditional manual testing methods, as well as the difficulty of distinguishing between normal and chalky grains using traditional image processing techniques.

[0005] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution:

[0006] This invention provides a non-destructive testing method for chalkiness in rice grains, comprising:

[0007] Initial spectral data of the rice grains to be tested were collected using a near-infrared spectrometer;

[0008] The initial spectral data of the rice grains to be tested were processed using a rice grain chalkiness detection model to obtain the chalkiness detection results of the rice grains to be tested.

[0009] In one embodiment of the present invention, the rice grain chalkiness detection model is constructed in the following manner:

[0010] Initial spectral data of rice grain samples were collected using a near-infrared spectrometer, wherein the rice grain samples included chalky rice grains and normal rice grains;

[0011] The initial spectral data of the rice grain sample is preprocessed to obtain the preprocessed spectral data of the rice grain sample.

[0012] The preprocessed spectral data of the rice grain sample was extracted using an autoencoder to obtain a feature spectral dataset of the rice grain sample.

[0013] Based on the characteristic spectral dataset of the rice grain samples, a one-dimensional convolutional neural network was used to construct the chalky rice grain detection model.

[0014] In one embodiment of the present invention, the acquisition of initial spectral data of rice grain samples using a near-infrared spectrometer includes:

[0015] The spectral data of rice grain samples in the 900nm to 1700nm band were collected multiple times using a near-infrared spectrometer, and the average spectral data was calculated as the initial spectral data of the rice grain samples.

[0016] In one embodiment of the present invention, the step of preprocessing the initial spectral data to obtain preprocessed spectral data of the rice grain sample includes:

[0017] The initial spectral data were preprocessed using the SG smoothing algorithm and SNV normalization to obtain the preprocessed spectral data of the rice grain sample.

[0018] In one embodiment of the present invention, the step of using an autoencoder to extract features from the preprocessed spectral data of the rice grain sample to obtain a feature spectral dataset of the rice grain sample includes:

[0019] The autoencoder includes an input layer, a hidden layer, and an output layer;

[0020] The input layer receives the preprocessed spectral data of the rice grain sample and inputs the preprocessed spectral data into the hidden layer;

[0021] The hidden layer extracts hidden features from the preprocessed spectral data through weights and activation functions, and inputs the hidden features into the output layer;

[0022] The output layer reconstructs the data based on the hidden features to obtain the characteristic spectral dataset of the rice grain sample.

[0023] In one embodiment of the present invention, the step of constructing the chalkiness detection model of rice grains using a one-dimensional convolutional neural network based on the characteristic spectral dataset of the rice grain sample includes:

[0024] The feature spectral dataset is divided into a training set and a test set according to a preset ratio;

[0025] An initial detection model is constructed using a one-dimensional convolutional neural network. The initial detection model is trained using a training set, and its performance is evaluated using a test set to obtain the performance evaluation result of the initial detection model.

[0026] The initial detection model is optimized based on the performance evaluation results to obtain the final rice grain chalkiness detection model.

[0027] In one embodiment of the present invention, the one-dimensional convolutional neural network includes a first convolutional layer, an ECA module, a pooling layer, a second convolutional layer, and a fully connected layer, wherein the ECA module is located between the first convolutional layer and the pooling layer and is used to enhance feature extraction capability.

[0028] Based on the same inventive concept, another embodiment of the present invention provides a non-destructive testing device for chalkiness in rice grains, the device comprising:

[0029] The data acquisition module is used to collect the initial spectral data of the rice grains to be tested using a near-infrared spectrometer;

[0030] The chalkiness detection module is used to process the initial spectral data of the rice grains to be tested using a rice grain chalkiness detection model to obtain the chalkiness detection results of the rice grains to be tested.

[0031] Based on the same inventive concept, another embodiment of the present invention also provides an electronic device, the electronic device comprising:

[0032] One or more processors;

[0033] A storage device for storing one or more programs, which, when executed by one or more processors, enable the electronic device to perform the non-destructive testing method for chalky rice grains as described in any of the above embodiments.

[0034] Based on the same inventive concept, another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer processor, causes the computer to perform the non-destructive testing method for chalkiness of rice grains as described in any of the above embodiments.

[0035] As described above, this invention provides a non-destructive detection method for chalkiness in rice grains. This method utilizes a near-infrared spectrometer to collect initial spectral data of the rice grains to be tested, and then processes this initial spectral data using a rice grain chalkiness detection model to obtain the chalkiness detection result. This method leverages the rapid, accurate, and non-destructive characteristics of near-infrared spectroscopy. It acquires spectral data of rice grains using a near-infrared spectral acquisition instrument, and then uses feature extraction and data preprocessing techniques to extract key features of chalky and normal grains. Combined with machine learning techniques, it achieves non-destructive detection of chalkiness in rice grains, providing strong support for rice grain quality monitoring and significantly contributing to improving the quality and efficiency of rice production. Of course, implementing any product of this invention does not necessarily require simultaneously achieving all the advantages described above. Attached Figure Description

[0036] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. 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.

[0037] Figure 1 This is a flowchart illustrating a non-destructive testing method for chalkiness in rice grains, provided as an exemplary embodiment of this application.

[0038] Figure 2 A schematic diagram illustrating the process of constructing a chalky rice grain detection model provided for an exemplary embodiment of this application.

[0039] Figure 3 This is a schematic diagram of rice grain spectral acquisition provided for an exemplary embodiment of this application.

[0040] Figure 4 An initial spectral data diagram of a normal rice grain sample provided for an exemplary embodiment of this application.

[0041] Figure 5 An initial spectral data diagram of a chalky rice grain sample provided for an exemplary embodiment of this application.

[0042] Figure 6The image shows a preprocessed spectral data of normal rice grains after correction using SG smoothing and SNV normalization, provided as an exemplary embodiment of this application.

[0043] Figure 7 Preprocessed spectral data of chalky rice grains corrected by SG smoothing and SNV normalization, provided as an exemplary embodiment of this application.

[0044] Figure 8 A preprocessed spectral data image of normal rice grains after correction by SG smoothing and logarithmic processing, provided as an exemplary embodiment of this application.

[0045] Figure 9 A preprocessed spectral data image of chalky rice grains after correction using SG smoothing and logarithmic processing, provided as an exemplary embodiment of this application.

[0046] Figure 10 This is a schematic diagram of the network structure for feature extraction by an autoencoder provided in an exemplary embodiment of this application.

[0047] Figure 11 This is a schematic diagram of the structure of a one-dimensional convolutional neural network provided for an exemplary embodiment of this application.

[0048] Figure 12 This is a schematic diagram of the network structure of an ECA module provided for an exemplary embodiment of this application.

[0049] Figure 13 A schematic diagram of a non-destructive testing device for chalkiness of rice grains, provided as another exemplary embodiment of this application.

[0050] Figure 14 This is a schematic diagram of the structure of an electronic device provided for another exemplary embodiment of this application. Detailed Implementation

[0051] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.

[0052] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0053] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.

[0054] Currently, chalkiness detection in rice is mostly done manually, but this method suffers from drawbacks such as low efficiency, high subjectivity, and a high error rate. Furthermore, computer vision technology is primarily used for surface quality inspection and cannot directly identify whether chalkiness is present in rice grains. While hyperspectral imaging technology can detect internal quality characteristics of rice grains, it requires extensive preprocessing, is slow, and expensive, making it unsuitable for field operations.

[0055] To address the inefficiencies and susceptibility to subjective factors inherent in traditional manual inspection methods, and the difficulty of distinguishing between normal and chalky rice grains using traditional image processing techniques, this invention provides a non-destructive method for detecting chalkiness in rice grains. Leveraging the rapid, accurate, and non-destructive nature of near-infrared spectroscopy, the method acquires spectral data of the rice grains under test using a near-infrared spectral acquisition instrument. Subsequently, feature extraction and data preprocessing techniques are employed to extract key features of the rice grains, and machine learning techniques are combined to achieve non-destructive detection of chalkiness in the rice grains. This method provides strong support for rice grain quality monitoring and is of great significance for improving the quality and efficiency of rice production.

[0056] Please see Figure 1 As shown, the non-destructive testing method for chalkiness in rice grains includes the following steps:

[0057] S100: Initial spectral data of the rice grains to be tested are collected using a near-infrared spectrometer;

[0058] S200: The initial spectral data of the rice grains to be tested are processed using a rice grain chalkiness detection model to obtain the chalkiness detection results of the rice grains to be tested.

[0059] It should be noted that a specific chalkiness detection model for rice grains needs to be constructed in advance before conducting chalkiness detection on the rice grains to be tested.

[0060] Please see Figure 2 As shown, the construction of the rice grain chalkiness detection model includes the following steps:

[0061] S010: Initial spectral data of rice grain samples are collected using a near-infrared spectrometer, wherein the rice grain samples include chalky rice grains and normal rice grains;

[0062] S020: Perform data preprocessing on the initial spectral data of the rice grain sample to obtain preprocessed spectral data of the rice grain sample;

[0063] S030: Use an autoencoder to extract features from the preprocessed spectral data of the rice grain sample to obtain a feature spectral dataset of the rice grain sample.

[0064] S040: Based on the characteristic spectral dataset of the rice grain samples, a one-dimensional convolutional neural network is used to construct the chalky rice grain detection model.

[0065] The following will elaborate on the construction steps of the above-mentioned rice grain chalkiness detection model.

[0066] First, step S010 is performed, which involves using a near-infrared spectrometer to collect initial spectral data of rice grain samples, wherein the rice grain samples include chalky rice grains and normal rice grains.

[0067] In an exemplary embodiment of this application, step S010, which involves acquiring initial spectral data of a rice grain sample using a near-infrared spectrometer, further includes:

[0068] The spectral data of rice grain samples in the 900nm to 1700nm band were collected multiple times using a near-infrared spectrometer, and the average spectral data was calculated as the initial spectral data of the rice grain samples.

[0069] For details, please refer to Figure 3 As shown, Figure 3A schematic diagram of the spectral acquisition process for rice grains is shown. Since rice grains are hulled, their characteristics cannot be directly identified by appearance. Therefore, before spectral acquisition, the hulled rice grains are numbered, and then the spectral data of each grain is acquired and recorded one by one using a near-infrared spectrometer according to the numbering order. It is worth noting that in this embodiment, the near-infrared spectrometer is a GX model Fourier transform infrared spectrometer (i.e., GXFTIR spectrometer). Each rice grain is placed in a small ring cup that matches the near-infrared spectrometer for scanning. The small ring cup is a cylindrical glass sample container. The GX FTIR spectrometer can hold approximately 300 rice grains at a time, and each rice grain sample needs to be scanned three times in the small ring cup. After all rice grain samples have been measured, the breeders remove the hulls from the rice grains in numerical order to determine whether they are chalky rice grains or normal rice grains. In this embodiment, a total of 316 original spectra of rice grain samples were collected using a near-infrared spectrometer across the entire wavelength range (900-1700 nm). The initial spectral data of the acquired rice grain samples are as follows: Figure 4 and Figure 5 As shown, Figure 4 The initial spectral data of normal rice grains in the rice grain sample are shown. Figure 5 The initial spectral data of chalky rice grains in the rice grain sample are shown.

[0070] Next, step S20 is performed, which involves preprocessing the initial spectral data of the rice grain sample to obtain preprocessed spectral data of the rice grain sample.

[0071] In an exemplary embodiment of this application, step S020, performing data preprocessing on the initial spectral data to obtain preprocessed spectral data of the rice grain sample, further includes:

[0072] The initial spectral data were preprocessed using the SG smoothing algorithm and SNV normalization to obtain the preprocessed spectral data of the rice grain sample.

[0073] Specifically, the preprocessing methods include, but are not limited to, one or more combinations of Savitzky-Golay (SG), Standard Normal Variation (SNV) (SNV), and logarithmic processing (LG). In this embodiment, the preprocessing method combines SG smoothing and SNV normalization. SG smoothing reduces noise, and SNV normalization eliminates scattering effects, which can effectively improve model performance. It should be noted that SG smoothing is a data smoothing technique that smooths data by fitting a polynomial, suitable for processing high-frequency noise in spectral data. SNV normalization is used to eliminate scattering effects in spectral data. It calculates the mean and standard deviation of each spectral point and all spectral points at the same wavelength, and then normalizes each point, thereby eliminating the scattering effects caused by factors such as particle size and surface roughness. Logarithmic processing is a linear transformation used to process data with a large range of variation. By compressing the dynamic range of the data, it makes the data more concentrated, facilitating subsequent data analysis and modeling. Please refer to [link to relevant documentation]. Figures 6 to 9 As shown, Figure 6 The preprocessed spectral data of normal rice grains after correction by SG smoothing and SNV normalization are shown. Figure 7 The preprocessed spectral data of chalky rice grains after correction by SG smoothing and SNV normalization are shown. Figure 8 The preprocessed spectral data of normal rice grains after correction by SG smoothing and logarithmic processing are shown. Figure 9 Preprocessed spectral data of chalky rice grains after correction by SG smoothing and logarithmic processing are shown.

[0074] Next, step S030 is executed, which involves using an autoencoder to extract features from the preprocessed spectral data of the rice grain sample to obtain a feature spectral dataset of the rice grain sample.

[0075] In an exemplary embodiment of this application, the autoencoder includes an input layer, a hidden layer, and an output layer. Step S030 involves using the autoencoder to extract features from the preprocessed spectral data of the rice grain sample to obtain a feature spectral dataset of the rice grain sample, further including:

[0076] S031: The input layer receives the preprocessed spectral data of the rice grain sample and inputs the preprocessed spectral data into the hidden layer;

[0077] S032: The hidden layer extracts hidden features from the preprocessed spectral data through weights and activation functions, and inputs the hidden features into the output layer;

[0078] S033: The output layer reconstructs the data based on the hidden features to obtain the feature spectral dataset of the rice grain sample.

[0079] Specifically, an autoencoder (AE) is an unsupervised learning neural network used for feature learning and data dimensionality reduction. It compresses high-dimensional input data into a low-dimensional representation (hidden layer) through an encoding process, and then reconstructs the input data (output layer) through a decoding process, making the reconstructed output data as close as possible to the original input data. Please refer to [link to relevant documentation]. Figure 10 As shown, Figure 10 The network structure of an autoencoder for feature extraction is shown. The autoencoder includes an input layer, a hidden layer, and an output layer. The input layer receives input data, namely preprocessed spectral data of a rice grain sample. The hidden layer encodes the input data, extracting hidden features from the preprocessed spectral data through weights and activation functions. The output layer decodes the hidden features and reconstructs the input data to obtain the feature spectral dataset of the rice grain sample. The input layer of the autoencoder network structure is... The middle hidden layer is ,in The output layer is During the encoding and decoding process of an autoencoder, the data undergoes the following transformations:

[0080]

[0081]

[0082] In the formula, f, g In this embodiment, the activation function is the Sigmoid activation function. These are the weights of neurons in the input and hidden layers; This refers to the bias of neurons in the input and hidden layers; These are the weights of the neurons in the output and hidden layers; This refers to the bias of neurons in the output and hidden layers.

[0083] It should be noted that in this embodiment, the preprocessed spectral data of the rice grain sample is extracted using an autoencoder, and 60 hidden features are obtained from 228 initial features.

[0084] Next, step S040 is executed, which involves constructing a chalky rice grain detection model using a one-dimensional convolutional neural network based on the characteristic spectral dataset of the rice grain sample.

[0085] In an exemplary embodiment of this application, step S40, constructing a chalky rice grain detection model using a one-dimensional convolutional neural network based on the characteristic spectral dataset of the rice grain sample, further includes:

[0086] S041: Divide the feature spectral dataset into a training set and a test set according to a preset ratio;

[0087] S042: Construct an initial detection model using a one-dimensional convolutional neural network, train the initial detection model using a training set, and evaluate the performance of the initial detection model using a test set to obtain the performance evaluation result of the initial detection model;

[0088] S043: Optimize the initial detection model based on the performance evaluation results to obtain the final rice grain chalkiness detection model.

[0089] In an exemplary embodiment of this application, the one-dimensional convolutional neural network includes a first convolutional layer, an ECA module, a pooling layer, a second convolutional layer, and a fully connected layer, wherein the ECA module is located between the first convolutional layer and the pooling layer and is used to enhance feature extraction capabilities.

[0090] Specifically, the `randperm` function is used to generate random permutations of indices from 1 to n to shuffle the feature spectral dataset, where n is the number of samples in the feature spectral dataset. The shuffled dataset is then divided into training and testing sets according to a preset ratio. In this embodiment, the preset ratio is set to 8:2. Of course, in other embodiments, the preset ratio can be customized according to different scenarios and actual application requirements. Please refer to [link to documentation]. Figure 11 As shown, Figure 11 The structure of the one-dimensional convolutional neural network is shown. The one-dimensional convolutional neural network includes an input layer, a first convolutional layer, an efficient channel attention (ECA) module, a batch normalization layer, a one-dimensional max pooling layer, a second convolutional layer, a fully connected layer, a softmax layer, a classification layer, and an output layer. Compared to traditional one-dimensional convolutional neural networks, the one-dimensional convolutional neural network in this embodiment adds an ECA module, which is located between the first convolutional layer and the pooling layer to enhance feature extraction capabilities. Finally, the initial detection model is constructed based on the improved one-dimensional convolutional neural network. Notably, in this embodiment, the activation functions of the first and second convolutional layers are ReLU activation functions, the optimization algorithm selected for the initial detection model is the Adam gradient descent algorithm, and the initial learning rate is set to 0.001.

[0091] It should be noted that the ECA module learns the interrelationships between channels in an efficient manner and dynamically adjusts the channel response intensity accordingly. This avoids the complex dimensionality reduction operations of traditional attention mechanisms, instead using one-dimensional convolution to achieve local interactions across channels. Furthermore, it can adaptively select the convolution kernel size, thereby reducing the number of parameters and computational complexity. Please refer to [link to relevant documentation]. Figure 12 As shown, Figure 12 The network structure of the ECA module is shown. Figure 12 The size of the convolutional kernel K is adaptively determined by the number of channels C, and its calculation formula is as follows:

[0092]

[0093] In the formula, This means taking the absolute value and rounding down to the nearest odd number. .

[0094] When given features High-efficiency channel attention It can be represented as:

[0095]

[0096] in, The learning channel attention band matrix can be represented as:

[0097]

[0098] The channel attention band matrix W contains q*C parameters, which is fewer than the original channel attention mechanism. Each channel feature weight This process can be represented as follows, through interaction with q parameters in the neighborhood:

[0099]

[0100] The feature weights of all channels are shared, meaning they are used together. In this case, the calculation in the above formula can be represented by a one-dimensional convolution with a kernel size of q, which is called efficient channel attention. It can be represented as:

[0101]

[0102] in, This is a one-dimensional convolution operation.

[0103] The above formula is the calculation formula for the ECA module. The ECA module avoids the performance degradation caused by dimensionality reduction, thereby improving the model's spectral feature extraction capability. The ECA module only involves a small number of parameters to suppress invalid features, enabling the one-dimensional convolutional neural network to obtain more robust classification cues. Input data extracts features through the first convolutional layer, and then the batch normalization layer normalizes the data to prevent the one-dimensional convolutional neural network from becoming unstable due to excessively large or small values. Subsequently, it enters the one-dimensional max pooling layer with a pooling window length of 2 and a stride of 2, halving the length of the output data. Next, it passes through the second convolutional layer, where the padding is set to "same," so the length of the output data is the same as the input. Then, the fully connected layer flattens the data and converts it into prediction results for two categories. Next, the Softmax function layer converts the output of the fully connected layer into a probability distribution, making the sum of the prediction probabilities of the two categories equal to 1. Finally, the classification layer calculates the cross-entropy loss based on the true label and the predicted probability, which is used to update the parameters of the one-dimensional convolutional neural network during training, thereby constructing the rice chalkiness detection model. The rice chalkiness detection model ultimately outputs predicted labels. When the rice grain sample is classified as label "1", it is a chalky rice grain. When it is classified as category label "2", it is a normal rice grain, indicating that the rice quality is good.

[0104] Once the rice grain detection model is constructed and its accuracy and reliability are fully verified, it can be used to detect chalkiness in the rice grains to be tested.

[0105] It should be noted that chalkiness is an important quality indicator in rice grains, which is directly related to the taste and nutritional value of rice. Therefore, accurate and rapid detection of chalkiness is of great significance for rice breeding, quality grading and market sales.

[0106] First, step S100 is performed, which involves using a near-infrared spectrometer to collect the initial spectral data of the rice grains to be tested.

[0107] Specifically, an advanced near-infrared spectrometer is used to collect the initial spectral data of the rice grains to be tested. It should be noted that near-infrared spectroscopy is a non-destructive analytical method that reveals the composition and properties of substances by measuring the absorption, reflection, or transmission characteristics of molecules at specific wavelengths. Before collecting spectral data from the rice grains, it is essential to ensure that the parameters of the near-infrared spectrometer are set correctly, such as the scanning range, resolution, and number of scans, to obtain high-quality spectral data. Furthermore, to eliminate the influence of environmental factors, such as changes in temperature, humidity, and light intensity, appropriate calibration and standardization measures must be taken.

[0108] Next, step S200 is executed, which involves processing the initial spectral data of the rice grains to be tested using a rice grain chalkiness detection model to obtain the chalkiness detection results of the rice grains to be tested.

[0109] Specifically, the rice grain chalkiness detection model can learn the complex relationship between spectral characteristics and chalkiness level, and predict new rice grains to be tested based on this relationship. During processing, the rice grain model performs feature extraction, dimensionality reduction, classification, or regression on the input spectral data, ultimately outputting one or more indicators characterizing the degree of chalkiness, such as chalkiness degree or chalky grain rate. These indicators characterizing the degree of chalkiness are directly used to assess the quality grade of the rice grains being tested, providing a scientific basis for subsequent breeding selection, processing, and market positioning.

[0110] In summary, this invention provides a non-destructive detection method for chalkiness in rice grains. This method utilizes a near-infrared spectrometer to acquire initial spectral data of the rice grains to be tested, and then processes this initial spectral data using a rice grain chalkiness detection model to obtain the chalkiness detection results. Based on the rapid, accurate, and non-destructive characteristics of near-infrared spectroscopy, this method acquires spectral data of rice grains using a near-infrared spectral acquisition instrument. Subsequently, feature extraction and data preprocessing techniques are used to extract key features of chalky and normal grains. Combined with machine learning techniques, this achieves non-destructive detection of chalkiness in rice grains, providing strong support for rice grain quality monitoring and playing a significant role in improving the quality and efficiency of rice production.

[0111] Based on the same inventive concept, please refer to Figure 13 As shown, another embodiment of the present invention also provides a non-destructive testing device 11 for chalkiness of rice grains, the device comprising:

[0112] The data acquisition module 111 is used to collect the initial spectral data of the rice grains to be tested using a near-infrared spectrometer.

[0113] The chalkiness detection module 112 is used to process the initial spectral data of the rice grains to be tested using a rice grain chalkiness detection model to obtain the chalkiness detection results of the rice grains to be tested.

[0114] Based on the same inventive concept, please refer to Figure 14 As shown, another embodiment of the present invention also provides an electronic device 1, which may include a memory 12, a processor 13 and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 13, such as a non-destructive testing program for chalkiness of rice grains.

[0115] The memory 12 includes at least one type of readable storage medium, such as flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the electronic device 1, such as a portable hard drive. In other embodiments, the memory 12 can be an external storage device of the electronic device 1, such as a plug-in portable hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 1. Furthermore, the memory 12 can include both internal and external storage units of the electronic device 1. The memory 12 can be used not only to store application software and various types of data installed on the electronic device 1, such as code for non-destructive testing of chalky rice grains, but also to temporarily store data that has been output or will be output.

[0116] In some embodiments, the processor 13 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 13 is the control unit of the electronic device 1, connecting various components of the electronic device 1 through various interfaces and lines. It executes programs or modules stored in the memory 12 (e.g., a non-destructive testing program for chalky rice grains) and calls data stored in the memory 12 to perform various functions and process data in the electronic device 1.

[0117] The processor 13 executes the operating system of the electronic device 1 and various installed applications. The processor 13 executes the applications to implement the steps in the above-described non-destructive testing method for chalkiness in rice grains.

[0118] For example, the computer program may be divided into one or more modules, which are stored in the memory 12 and executed by the processor 13 to complete this application. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into a data acquisition module 110 and a chalkiness detection module 120.

[0119] The integrated unit implemented as a software functional module can be stored in a computer-readable storage medium, which can be non-volatile or volatile. The software functional module, stored in the storage medium, includes several instructions to cause a computer device (which may be a personal computer, computer equipment, or network device, etc.) or processor to execute some functions of the non-destructive testing method for chalkiness of rice grains described in the various embodiments of this application.

[0120] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.

Claims

1. A non-destructive testing method for chalkiness in rice grains, characterized in that, include: Initial spectral data of the rice grains to be tested were collected using a near-infrared spectrometer; The initial spectral data of the rice grains to be tested were processed using a rice grain chalkiness detection model to obtain the chalkiness detection results of the rice grains to be tested. The rice grain chalkiness detection model is constructed in the following manner: Initial spectral data of rice grain samples were collected using a near-infrared spectrometer, wherein the rice grain samples included chalky rice grains and normal rice grains; The initial spectral data of the rice grain sample is preprocessed to obtain the preprocessed spectral data of the rice grain sample. An autoencoder is used to extract features from the preprocessed spectral data of the rice grain sample to obtain a feature spectral dataset of the rice grain sample. The autoencoder includes an input layer, a hidden layer, and an output layer. The input layer receives the preprocessed spectral data of the rice grain sample and inputs the preprocessed spectral data into the hidden layer. The hidden layer extracts hidden features from the preprocessed spectral data through weights and activation functions and inputs the hidden features into the output layer. The output layer reconstructs the data based on the hidden features to obtain the feature spectral dataset of the rice grain sample. Based on the characteristic spectral dataset of the rice grain samples, a one-dimensional convolutional neural network is used to construct the chalkiness detection model for rice grains. The one-dimensional convolutional neural network includes a first convolutional layer, an ECA module, a pooling layer, a second convolutional layer, and a fully connected layer. The ECA module is located between the first convolutional layer and the pooling layer and is used to enhance feature extraction capabilities.

2. The non-destructive testing method for chalkiness in rice grains according to claim 1, characterized in that, The initial spectral data of rice grain samples acquired using a near-infrared spectrometer include: The spectral data of rice grain samples in the 900nm to 1700nm band were collected multiple times using a near-infrared spectrometer, and the average spectral data was calculated as the initial spectral data of the rice grain samples.

3. The non-destructive testing method for chalkiness in rice grains according to claim 1, characterized in that, The step of preprocessing the initial spectral data to obtain preprocessed spectral data of the rice grain sample includes: The initial spectral data were preprocessed using the SG smoothing algorithm and SNV normalization to obtain the preprocessed spectral data of the rice grain sample.

4. The non-destructive testing method for chalkiness in rice grains according to claim 1, characterized in that, The step of constructing a chalky rice grain detection model using a one-dimensional convolutional neural network based on the characteristic spectral dataset of the rice grain sample includes: The feature spectral dataset is divided into a training set and a test set according to a preset ratio; An initial detection model is constructed using a one-dimensional convolutional neural network. The initial detection model is trained using a training set, and its performance is evaluated using a test set to obtain the performance evaluation result of the initial detection model. The initial detection model is optimized based on the performance evaluation results to obtain the final rice grain chalkiness detection model.

5. A non-destructive testing device for chalkiness in rice grains, characterized in that, The method for non-destructive testing of chalkiness in rice grains as described in any one of claims 1 to 4 is implemented by the apparatus, the apparatus comprising: The data acquisition module is used to collect the initial spectral data of the rice grains to be tested using a near-infrared spectrometer; The chalkiness detection module is used to process the initial spectral data of the rice grains to be tested using a rice grain chalkiness detection model to obtain the chalkiness detection results of the rice grains to be tested.

6. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the non-destructive testing method for chalkiness of rice grains as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by the computer's processor, causes the computer to perform the non-destructive testing method for chalkiness of rice grains as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Agricultural product detection method and device, electronic equipment and computer readable storage medium

    CN117392432A