Rice taste value detection method and rice taste value detection instrument
Through the rice food taste value detection method, the rice food taste value is predicted using visible light images and models, and the problem of cumbersome and subjective influence of rice food taste quality evaluation in the prior art is solved, and a fast and accurate food taste quality evaluation is achieved.
Patent Information
- Application Number
- CN202510499927.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-08-26
AI Technical Summary
The existing rice food taste quality evaluation methods have problems such as cumbersome operation, long-term operation and are easily affected by subjective factors of the evaluation personnel, resulting in insufficient reproducibility of the results.
The rice food taste value detection method is adopted, and by obtaining multiple visible light images and inputting the food taste value detection model, integrating multi-view information, establishing the connection between the rice appearance and food taste value, using residual network and regression head to predict food taste value, and combining color correction technology to improve detection accuracy.
It realizes rapid and accurate evaluation of rice food taste quality, high standardization of the detection process, stable and reliable results, avoiding the cumbersome operation and subjective influence of traditional methods.
Smart Images

Figure CN120544173A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of food testing technology, and in particular relates to a rice taste value detection method and a rice taste value detection instrument. Background Art
[0002] Rice is an important part of people's daily diet, and its taste quality as a key quality attribute has received widespread attention.
[0003] Currently, rice taste quality is evaluated primarily through physical and chemical indices and sensory evaluation. The physical and chemical indices method indirectly assesses rice taste quality by measuring physical and chemical indices related to taste quality, such as amylose content, protein content, and gel consistency, and establishing a predictive model. The sensory evaluation method, which involves visual observation, olfactory identification, and chewing characteristics testing, relies on the subjective experience of professional evaluators to assess rice quality.
[0004] However, the pretreatment process of the physical and chemical index method is complicated, and there are problems such as cumbersome operation and long time consumption; the sensory evaluation method is easily affected by the subjective factors of the evaluators, resulting in insufficient repeatability of the evaluation results and poor stability of the results. Summary of the Invention
[0005] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a rice taste value detection method and rice taste value detection instrument, which can quickly and accurately evaluate the taste quality of rice, with a highly standardized detection process and stable and reliable results.
[0006] In a first aspect, the present application provides a method for detecting the taste value of rice, the method comprising:
[0007] Acquire a plurality of first visible light images of a rice sample to be tested, wherein the rice sample to be tested is obtained by processing a preset cooking procedure, and different first visible light images correspond to different shooting angles;
[0008] inputting the plurality of first visible light images into a taste value detection model respectively, and obtaining a first taste value corresponding to each of the first visible light images output by the taste value detection model;
[0009] determining a taste score of the rice sample under the cooking process based on the first taste values of the plurality of first visible light images;
[0010] The taste value detection model is obtained by training sample visible light images and sample labels corresponding to the sample visible light images.
[0011] According to the rice taste value detection method of the present application, the rice sample to be tested is prepared through a preset steaming program, the first visible light images at different shooting angles are obtained for analysis, the first taste value is output by the taste value detection model, and the taste value score of the rice sample to be tested is determined by integrating multi-perspective information. The rice taste quality can be evaluated quickly and accurately, the detection process is highly standardized, and the results are stable and reliable.
[0012] According to one embodiment of the present application, inputting the plurality of first visible light images into a taste value detection model respectively to obtain a first taste value corresponding to each of the first visible light images output by the taste value detection model includes:
[0013] performing image interception on the first visible light image to obtain a plurality of first partial images;
[0014] acquiring a local taste value of each of the first partial images based on the taste value detection model;
[0015] The first taste value of the first visible light image is determined based on the local taste values of the plurality of first partial images.
[0016] According to one embodiment of the present application, the taste value detection model is trained by the following steps:
[0017] Inputting the sample visible light image into the taste value detection model to be trained to obtain a sample prediction value output by the taste value detection model;
[0018] Determining a target loss function of the taste value detection model based on the sample prediction value and the sample label;
[0019] Based on the target loss function, the model parameters of the taste value detection model are updated.
[0020] According to one embodiment of the present application, inputting the sample visible light image into the taste value detection model to be trained to obtain the predicted appearance value and the predicted taste value output by the taste value detection model includes:
[0021] Performing image interception on the sample visible light image to obtain a plurality of sample partial images;
[0022] Inputting the sample partial image into the taste value detection model to be trained to obtain a local prediction value output by the taste value detection model;
[0023] The sample prediction value of the sample visible light image is determined based on the local prediction values of the multiple sample partial images.
[0024] According to one embodiment of the present application, determining the target loss function of the taste value detection model based on the sample prediction value and the sample label includes:
[0025] When the prediction error between the sample prediction value and the sample label is less than or equal to a preset parameter threshold, the L2 loss function is used as the target loss function;
[0026] Alternatively, when the prediction error between the sample prediction value and the sample label is greater than the preset parameter threshold, the L1 loss function is used as the target loss function.
[0027] According to one embodiment of the present application, the taste value detection model includes an input layer, a residual network, and a regression head connected in sequence;
[0028] Inputting the plurality of first visible light images into a taste value detection model respectively to obtain a first taste value corresponding to each of the first visible light images output by the taste value detection model includes:
[0029] Inputting the first visible light image into the input layer and performing convolution processing to obtain a first feature map output by the input layer;
[0030] Inputting the first feature map into the residual network, extracting color features and morphological features, and obtaining first image features output by the residual network;
[0031] The first image feature is input into the regression head for regression processing to obtain the first taste value output by the regression head.
[0032] According to one embodiment of the present application, after acquiring a plurality of first visible light images of the rice sample to be tested and before inputting the plurality of first visible light images into the taste value detection model, the method further includes:
[0033] Color correction is performed on each of the first visible light images.
[0034] In a second aspect, the present application provides a rice taste value detection instrument, comprising:
[0035] The shell forms a closed detection chamber, and the rice sample to be tested obtained by the preset cooking process is placed in the detection chamber;
[0036] an image acquisition system for acquiring a plurality of first visible light images of the rice sample to be tested, wherein different first visible light images correspond to different shooting angles;
[0037] An image processing system is connected to the image acquisition system, and is used to determine the taste value score of the rice sample to be tested under the steaming process based on the rice taste value detection method described in the first aspect.
[0038] According to one embodiment of the present application, the shell is coated with a diffuse reflection material, and the image acquisition system includes a light source module and a camera. The light source module and the diffuse reflection material are used to provide a lighting environment for the detection chamber so that the camera can capture visible light images.
[0039] According to one embodiment of the present application, a rotating device is provided in the detection chamber, and the rice sample to be tested is placed on the rotating device. The rotating device is used to drive the rice sample to be tested to rotate so that the image acquisition system can capture visible light images at different shooting angles.
[0040] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for detecting the rice taste value as described in the first aspect above is implemented.
[0041] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the rice taste value detection method as described in the first aspect above.
[0042] In a fifth aspect, the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the rice taste value detection method as described in the first aspect.
[0043] In a sixth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the rice taste value detection method as described in the first aspect above.
[0044] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0046] Figure 1 1 is a flow chart of a method for detecting the taste of rice provided in an embodiment of the present application;
[0047] Figure 2Schematic diagram of the structure of the rice taste value detection instrument provided in the embodiment of the present application;
[0048] Figure 3 1 is a schematic diagram of the process of color correction of the rice taste value detection instrument provided in an embodiment of the present application;
[0049] Figure 4 This is a schematic diagram of the process of detecting the taste value of rice by the rice taste value detection instrument provided in an embodiment of the present application;
[0050] Figure 5 2 is a schematic diagram of correlation analysis between the taste value output by the taste value detection model provided in the embodiment of the present application and the artificial taste value;
[0051] Figure 6 This is a schematic diagram of the correlation analysis between the taste value detected by the taste meter and the artificial taste value in the related art;
[0052] Figure 7 2 is a schematic diagram of correlation analysis between the appearance value predicted by the taste value detection model provided in the embodiment of the present application and the artificial appearance value;
[0053] Figure 8 It is a structural diagram of an electronic device provided in an embodiment of the present application.
[0054] Reference numerals:
[0055] Housing 200 , detection chamber 210 , light source module 310 , camera 320 , rotating device 410 , container 420 , main control module 510 , power module 520 . DETAILED DESCRIPTION
[0056] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.
[0057] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.
[0058] The rice taste value detection method, rice taste value detection device, electronic device and readable storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.
[0059] The rice taste value detection method provided in the embodiment of the present application can be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the rice taste value detection method. The rice taste value detection method provided in the embodiment of the present application is explained below using an electronic device as an example of the execution body.
[0060] like Figure 1 As shown, the rice taste value detection method includes: step 110, step 120 and step 130.
[0061] Step 110: Acquire a plurality of first visible light images of the rice sample to be tested.
[0062] The rice sample to be tested is obtained through a preset cooking process, and different first visible light images correspond to different shooting angles.
[0063] In this embodiment, rice is cooked according to a preset cooking program, and a rice sample to be tested is prepared according to a standardized sample preparation process. The rice sample to be tested is imaged from different shooting angles to obtain multiple first visible light images of the rice sample to be tested.
[0064] It is understandable that processing rice according to a preset steaming procedure can reduce the impact of steaming on the taste quality of rice, and standardizing the sampling process can also reduce the impact of sampling on the taste quality of rice.
[0065] For example, after putting the rice into water, wash it 10 times clockwise and 10 times counterclockwise, and then soak it for 30 minutes.
[0066] Set the rice-to-water ratio to 1:1.35, use a certain brand of fixed model rice cooker to steam for 40 minutes, and simmer for 10 minutes. After steaming, open the lid and use a rice spoon to stir the rice in the pot to ensure that the rice is evenly mixed.
[0067] The sample is prepared according to the standardized sample preparation process. A certain amount of rice is taken out from the pot and placed in the container 420. The rice is gently flattened with chopsticks to reduce damage to the rice grain structure, thereby preparing the rice sample to be tested.
[0068] It can be understood that capturing visible light images of the rice sample to be tested from different shooting angles can reduce the influence of the shooting angle on the prediction of the taste value.
[0069] For example, the rice sample to be tested is rotated 10°-45° each time, and visible light images of the rice sample to be tested are captured from different shooting angles to obtain multiple first visible light images with different shooting angles, thereby acquiring multi-viewing angle information of the rice sample to be tested.
[0070] Taking the rice sample to be tested as an example of rotating 45 degrees each time, visible light images of the rice sample to be tested are captured from different shooting angles, and eight first visible light images with different shooting angles can be obtained.
[0071] Step 120: Input the plurality of first visible light images into a taste value detection model respectively, and obtain a first taste value corresponding to each first visible light image output by the taste value detection model.
[0072] Among them, the taste value detection model is trained by sample visible light images and sample labels corresponding to the sample visible light images.
[0073] In this step, the first visible light image is input into the taste value detection model, and the first visible light image is detected by the taste value detection model to obtain the first taste value corresponding to the first visible light image. The taste value detection model detects multiple first visible light images respectively to obtain multiple first taste values.
[0074] It should be noted that the taste value detection model can extract the visual features of visible light images, establish a connection between the visual features of rice (i.e., appearance) and the sensory evaluation criteria (i.e., taste value), and predict the taste value corresponding to the output visible light image.
[0075] Step 130 : Determine a taste score of the rice sample under the cooking process based on the first taste values of the plurality of first visible light images.
[0076] In this embodiment, the taste value detection model can output a first taste value for each first visible light image input, and the taste value score of the rice sample to be tested under the steaming process can be obtained based on the multiple first taste values corresponding to the multiple first visible light images.
[0077] In actual implementation, the mean, median, weighted average or mode of the plurality of first taste values may be used as the taste value score of the rice sample to be tested under the steaming process.
[0078] For example, eight first visible light images taken at different angles are obtained, and the eight first visible light images are respectively input into the taste value detection model to obtain eight first taste values output by the taste value detection model: 8, 9, 8, 7, 9, 8, 8, 7, with an average of 8, that is, the taste value score of the rice sample to be tested under the steaming process is 8.
[0079] In related technologies, near-infrared spectrometers are used to measure components such as amylose and protein in rice to indirectly infer the taste quality of rice. This method requires specific instruments such as near-infrared spectrometers. Spectral data are easily affected by environmental temperature and humidity, sample morphology errors, etc., resulting in insufficient generalization ability of the prediction model. The measurement process also requires pre-processing of the rice such as shelling and grinding, which destroys the sample and is cumbersome to operate.
[0080] In the embodiment of the present application, the steamed rice is analyzed by visible light image analysis. The visible light image is easy to obtain and does not require a specific type of spectral instrument. The steaming procedure is simple, time-saving, and easy to standardize. There is no need to destroy the sample, and non-destructive detection of the rice taste value can be achieved. By fusing visual features and sensory scoring labels, an end-to-end taste value detection model is established, which directly links the appearance of rice with the taste value. At the same time, based on visible light images taken at different shooting angles, multi-perspective information is integrated to comprehensively evaluate the taste quality of the rice sample to be tested, which can effectively improve the accuracy of the taste value score and accurately detect the taste value of rice of different varieties and under different steaming procedures. The detection process is highly standardized and the results are stable and reliable.
[0081] According to the rice taste value detection method provided in the embodiment of the present application, a rice sample to be tested is prepared through a preset steaming program, first visible light images from different shooting angles are obtained for analysis, a first taste value is output by a taste value detection model, and the taste value score of the rice sample to be tested is determined by integrating multi-perspective information. This can quickly and accurately evaluate the taste quality of rice, the detection process is highly standardized, and the results are stable and reliable.
[0082] In some embodiments, inputting the plurality of first visible light images into the taste value detection model respectively to obtain the first taste value corresponding to each of the first visible light images output by the taste value detection model may include:
[0083] Performing image interception on the first visible light image to obtain a plurality of first partial images;
[0084] Obtaining a local taste value of each first partial image based on a taste value detection model;
[0085] A first taste value of the first visible light image is determined based on the partial taste values of the plurality of first partial images.
[0086] It should be noted that by capturing the first visible light image and using the first partial image for prediction, the influence of the arrangement of rice grains on the taste value prediction can be reduced, so that the taste value detection model pays more attention to the shape and color of the rice grains, thereby improving the prediction accuracy.
[0087] In this embodiment, a first visible light image is input into a palatability value detection model, and an image cutout (also called a slicing operation) is performed on the first visible light image to extract a plurality of first partial images from the first visible light image. The palatability value detection model predicts a palatability value for each of the first partial images to obtain partial palatability values for the plurality of first partial images. Based on the plurality of partial palatability values, the first palatability value corresponding to the first visible light image is determined.
[0088] In actual implementation, the mean, median, weighted average or mode of the plurality of local taste values may be used as the first taste value corresponding to the first visible light image.
[0089] For example, the resolution of the first visible light image is 2448*2048. A center-cutting method is adopted to extract a first local image with a resolution of 448*448 from the first visible light image for prediction, thereby reducing the influence of rice grain arrangement on the taste value prediction and improving the accuracy of the taste value prediction.
[0090] In some embodiments, the taste value detection model includes an input layer, a residual network, and a regression head connected in sequence.
[0091] In this embodiment, inputting the plurality of first visible light images into the taste value detection model respectively and obtaining the first taste value corresponding to each of the first visible light images output by the taste value detection model may include:
[0092] Input the first visible light image into the input layer and perform convolution processing to obtain a first feature map output by the input layer;
[0093] Inputting the first feature map into the residual network, extracting color features and morphological features, and obtaining the first image features output by the residual network;
[0094] The first image feature is input into the regression head for regression processing to obtain a first taste value output by the regression head.
[0095] Among them, the input layer performs convolution processing on the visible light image, completes preliminary feature extraction, outputs the first feature map to the residual network, conducts in-depth analysis of the color features and morphological features in the first feature map through the residual network, outputs the first image feature to the regression head, and uses the regression algorithm of the regression head to accurately predict the taste value.
[0096] In this embodiment, the taste value detection model is a regression model, which directly inputs a visible light image to predict the specific numerical value of the taste value. A regression head including a global average pooling layer (GAP) and three fully connected layers (FC) can be designed to complete the regression task of predicting the taste value.
[0097] In actual implementation, the ResNet series models (such as ResNet18, ResNet50, etc.) can be selected as the backbone network of the taste value detection model. For the scenario of rice taste value prediction, experiments have shown that the complexity of the ResNet18 model can meet the prediction requirements, improve detection efficiency, and achieve lightweight equipment deployment.
[0098] In some embodiments, the taste value detection model is trained by the following steps:
[0099] Inputting the sample visible light image into the taste value detection model to be trained to obtain the sample prediction value output by the taste value detection model;
[0100] Determine the target loss function of the taste value detection model based on the sample prediction value and sample label;
[0101] Based on the target loss function, the model parameters of the taste value detection model are updated.
[0102] In this embodiment, the taste value detection model predicts the taste value of the sample visible light image, outputs the sample prediction value, uses the target loss function to quantify the error between the sample prediction value and the sample label, adjusts the model parameters of the taste value detection model according to the error, performs prediction and calculates the loss function again, and iterates this process until the model converges or meets the predetermined conditions, minimizes the target loss function, and obtains a trained taste value detection model.
[0103] It can be understood that the taste value detection model extracts the visual features of the visible light image and establishes a connection between the appearance of rice and the taste value. The sample label may include a sample appearance value label and a sample taste value label corresponding to the sample appearance value label. The sample appearance value label is a label corresponding to the visual features of the visible light image, and the sample taste value label is a label of the taste value of the visible light image. Through the sample appearance value label and the sample taste value label, the taste value detection model is trained to establish a connection between the appearance of rice and the taste value, and accurately predict the taste value of rice.
[0104] In this embodiment, the sample label includes a sample appearance value label and a sample taste value label, and the sample prediction value output by the taste value detection model may include a sample appearance prediction value and a sample taste prediction value.
[0105] It should be noted that, in the application stage of the taste value detection model, the input of the taste value detection model is the visible light image, and the output of the taste value detection model is the taste value.
[0106] In some embodiments, inputting the sample visible light image into the taste value detection model to be trained and obtaining the predicted appearance value and the predicted taste value output by the taste value detection model may include:
[0107] Performing image interception on the sample visible light image to obtain multiple sample local images;
[0108] Inputting the sample local image into the taste value detection model to be trained to obtain the local prediction value output by the taste value detection model;
[0109] Based on the local prediction values of the plurality of sample local images, a sample prediction value of the sample visible light image is determined.
[0110] It is understandable that during the training stage of the taste value detection model, the visible light image can be cropped and the taste value can be predicted based on the local image. During the application stage of the taste value detection model, the visible light image can also be cropped and the taste value can be predicted based on the local image to reduce the impact of rice grain arrangement on the taste value prediction.
[0111] In this embodiment, image capture is performed on the sample visible light image, and multiple sample local images are captured from the sample visible light image. The taste value detection model predicts the taste value of each sample local image to obtain local prediction values of the multiple sample local images. Based on the multiple local prediction values, the sample prediction value corresponding to the sample visible light image is determined.
[0112] In actual implementation, data such as the mean, median, weighted average or mode of multiple local prediction values can be used as the sample prediction value corresponding to the sample visible light image.
[0113] It should be noted that in the model training stage, the mean of multiple local prediction values is used as the sample prediction value, and in the model application stage, the mean of multiple local taste values is used as the sample prediction value. A unified data processing strategy can be adopted in the model training stage and the model application stage.
[0114] It is understandable that the design of the objective loss function directly affects the robustness of the taste value detection model to noise and outliers and the optimization efficiency.
[0115] In some embodiments, determining the target loss function of the taste value detection model based on the sample prediction value and the sample label includes:
[0116] When the prediction error between the sample prediction value and the sample label is less than or equal to the preset parameter threshold, the L2 loss function is used as the target loss function;
[0117] Alternatively, when the prediction error between the sample prediction value and the sample label is greater than a preset parameter threshold, the L1 loss function is used as the target loss function.
[0118] In this embodiment, by presetting the parameter threshold, the target loss function of the taste value detection model is switched between the L2 loss function (mean square error, MSE) and the L1 loss function (mean absolute error, MAE).
[0119] When the prediction error between the sample prediction value and the sample label is less than or equal to the preset parameter threshold, the L2 loss function is used to improve the gradient smoothness and convergence efficiency; when the prediction error between the sample prediction value and the sample label is greater than the preset parameter threshold, the L1 loss function is used to suppress the influence of outliers.
[0120] For example, the preset parameter threshold is δ, the sample prediction value is y, and the sample label is y^. When the prediction error |yy^|≤δ, the L2 loss function is used; when the prediction error |yy^|>δ, the L1 loss function is used.
[0121] In this embodiment, the prediction error of the sample prediction value and the sample label is compared with the preset parameter threshold. When the prediction error is less than or equal to the preset parameter threshold, the second-order differentiability of the L2 loss is inherited in the small error area, supporting efficient gradient descent and Newton method optimization. When the prediction error is greater than the preset parameter threshold, the robustness of the L1 loss to outliers is inherited in the large error area, avoiding model deviation due to abnormal samples.
[0122] It can be understood that the size of the preset parameter threshold can be adaptively adjusted to flexibly control the adaptability of the taste value detection model to the noise distribution. When the preset parameter threshold approaches 0, the target loss function can be equivalent to the L1 loss function, which enhances the robustness to outliers; when the preset parameter threshold approaches infinity, the target loss function can be equivalent to the L2 loss function, which focuses on fitting small errors; in practical applications, the preset parameter threshold can take the sample median absolute deviation (MAD) to adapt to the noise distribution of the data.
[0123] In this embodiment, a preset parameter threshold is introduced to enable the model to switch between the L1 loss function and the L2 loss function. The tuning cost is low and the computational overhead is small. Compared with simple L1 or L2 loss, it can significantly improve the prediction stability of the regression model in complex real-world scenarios such as the taste value detection model and accelerate convergence.
[0124] It is understandable that a large number of sample visible light images can be used to train the taste value detection model, which helps the taste value detection model to learn the distribution characteristics of the input data more comprehensively, improve the generalization ability of the taste value detection model, and help the taste value detection model make accurate predictions.
[0125] A specific embodiment is described below.
[0126] Sample visible light images of 322 rice samples were collected, with each sample corresponding to 300 images. The resolution of the sample visible light images was 2448*2048.
[0127] A random image cutting operation is performed to randomly cut out a local sample image of size 448*448 from the original sample visible light image to reduce the impact of rice grain arrangement on the model prediction results. The local sample image can also be horizontally flipped and the brightness jittered to reduce the impact of experimental factors such as lighting and position changes on the model prediction results.
[0128] The sample local image with a resolution of 448*448 obtained by the image cutting operation is input into the taste value detection model to predict the sample local image. Each sample local image corresponds to a sample taste value label and a sample appearance value label. The sample taste value label can be obtained by manual evaluation. The model parameters of the taste value detection model are updated according to the target loss function determined by the sample prediction value and the sample label to complete the training of the taste value detection model.
[0129] The AdamW solver can be used for model training, with batch_size set to 128, the basic learning rate lr = 3e-4, the learning rate reduction factor of each epoch is decay = 0.05, the total training iteration Epoch is 1200, and the early stopping strategy is adopted during training. When there is no improvement in the verification loss after 10 consecutive epochs, the entire training process is terminated.
[0130] Each rice sample has 300 images. A sample-centric sampling strategy is adopted. In each training batch, only one image is extracted from one sample to ensure the diversity of samples in each batch and improve the generalization ability of the trained model.
[0131] In some embodiments, after acquiring a plurality of first visible light images of the rice sample to be tested, and before inputting the plurality of first visible light images into the taste value detection model, the rice taste value detection method may further include:
[0132] Color correction is performed on each first visible light image.
[0133] In this embodiment, by performing color correction on the first visible light image, adjusting the color distribution of the image, and reducing color deviation caused by illumination changes, sensor differences, or white balance imbalance, the image color is made closer to the color of steamed rice in the real scene, which can significantly improve the accuracy of subsequent taste value prediction.
[0134] In actual implementation, under the same lighting environment, the same camera 320 can be used to capture multiple first visible light images with different shooting angles. The image acquisition system composed of the light source module 310 and the camera 320 is color-corrected in advance, and a color correction matrix corresponding to the image acquisition system is constructed to accurately reflect the errors of each color channel in the imaging process. The color correction matrix is used to perform color correction on each first visible light image.
[0135] The embodiment of the present application also provides a rice taste value detection instrument.
[0136] like Figure 2 As shown, the rice taste value detection instrument includes a housing 200, an image acquisition system and an image processing system.
[0137] The housing 200 forms a closed detection chamber 210 , and the rice sample to be tested obtained by a preset cooking process is placed in the detection chamber 210 .
[0138] It should be noted that the detection chamber 210 formed by the shell 200 is closed. The shell 200 can be provided with a door, which is opened and the rice sample to be tested is placed in and then closed to form a closed detection chamber 210, thereby reducing the impact of the environment on the imaging of the image acquisition system.
[0139] The image acquisition system is used to acquire multiple first visible light images of the rice sample to be tested, and different first visible light images correspond to different shooting angles.
[0140] In some embodiments, the shell 200 is coated with a diffuse reflective material, and the image acquisition system includes a light source module 310 and a camera 320. The light source module 310 and the diffuse reflective material are used to provide a lighting environment for the detection chamber 210 so that the camera 320 can capture visible light images.
[0141] In this embodiment, active lighting is performed by the light source module 310 to improve the color stability of the image captured by the camera 320, and the housing 200 is coated with a diffuse reflection material to achieve uniform lighting and reduce environmental interference.
[0142] In actual implementation, the diffuse reflection material can be barium sulfate (BaSO4) coating, magnesium oxide (MgO) coating, titanium dioxide (TiO2) coating and other materials.
[0143] In some embodiments, a rotating device 410 is provided in the detection chamber 210 , and the rice sample to be tested is placed on the rotating device 410 . The rotating device 410 is used to drive the rice sample to be tested to rotate so that the image acquisition system can capture visible light images at different shooting angles.
[0144] In this embodiment, a container 420 containing a rice sample to be tested is placed on a rotating device 410. The rotating device 410 drives the rice sample to be tested to rotate, so that the camera 320 can capture multiple visible light images with different shooting angles at a fixed position, thereby reducing the influence of the shooting angle on the taste value prediction.
[0145] It is understandable that in other embodiments, the position of the rice sample to be tested may be fixed, and the shooting angle of the camera 320 may be adjusted to capture multiple visible light images at different shooting angles.
[0146] The image processing system is connected to the image acquisition system, and is used to determine the taste value score of the rice sample to be tested under the steaming process according to the above-mentioned rice taste value detection method.
[0147] It is understandable that the rice taste value detection instrument can also include a power module 520 and a main control module 510. The power module 520 can provide power for the image acquisition system, and the main control module 510 can control the movement of the image acquisition system and the rotating device 410 to capture multiple visible light images with different shooting angles.
[0148] According to the rice taste value detection instrument provided in the embodiment of the present application, a rice sample to be tested is prepared through a preset steaming program, first visible light images from different shooting angles are obtained for analysis, a first taste value is output by a taste value detection model, and the taste value score of the rice sample to be tested is determined by integrating multi-perspective information. This can quickly and accurately evaluate the taste quality of rice, the detection process is highly standardized, and the results are stable and reliable.
[0149] In some embodiments, color correction may be performed on the image acquisition system to improve the accuracy of the visible light images acquired by the image acquisition system.
[0150] The following is a specific color correction process.
[0151] like Figure 3 As shown, the device is turned on, the light source module 310 and the camera 320 are turned on, the light source parameters of the light source module 310 are fixed, a standard 24-color card is placed in the detection chamber 210, and the door is closed to avoid interference from ambient light.
[0152] Use Camera 320 to capture a color card image and locate the positions of the 24 color card color blocks. Separate the channels and calculate the RGB channel mixing coefficients. Extract the color eigenvalues of each color block in the image and compare these values with pre-set standard colorimetric parameters. Calculate color offset and construct a color correction matrix to compensate for color errors in each channel. Perform color transformation and determine whether the color eigenvalues in the image are close to the standard colorimetric parameters. Use the least squares method to fit and calculate the color correction matrix to accurately reflect the errors in each color channel during the imaging process.
[0153] In this embodiment, when using the rice taste value detection instrument, the visible light image captured by the image acquisition system is color corrected using a color correction matrix, which helps to improve the accuracy of taste value prediction.
[0154] The following is a specific taste value detection process.
[0155] After putting the rice into water, wash it 10 times clockwise and 10 times counterclockwise, then soak it for 30 minutes.
[0156] Set the rice-to-water ratio to 1:1.35, use a certain brand of fixed model rice cooker to steam for 40 minutes, and simmer for 10 minutes. After steaming, open the lid and use a rice spoon to stir the rice in the pot to ensure that the rice is evenly mixed.
[0157] The sample is prepared according to the standardized sample preparation process. A certain amount of rice is taken out from the pot and placed in the container 420. The rice is gently flattened with chopsticks to reduce damage to the rice grain structure, thereby preparing the rice sample to be tested.
[0158] like Figure 4 As shown, the rice sample to be tested, which has been prepared through a preset cooking process, is placed into the detection chamber 210 and the door is closed to reduce the influence of ambient light.
[0159] Start the camera 320 and the light source module 310 to provide a uniform lighting environment in the detection chamber 210. The camera 320 can be an industrial camera, and the light source module 310 can be a 6500K light source with a high color rendering index, which can truly restore the color of rice and improve color accuracy and consistency.
[0160] During the shooting process, the camera 320 works in conjunction with the rotating device 410. The rotating device 410 drives the container 420 containing the rice sample to be tested to randomly rotate 10°-45° each time, capturing images from different angles, obtaining multi-view information, and obtaining at least 6 visible light images.
[0161] Under the monitoring of the image acquisition system, observe whether there are holes between the rice grains of the rice sample to be tested. If holes are found, adjustments are made to fill the holes while trying to maintain the integrity of the rice grain structure.
[0162] After shooting is completed, all visible light images are processed through a pre-established color correction matrix. The corrected visible light images are input into the taste value detection model for taste value prediction. The taste value is accurately predicted through the regression algorithm to complete the entire detection process.
[0163] For a certain variety of rice, 100 visible light images can be collected, and three rice samples to be tested are prepared for each variety of rice. Each variety has 300 visible light images, and the taste value is predicted by the taste value detection model. The average taste value of the 300 visible light images will be used as the final taste value score of the rice variety under the current steaming procedure.
[0164] In order to verify the technical effect of the embodiment of the present application in predicting the taste value of rice, for a certain variety of rice, the taste value detection model of the embodiment of the present application was used to predict the taste value, the taste meter in the related technology (Satake SATAKE STA1A taste meter) was used to detect the taste value, and the sensory evaluation method was used to manually evaluate the taste value.
[0165] Figure 5 FIG. 1 is a schematic diagram showing the correlation analysis between the taste value output by the taste value detection model of the present application and the artificial taste value. Figure 5 As shown in the figure, the correlation coefficient between the taste value output by the taste value detection model and the artificial taste value is R 2 =0.666, where Predicted Score is the taste value output by the model, IVOE Score is the artificial taste value, the blue origin of the actual data of rice varieties (Actual Data) corresponds to IVOE Score on the horizontal axis, and Predicted Score on the vertical axis, and Linear fit is the linear fit of IVOE Score and Predicted Score, indicating the correlation coefficient between the taste value output by the taste value detection model and the artificial taste value.
[0166] Figure 6 The figure shows the correlation analysis between the taste value detected by the taste meter and the artificial taste value in the related art. Figure 6 As shown in the figure, the correlation coefficient between the taste value detected by the SATAKE STA1A taste meter and the artificial taste value is R 2 =0.408, where Predicted Score is the taste value detected by the taste meter, IVOE Score is the artificial taste value, the blue origin of the actual data of rice varieties (Actual Data) corresponds to IVOE Score on the horizontal axis, and Predicted Score on the vertical axis, and Linear fit is the linear fit of IVOE Score and Predicted Score, indicating the correlation coefficient between the taste value output by the taste value detection model and the artificial taste value.
[0167] The correlation coefficient R corresponding to the taste value detection model of the embodiment of the present application 2 =0.666, which is higher than the R corresponding to the SATAKE STA1A taste meter 2=0.408, indicating that the taste value detection model has a higher accuracy in predicting taste value.
[0168] also, Figure 7 FIG. 1 is a schematic diagram showing the correlation analysis between the appearance value predicted by the taste value detection model and the artificial appearance value according to an embodiment of the present application. Figure 7 As shown in the figure, the correlation coefficient between the appearance value predicted by the taste value detection model and the artificial appearance value is R 2 =0.722, indicating that the taste value detection model can effectively capture the visual characteristics of rice after cooking. Predicted Score is the appearance value predicted by the taste meter, Appearance Score is the manual appearance value, the blue origin of the actual data (Actual Data) of the rice variety corresponds to Appearance Score on the horizontal axis, and Predicted Score on the vertical axis. Linear fit is the linear fit of Appearance Score and Predicted Score, representing the correlation coefficient between the appearance value output by the taste value detection model and the manual appearance value.
[0169] In some embodiments, as Figure 8 As shown, the embodiment of the present application also provides an electronic device 800, including a processor 801, a memory 802, and a computer program stored in the memory 802 and executable on the processor 801. When the program is executed by the processor 801, each process of the above-mentioned rice taste value detection method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0170] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0171] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned rice taste value detection method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0172] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0173] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned rice taste value detection method when executed by a processor.
[0174] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0175] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned rice taste value detection method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0176] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0177] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0178] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0179] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
[0180] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0181] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and purpose of the present application, and that the scope of the present application is defined by the claims and their equivalents.
Claims
1. A method for detecting the taste value of rice, characterized in that: include: Acquire a plurality of first visible light images of a rice sample to be tested, wherein the rice sample to be tested is obtained by processing a preset cooking procedure, and different first visible light images correspond to different shooting angles; inputting the plurality of first visible light images into a taste value detection model respectively, and obtaining a first taste value corresponding to each of the first visible light images output by the taste value detection model; determining a taste score of the rice sample under the cooking process based on the first taste values of the plurality of first visible light images; The taste value detection model is obtained by training sample visible light images and sample labels corresponding to the sample visible light images.
2. The rice taste value detection method according to claim 1, characterized in that: Inputting the plurality of first visible light images into a taste value detection model respectively to obtain a first taste value corresponding to each of the first visible light images output by the taste value detection model includes: performing image interception on the first visible light image to obtain a plurality of first partial images; acquiring a local taste value of each of the first partial images based on the taste value detection model; The first taste value of the first visible light image is determined based on the local taste values of the plurality of first partial images.
3. The rice taste value detection method according to claim 1, wherein The taste value detection model is trained by the following steps: Inputting the sample visible light image into the taste value detection model to be trained to obtain a sample prediction value output by the taste value detection model; Determining a target loss function of the taste value detection model based on the sample prediction value and the sample label; Based on the target loss function, the model parameters of the taste value detection model are updated.
4. The rice taste value detection method according to claim 3, characterized in that: Inputting the sample visible light image into the taste value detection model to be trained to obtain the predicted appearance value and the predicted taste value output by the taste value detection model includes: Performing image interception on the sample visible light image to obtain a plurality of sample partial images; Inputting the sample partial image into the taste value detection model to be trained to obtain a local prediction value output by the taste value detection model; The sample prediction value of the sample visible light image is determined based on the local prediction values of the multiple sample partial images.
5. The rice taste value detection method according to claim 3, characterized in that: Determining the target loss function of the taste value detection model based on the sample prediction value and the sample label includes: When the prediction error between the sample prediction value and the sample label is less than or equal to a preset parameter threshold, the L2 loss function is used as the target loss function; Alternatively, when the prediction error between the sample prediction value and the sample label is greater than the preset parameter threshold, the L1 loss function is used as the target loss function.
6. The rice taste value detection method according to any one of claims 1 to 5, characterized in that: The taste value detection model includes an input layer, a residual network and a regression head connected in sequence; Inputting the plurality of first visible light images into a taste value detection model respectively to obtain a first taste value corresponding to each of the first visible light images output by the taste value detection model includes: Inputting the first visible light image into the input layer and performing convolution processing to obtain a first feature map output by the input layer; Inputting the first feature map into the residual network, extracting color features and morphological features, and obtaining first image features output by the residual network; The first image feature is input into the regression head for regression processing to obtain the first taste value output by the regression head.
7. The rice taste value detection method according to any one of claims 1 to 5, characterized in that: After acquiring a plurality of first visible light images of the rice sample to be tested, and before inputting the plurality of first visible light images into the taste value detection model respectively, the method further includes: Color correction is performed on each of the first visible light images.
8. A rice taste value detection instrument, characterized in that: include: The shell forms a closed detection chamber, and the rice sample to be tested obtained by the preset cooking process is placed in the detection chamber; an image acquisition system for acquiring a plurality of first visible light images of the rice sample to be tested, wherein different first visible light images correspond to different shooting angles; An image processing system is connected to the image acquisition system, and the image processing system is used to determine the taste value score of the rice sample to be tested under the steaming process based on the rice taste value detection method according to any one of claims 1 to 7.
9. The rice taste value detection instrument according to claim 8, characterized in that: The shell is coated with a diffuse reflection material. The image acquisition system includes a light source module and a camera. The light source module and the diffuse reflection material are used to provide a lighting environment for the detection chamber so that the camera can capture visible light images.
10. The rice taste value detection instrument according to claim 8 or 9, characterized in that: A rotating device is provided in the detection chamber, and the rice sample to be tested is placed on the rotating device. The rotating device is used to drive the rice sample to be tested to rotate, so that the image acquisition system can capture visible light images at different shooting angles.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the rice taste value detection method according to any one of claims 1 to 7 is implemented.
12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting the taste value of rice according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Food detection method and system based on surface enhanced Raman spectroscopy and visual identification
CN115810187A
Peanut legume quality detection and classification method based on improved ResNet
CN116912573A
Method for detecting soluble solids in fruits, electronic equipment and storage medium
CN117853423A
Method and device for determining moisture state of cooking target rice, rice immersion time determination device, and rice cooking facility
JP2017122607A
Machine learning-based assessment of food item quality
US20230214982A1
