A method, device, equipment and storage medium for classifying food chewing characteristics
Patent Information
- Application Number
- CN202610664769.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-14
- Publication Date
- 2026-09-29
AI Technical Summary
尹娴婷等(2024)参考《粮油检验 稻谷、大米蒸煮食用品质感官评价方法》对三种米饭的弹性和粘性、软硬度进行打分,它可以反应人体真实的咀嚼感受,但个体差异较大,难以精细区分,感官评价误差较大
[0015]本发明包括但不限于如下有益效果:(1)本方案通过整合质构剖面分析、仿真咀嚼测试及应力松弛测试,从静态力学、动态形变及材料流变学三个维度捕捉食品在口腔环境中的复杂响应,为模型提供了高保真、高信息密度的输入数据,克服了传统单一测试方法的信息局限性;(2)本方案设计了一种深度学习网络,利用一维卷积神经网络提取质构参数的局部特征模式,自注意力机制捕捉不同参数间的内在相关性权重,以及深度多层感知机进行最终的非线性映射,并在各层中系统性地应用批归一化与LeakyReLU激活函数以提升训练效率与非正值数据的拟合能力,同时借助Dropout技术有效抑制过拟合现象,增强了模型对复杂样本空间的泛化能力;(3)通过绘制混淆矩阵、分析非对角线元素分布来精准评估各模型对不同咀嚼等级的区分度,并结合准确率、精确率、召回率及F1分数等综合性能指标,对多种候选架构进行客观筛选,进而采用加权集成的策略融合各基础模型的优势,形成最终的分级决策机制,实现了从原始物理参数到最终咀嚼等级的映射,提升了食品品质感官评价的自动化水平与可靠性。
Smart Images

Figure CN122839098A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of food chewing characteristic analysis technology, specifically relating to a method, apparatus, equipment and storage medium for classifying food chewing characteristics. Background Technology
[0002] Grading food texture can provide maximum convenience for elderly people with varying degrees of chewing difficulties and is also an important prerequisite for achieving standardized food production based on grading. Human taste experience mainly stems from the combined effects of sensory and physical changes during chewing. Caine et al. (2003) demonstrated through regression analysis of TPA parameters that hardness and adhesion can explain the tenderness variations in rib steaks. This conclusion provides a quantitative basis for chewing grading and allows for comprehensive food grading in conjunction with tenderness indicators. Shen et al. (2016) had subjects chew materials of varying hardness and analyzed their texture using surface electromyography (EMG). The results showed that when the food texture was harder, the EMG activity triggered by chewing was more intense, and more muscles were involved in chewing. Ma et al. (2024) explored the chewing characteristics of rice and their causes. This study organized sensory experiments, assessing rice texture by having volunteers record chewing time, number of chews, and chewing frequency. The results showed a positive correlation between these indicators. Liu Zhenjun et al. (2024) integrated fracture mechanics with food texture to establish a method for evaluating the brittleness of konjac glucomannan gel based on puncture fracture testing, providing a new approach for constructing gel texture evaluation methods based on fracture behavior. Zhou Xingyu (2024) established methods for evaluating the texture of gel candies based on biomimetic chewing, and ultimately constructed a predictive model for the chewing efficiency of gel candies by studying the influence of texture and chewing parameters on chewing efficiency. Zhang Hongxiao et al. (2021) used a texture analyzer to measure the fruit texture parameters of fresh sweet peppers after harvest, and found that the TPA texture parameters of different varieties of fruits showed basically the same trend, and there was a high positive correlation between hardness, elasticity and chewiness. Franks et al. (2020) used three-dimensional digital technology to construct a biomimetic oral chewing model, and measured parameters such as chewing efficiency and chewing force by simulating the chewing behavior of the human mandible and mandibular movement. Yin Xianting et al. (2024) used the "Sensory Evaluation Method for Steamed and Cooked Rice Quality of Grain and Oil Inspection" to score the elasticity, stickiness, and softness / hardness of three types of rice. This method can reflect the real chewing experience of the human body, but individual differences are large, making it difficult to distinguish precisely, and the sensory evaluation error is relatively large.
[0003] Therefore, in response to the increasingly serious trend of population aging in my country and the widespread chewing and swallowing dysfunction among the elderly, it is necessary to construct an artificial intelligence-based method for evaluating chewing characteristics in order to improve the accuracy of sensory evaluation. Summary of the Invention
[0004] In view of the shortcomings of the prior art, the purpose of this invention is to provide a method, apparatus, equipment and storage medium for classifying the chewing characteristics of food.
[0005] According to one aspect of this application, a method for grading the chewing characteristics of food is disclosed, the method comprising: Obtain the texture parameters of the sample to be tested, wherein the texture parameters include at least one or more of the following: texture profile analysis parameters, simulated texture parameters, and stress relaxation parameters; The texture parameters are input into a pre-trained ensemble classification model for grading to obtain the chewing characteristic grading results of the test sample output by the ensemble classification model. The ensemble classification model is obtained based on the analysis and comparison of the confusion matrix and comprehensive evaluation index of multiple base models on the test set. The base models include at least a deep multilayer perceptron model, a self-attention classification network model, and a convolutional neural network model. The deep multilayer perceptron model contains multiple sequentially connected fully connected layers, and each fully connected layer is optimized using batch normalization, Dropout, and LeakyReLU activation functions. The self-attention classification network model includes an embedding layer and a multi-head self-attention layer to learn the correlation weights between different texture parameters. The convolutional neural network model is used to extract local feature patterns of the input texture parameters through at least one one-dimensional convolutional block, where each one-dimensional convolutional block contains a one-dimensional convolutional layer, a batch normalization layer, and a LeakyReLU activation function.
[0006] In some embodiments, the construction of a deep multilayer perceptron model satisfies: The activation function is defined as: LeakyReLU: ; In the formula, The output value after processing by the activation function. For the data input to this layer, The negative slope is a hyperparameter that controls the degree of tilt of the function on the negative half-axis, with a default value of 0.01. Dropout is limited to: during training, using probability... Set the neuron's output to zero; BatchNorm satisfies: ; In the formula, To represent the output value obtained after batch normalization, This represents the average of the current batch of data. The variance of the current batch of data. The scaling parameters learned by this layer. These are the translation parameters learned by this layer. This is a smoothing term.
[0007] In some embodiments, the construction of a self-attention classification network model satisfies: The embedding layer is defined as: ; In the formula, This represents the output matrix after the embedding layer transformation. For input data, For embedding matrix, The bias vector of the embedding layer. for Data dimensions and their spatial location, among which, Let B be the real number field, meaning all elements in the matrix are real numbers, and let B be the number of samples processed in the current input. This represents the length of each transformed vector; The multi-head self-attention layer is defined as: For each attention head : ; In the formula, Attention represents the output of the h-th attention head, and h is the index number of the attention head. Let h be the query vector in the attention head. Let h be the key vector in the h-th attention head. Let h be the value vector in the h-th attention head. The square root of the dimension of the key vector; Multi-head attention output: ; In the formula, This represents the hidden layer output of the network after processing by the multi-head attention mechanism. `Concat` represents the concatenation operation. To output the projection matrix, This is the output bias vector; Cross-entropy loss function: ; In the formula, L is the loss value. The normalization coefficient is... To sum over the sample dimensions, To sum over the category dimension, The labels are real numbers, and log is the natural logarithm. The probability predicted by the model. This represents the Softmax probability.
[0008] In some embodiments, the construction of a convolutional neural network model satisfies: The convolution operation of the first convolutional layer satisfies: ; In the formula, This is the output feature map obtained after the first convolutional operation. The data input to this convolutional layer, The function that performs the first convolution operation. This represents a one-dimensional convolution operation. Represents the convolution kernel. Indicates the bias term. Let be the dimension of the convolution kernel weights, where 1 represents the number of output channels, 1 represents the number of input channels, and k represents the length of the convolution kernel; The output shape is: ; In the formula, B is the number of samples processed in the current input, and D represents the length of the output feature map; The first-level batch normalization satisfies: ; In the formula, This is the output tensor after processing by the first batch normalization layer. This is the standard representation of a one-dimensional batch normalization function in deep learning frameworks. For learnable scaling parameters, This is the average value of the current batch. For learnable offset parameters, The standard deviation of the current batch of data. It is a constant; The first-layer activation function satisfies: ; In the formula, The output tensor is processed using the LeakyReLU activation function. For activation function representation, This is the positive part of the activation function. The activation function is used to process the negative input portion; The second convolutional layer satisfies: ; In the formula, This is the output of the second convolutional layer. The function to perform the second convolution operation. This is the output of the first layer after activation by the function. These are the weights of the convolutional kernel in the second layer. For the bias term of the second layer; The second-level batch normalization satisfies: ; In the formula, This is the output tensor after processing by the second batch normalization layer. This is the standard representation of a one-dimensional batch normalization function in deep learning frameworks. For learnable scaling parameters, The mean, For learnable offset parameters, For standard deviation, It is a constant; The second-layer activation function satisfies: ; In the formula, This is the output of the second layer after activation by the function; The flattening operation is as follows: ; In the formula, F is the flattened eigenvector. The operation of converting a multidimensional feature map into a one-dimensional vector. For the reshaping operation, The shape changed to , This indicates that the flattened data F is a real tensor; The first fully connected layer satisfies: ; In the formula, This is the output of the fully connected layer. This is the weight matrix of the fully connected layer. For the bias term of the fully connected layer, The input features are those of the fully connected layer. Define the weight matrix The size of the dimension, where H represents the output dimension. Indicates the input dimension. Define bias terms Dimension size; The activation function of a fully connected layer satisfies: ; Dropout regularization satisfies: ; In the formula, M is the output tensor of the Dropout layer. The function that performs the Dropout operation, where H is the input tensor of the Dropout layer. For Bernoulli mask, The i-th element in the mask m follows the parameter . Bernoulli distribution, This represents the probability of discarding. The output layer satisfies: ; In the formula, For the output layer's results, The weight matrix of the output layer. For the input data of the output layer, For the bias term of the output layer, Define the weight matrix Dimensions Define bias terms Dimensions.
[0009] In some embodiments, obtaining the texture parameters of the sample to be tested includes: The sample to be tested is subjected to a texture profile analysis test using a physical property analyzer to obtain the texture profile analysis parameters, which include at least hardness, adhesion, elasticity, cohesion, adhesiveness, chewiness, and resilience. The sample to be tested is subjected to a simulated chewing test using a physical property analyzer. The test simulates at least two compression processes to obtain the simulated texture parameters, which include at least firmness and chewiness. The stress relaxation parameters are obtained by performing stress relaxation tests on the sample under test using a physical property analyzer. The stress relaxation parameters include at least the elastic modulus and the relaxation time.
[0010] In some embodiments, the method further includes constructing the ensemble classification model, including: A food sample set is obtained, wherein the food sample set includes multiple food samples, each food sample has multiple sample texture parameters measured by a texture analyzer, and its corresponding chewing characteristic grade label is obtained through sensory evaluation; For the sample texture parameters, at least two different deep learning classification models with different architectures are constructed in parallel. Each deep learning classification model is trained independently, and the performance of each model is evaluated on an independent test set to obtain a comprehensive performance index. The evaluated performance index includes at least accuracy, precision, recall and F1 score calculated based on the confusion matrix. By comparing and analyzing the confusion matrix and comprehensive evaluation index of each model on the test set, at least one model is selected from the various deep learning classification models as the base model. Based on the aforementioned basic model, the ensemble classification model is constructed, and the output of the ensemble classification model is a weighted sum of the outputs of each basic model.
[0011] In some embodiments, the method further includes building a base model, including: Draw confusion matrix diagrams for each candidate model on the test set, where the rows of the confusion matrix represent the true chewing characteristic level and the columns represent the chewing characteristic level predicted by the model. The candidate models are deep multilayer perceptron models and / or convolutional neural network models. By analyzing the numerical distribution of off-diagonal elements in the confusion matrix, the discriminative power of each model at each level is identified, and the confusion level category pairs are determined. Calculate the accuracy, precision, recall, and F1 score for each candidate model to obtain a comprehensive performance metric. The basic model is determined based on the confusion level category pairs and the comprehensive performance index.
[0012] According to another aspect of this application, a food chewing characteristic grading device is also disclosed, the device comprising: The texture parameter acquisition module is used to acquire the texture parameters of the sample to be tested. The texture parameters include at least one or more of the following: texture profile analysis parameters, simulated texture parameters, and stress relaxation parameters. The chewing characteristic grading result determination module is used to input the texture parameters into a pre-trained ensemble classification model for grading, so as to obtain the chewing characteristic grading result of the test sample output by the ensemble classification model. The ensemble classification model is obtained based on the analysis and comparison of the confusion matrix and comprehensive evaluation index of multiple base models on the test set. The base models include at least a deep multilayer perceptron model, a self-attention classification network model, and a convolutional neural network model. The deep multilayer perceptron model contains multiple sequentially connected fully connected layers, and each fully connected layer is optimized using batch normalization, Dropout, and LeakyReLU activation functions. The self-attention classification network model includes an embedding layer and a multi-head self-attention layer, used to learn the correlation weights between different texture parameters. The convolutional neural network model is used to extract local feature patterns of the input texture parameters through at least one one-dimensional convolutional block, where each one-dimensional convolutional block contains a one-dimensional convolutional layer, a batch normalization layer, and a LeakyReLU activation function.
[0013] According to another aspect of this application, an electronic device is also disclosed, the electronic device including a memory and at least one processor, the memory storing instructions; the at least one processor invokes the instructions in the memory to cause the electronic device to perform the various steps of food chewing characteristic grading as described in any of the preceding claims.
[0014] According to another aspect of this application, a computer-readable storage medium is also disclosed, on which instructions are stored, which, when executed by a processor, implement the various steps of food chewing characteristic grading as described in any of the preceding claims.
[0015] The present invention includes, but is not limited to, the following beneficial effects: (1) This scheme integrates texture profile analysis, simulated chewing test and stress relaxation test to capture the complex response of food in the oral environment from three dimensions: static mechanics, dynamic deformation and material rheology, providing the model with high-fidelity and high-information-density input data, overcoming the information limitations of traditional single test methods; (2) This scheme designs a deep learning network, uses a one-dimensional convolutional neural network to extract local feature patterns of texture parameters, a self-attention mechanism to capture the intrinsic correlation weights between different parameters, and a deep multilayer perceptron to perform the final nonlinear mapping, and systematically applies batch normalization and Leaky in each layer. The ReLU activation function is used to improve training efficiency and fitting ability of non-positive data. At the same time, the Dropout technique is used to effectively suppress overfitting and enhance the model's generalization ability to complex sample spaces. (3) By drawing a confusion matrix and analyzing the distribution of off-diagonal elements, the discrimination of each model to different chewing levels is accurately evaluated. Combined with comprehensive performance indicators such as accuracy, precision, recall and F1 score, multiple candidate architectures are objectively screened. Then, the advantages of each basic model are integrated by weighted integration strategy to form the final graded decision mechanism, realizing the mapping from the original physical parameters to the final chewing level, and improving the automation level and reliability of food quality sensory evaluation. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0017] Figure 1 This is a flowchart of a food chewing characteristic grading method according to an embodiment of this application; Figure 2 This is a flowchart illustrating the process of obtaining texture parameters according to an embodiment of this application. Figure 3 This is a flowchart illustrating the construction process of the integrated classification model in an embodiment of this application. Figure 4 This is a flowchart illustrating the construction process of the basic model in the embodiments of this application; Figure 5 This is a structural block diagram of a food chewing characteristic grading device according to an embodiment of this application; Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0018] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0019] For ease of understanding, the specific process of the embodiments of the present invention will be described below. Figure 1 This is a flowchart illustrating the food chewing characteristic grading of an embodiment of this application. (See attached document.) Figure 1 This includes the following steps: S100: Obtain the texture parameters of the sample to be tested.
[0020] The texture parameters include at least one or more of the following: texture profile analysis parameters, simulated texture parameters, and stress relaxation parameters.
[0021] S102. Input the texture parameters into the pre-trained ensemble classification model for grading, so as to obtain the grading results of the chewing characteristics of the test sample output by the ensemble classification model.
[0022] The ensemble classification model is derived from the analysis and comparison of confusion matrices and comprehensive evaluation metrics of multiple base models on the test set. The base models include at least a deep multilayer perceptron model, a self-attention classification network model, and a convolutional neural network model. The deep multilayer perceptron model contains multiple sequentially connected fully connected layers, and each fully connected layer is optimized using batch normalization, Dropout, and LeakyReLU activation functions. The self-attention classification network model includes an embedding layer and a multi-head self-attention layer, which are used to learn the correlation weights between different texture parameters. The convolutional neural network model is used to extract local feature patterns of the input texture parameters through at least one one-dimensional convolutional block, where each one-dimensional convolutional block contains a one-dimensional convolutional layer, a batch normalization layer, and a LeakyReLU activation function.
[0023] The construction of the deep multilayer perceptron model satisfies the following: The activation function is defined as: LeakyReLU: ; In the formula, The output value after processing by the activation function. For the data input to this layer, The negative slope is a hyperparameter that controls the degree of tilt of the function on the negative half-axis, with a default value of 0.01. Dropout is limited to: during training, using probability... Set the neuron's output to zero; BatchNorm satisfies: ; In the formula, To represent the output value obtained after batch normalization, This represents the average of the current batch of data. The variance of the current batch of data. The scaling parameters learned by this layer. These are the translation parameters learned by this layer. This is a smoothing term.
[0024] According to the food chewing characteristic grading method of claim 1, the self-attention classification network model is constructed to satisfy: The embedding layer is defined as: ; In the formula, This represents the output matrix after the embedding layer transformation. For input data, For embedding matrix, The bias vector of the embedding layer. for Data dimensions and their spatial location, among which, Let B be the real number field, meaning all elements in the matrix are real numbers, and let B be the number of samples processed in the current input. This represents the length of each transformed vector; The multi-head self-attention layer is defined as: For each attention head : ; In the formula, Attention represents the output of the h-th attention head, and h is the index number of the attention head. Let h be the query vector in the attention head. Let h be the key vector in the h-th attention head. Let h be the value vector in the h-th attention head. The square root of the dimension of the key vector; Multi-head attention output: ; In the formula, This represents the hidden layer output of the network after processing by the multi-head attention mechanism. `Concat` represents the concatenation operation. To output the projection matrix, This is the output bias vector; Cross-entropy loss function: ; In the formula, L is the loss value. The normalization coefficient is... To sum over the sample dimensions, To sum over the category dimension, The labels are real numbers, and log is the natural logarithm. The probability predicted by the model. This represents the Softmax probability.
[0025] In some embodiments, the construction of a convolutional neural network model satisfies: The convolution operation of the first convolutional layer satisfies: ; In the formula, This is the output feature map obtained after the first convolutional operation. The data input to this convolutional layer, The function that performs the first convolution operation. This represents a one-dimensional convolution operation. Represents the convolution kernel. Indicates the bias term. Let be the dimension of the convolution kernel weights, where 1 represents the number of output channels, 1 represents the number of input channels, and k represents the length of the convolution kernel; The output shape is: ; In the formula, B is the number of samples processed in the current input, and D represents the length of the output feature map; The first-level batch normalization satisfies: ; In the formula, This is the output tensor after processing by the first batch normalization layer. This is the standard representation of a one-dimensional batch normalization function in deep learning frameworks. For learnable scaling parameters, This is the average value of the current batch. For learnable offset parameters, The standard deviation of the current batch of data. It is a constant; The first-layer activation function satisfies: ; In the formula, The output tensor is processed using the LeakyReLU activation function. For activation function representation, This is the positive part of the activation function. The activation function is used to process the negative input portion; The second convolutional layer satisfies: ; In the formula, This is the output of the second convolutional layer. The function to perform the second convolution operation. This is the output of the first layer after activation by the function. These are the weights of the convolutional kernel in the second layer. For the bias term of the second layer; The second-level batch normalization satisfies: ; In the formula, This is the output tensor after processing by the second batch normalization layer. This is the standard representation of a one-dimensional batch normalization function in deep learning frameworks. For learnable scaling parameters, The mean, For learnable offset parameters, For standard deviation, It is a constant; The second-layer activation function satisfies: ; In the formula, This is the output of the second layer after activation by the function; The flattening operation is as follows: ; In the formula, F is the flattened eigenvector. The operation of converting a multidimensional feature map into a one-dimensional vector. For the reshaping operation, The shape changed to , This indicates that the flattened data F is a real tensor; The first fully connected layer satisfies: ; In the formula, This is the output of the fully connected layer. This is the weight matrix of the fully connected layer. For the bias term of the fully connected layer, The input features are those of the fully connected layer. Define the weight matrix The size of the dimension, where H represents the output dimension. Indicates the input dimension. Define bias terms Dimension size; The activation function of a fully connected layer satisfies: ; Dropout regularization satisfies: ; In the formula, M is the output tensor of the Dropout layer. The function that performs the Dropout operation, where H is the input tensor of the Dropout layer. For Bernoulli mask, The i-th element in the mask m follows the parameter . Bernoulli distribution, This represents the probability of discarding. The output layer satisfies: ; In the formula, For the output layer's results, The weight matrix of the output layer. For the input data of the output layer, For the bias term of the output layer, Define the weight matrix Dimensions Define bias terms Dimensions.
[0026] In some embodiments, see Figure 2 Obtaining the textural parameters of the sample to be tested includes: S200. Use a physical property analyzer to perform texture profile analysis on the sample to obtain texture profile analysis parameters.
[0027] The container is a petri dish lid with a diameter of 55 mm and a height of 9 mm. The texture testing probe is a P / 36R with a speed of 1 mm / s before, during and after the test, a trigger force of 5 g, and a deformation compression of 50%. The texture profile analysis parameters include at least hardness, adhesiveness, elasticity, cohesion, adhesiveness, chewiness and resilience.
[0028] S202. Simulated chewing test is performed on the sample to be tested using a physical property analyzer.
[0029] The container was a petri dish lid with a diameter of 90 mm and a height of 6 mm. The speed before, during and after the test was 1 mm / s, the trigger force was 5 g, and the deformation compression was 50%. At least two compression processes were simulated for the test to obtain simulated texture parameters, including simulated data of molars, incisors, and canines. The simulated texture parameters included firmness and chewiness.
[0030] S204. Perform stress relaxation test on the sample under test using a physical property analyzer.
[0031] The container is a petri dish lid with a diameter of 90 mm and a height of 6 mm. The speed before, during and after the measurement is 1 mm / s, the triggering force is 5 g, and the deformation compression is 50%, in order to obtain stress relaxation parameters. The stress relaxation parameters include at least the elastic modulus and relaxation time.
[0032] In some embodiments, see Figure 3 Building an ensemble classification model includes: S300, Obtain a food sample set.
[0033] The food sample set includes multiple food samples. For each food sample, multiple texture parameters were measured using a texture analyzer. Three methods were employed for index testing: texture analysis, three simulation methods, and stress relaxation. A rice standard was introduced (standard preparation method: by varying the amount of water added and cooking time, rice with different chewiness levels was produced. The rice chewiness level was determined using the JTPA method). Subsequently, a link was established between the rice standard and sensory evaluation, and finally, the corresponding chewiness characteristic level label was obtained through sensory evaluation.
[0034] S302. For the sample texture parameters, construct at least two deep learning classification models with different architectures in parallel.
[0035] Classification models include multilayer perceptron models, self-attention classification networks, and convolutional classification networks.
[0036] S304. Train each deep classification model independently and evaluate the performance of each model on an independent test set to obtain a comprehensive performance index.
[0037] The performance metrics evaluated include at least accuracy, precision, recall, and F1 score, calculated based on the confusion matrix.
[0038] S306. Compare and analyze the confusion matrix and comprehensive evaluation index of each model on the test set, and select at least one model from a variety of deep learning classification models as the base model.
[0039] S308. Based on the basic models, construct an ensemble classification model. The output of the ensemble classification model is the weighted sum of the outputs of each basic model.
[0040] In some embodiments, see Figure 4 Build a basic model, including: S400. Draw the confusion matrix diagram of each candidate model on the test set.
[0041] The confusion matrix consists of rows representing the true chewing characteristic levels and columns representing the chewing characteristic levels predicted by the model. The two most promising models are selected by comprehensively evaluating the ROC curve, PR curve, and their accuracy, precision, recall, and F1 score: the deep multilayer perceptron model and / or the convolutional neural network model.
[0042] S402. By analyzing the numerical distribution of off-diagonal elements in the confusion matrix, identify the discriminative power of each model at each level and determine the confusion level category pairs.
[0043] S404. Calculate the accuracy, precision, recall, and F1 score of each candidate model to obtain a comprehensive performance index.
[0044] S406. Based on confusion level category pairs and comprehensive performance indicators, determine the basic model.
[0045] Furthermore, Figure 5 This is a structural block diagram of the food chewing characteristic grading device according to an embodiment of the application, such as... Figure 5 As shown, the device includes: The texture parameter acquisition module is used to acquire the texture parameters of the sample to be tested. The texture parameters include at least one or more of the following: texture profile analysis parameters, simulated texture parameters, and stress relaxation parameters. The chewing characteristic grading result determination module is used to input texture parameters into a pre-trained ensemble classification model for grading, so as to obtain the chewing characteristic grading result of the test sample output by the ensemble classification model. The ensemble classification model is obtained by analyzing and comparing the confusion matrix and comprehensive evaluation index of multiple base models on the test set. The base models include at least a deep multilayer perceptron model, a self-attention classification network model, and a convolutional neural network model. The deep multilayer perceptron model contains multiple fully connected layers connected in sequence, and batch normalization, Dropout, and LeakyReLU activation functions are used to optimize each fully connected layer. The self-attention classification network model includes an embedding layer and a multi-head self-attention layer, which is used to learn the correlation weights between different texture parameters. The convolutional neural network model is used to extract the local feature patterns of the input texture parameters through at least one one-dimensional convolutional block, where each one-dimensional convolutional block contains a one-dimensional convolutional layer, a batch normalization layer, and a LeakyReLU activation function.
[0046] The application of the relevant modules of the device in this example can be referred to the relevant introduction of the method principle above, and will not be repeated here.
[0047] above Figure 6 The food chewing characteristic grading device in this embodiment of the invention will be described in detail from the perspective of modular functional entities. The electronic device in this embodiment of the invention will be described in detail from the perspective of hardware processing.
[0048] Figure 6 This is a schematic diagram of the structure of an electronic device 600 provided in an embodiment of the present invention. The electronic device 600 can vary significantly due to differences in configuration or performance, and may include one or more central processing units (CPUs) 610 and memory 620, and one or more storage media 630 for storing application programs 633 or data 632. The memory 620 and storage media 630 can be temporary or persistent storage. The program stored in the storage media 630 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the electronic device 600. Furthermore, the processor 610 may be configured to communicate with the storage media 630 and execute the series of instruction operations in the storage media 630 on the electronic device 600.
[0049] Electronic device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input / output interfaces 660, and / or one or more operating systems 631, such as Windows Server, MacOSX, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 6 The illustrated electronic device structure does not constitute a limitation on electronic devices and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0050] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of any of the above-described food chewing characteristic grading methods.
[0051] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0052] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0053] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. In some embodiments, see Figure 2 Obtaining the textural parameters of the sample to be tested includes: S200. Use a physical property analyzer to perform texture profile analysis on the sample to obtain texture profile analysis parameters.
[0054] The container is a petri dish lid with a diameter of 55 mm and a height of 9 mm. The texture testing probe is a P / 36R with a speed of 1 mm / s before, during and after the test, a trigger force of 5 g, and a deformation compression of 50%. The texture profile analysis parameters include at least hardness, adhesiveness, elasticity, cohesion, adhesiveness, chewiness and resilience.
[0055] S202. Simulated chewing test is performed on the sample to be tested using a physical property analyzer.
[0056] The container was a petri dish lid with a diameter of 90 mm and a height of 6 mm. The speed before, during and after the test was 1 mm / s, the trigger force was 5 g, and the deformation compression was 50%. At least two compression processes were simulated for the test to obtain simulated texture parameters, including simulated data of molars, incisors, and canines. The simulated texture parameters included firmness and chewiness.
[0057] S204. Perform stress relaxation test on the sample under test using a physical property analyzer.
[0058] The container is a petri dish lid with a diameter of 90 mm and a height of 6 mm. The speed before, during and after the measurement is 1 mm / s, the triggering force is 5 g, and the deformation compression is 50%, in order to obtain stress relaxation parameters. The stress relaxation parameters include at least the elastic modulus and relaxation time.
[0059] In some embodiments, see Figure 3 Building an ensemble classification model includes: S300, Obtain a food sample set.
[0060] The food sample set includes multiple food samples. For each food sample, multiple texture parameters were measured using a texture analyzer. Three methods were employed for index testing: texture analysis, three simulation methods, and stress relaxation. A rice standard was introduced (standard preparation method: by varying the amount of water added and cooking time, rice with different chewiness levels was produced. The rice chewiness level was determined using the JTPA method). Subsequently, a link was established between the rice standard and sensory evaluation, and finally, the corresponding chewiness characteristic level label was obtained through sensory evaluation.
[0061] S302. For the sample texture parameters, construct at least two deep learning classification models with different architectures in parallel.
[0062] Classification models include multilayer perceptron models, self-attention classification networks, and convolutional classification networks.
[0063] S304. Train each deep classification model independently and evaluate the performance of each model on an independent test set to obtain a comprehensive performance index.
[0064] The performance metrics evaluated include at least accuracy, precision, recall, and F1 score, calculated based on the confusion matrix.
[0065] S306. Compare and analyze the confusion matrix and comprehensive evaluation index of each model on the test set, and select at least one model from a variety of deep learning classification models as the base model.
[0066] S308. Based on the basic models, construct an ensemble classification model. The output of the ensemble classification model is the weighted sum of the outputs of each basic model.
[0067] In some embodiments, see Figure 4 Build a basic model, including: S400. Draw the confusion matrix diagram of each candidate model on the test set.
[0068] The confusion matrix consists of rows representing the true chewing characteristic levels and columns representing the chewing characteristic levels predicted by the model. The two most promising models are selected by comprehensively evaluating the ROC curve, PR curve, and their accuracy, precision, recall, and F1 score: the deep multilayer perceptron model and / or the convolutional neural network model.
[0069] S402. By analyzing the numerical distribution of off-diagonal elements in the confusion matrix, identify the discriminative power of each model at each level and determine the confusion level category pairs.
[0070] S404. Calculate the accuracy, precision, recall, and F1 score of each candidate model to obtain a comprehensive performance index.
[0071] S406. Based on confusion level category pairs and comprehensive performance indicators, determine the basic model.
[0072] Furthermore, Figure 5 This is a structural block diagram of the food chewing characteristic grading device according to an embodiment of the application, such as... Figure 5 As shown, the device includes: The texture parameter acquisition module is used to acquire the texture parameters of the sample to be tested. The texture parameters include at least one or more of the following: texture profile analysis parameters, simulated texture parameters, and stress relaxation parameters. The chewing characteristic grading result determination module is used to input texture parameters into a pre-trained ensemble classification model for grading, so as to obtain the chewing characteristic grading result of the test sample output by the ensemble classification model. The ensemble classification model is obtained by analyzing and comparing the confusion matrix and comprehensive evaluation index of multiple base models on the test set. The base models include at least a deep multilayer perceptron model, a self-attention classification network model, and a convolutional neural network model. The deep multilayer perceptron model contains multiple fully connected layers connected in sequence, and batch normalization, Dropout, and LeakyReLU activation functions are used to optimize each fully connected layer. The self-attention classification network model includes an embedding layer and a multi-head self-attention layer, which is used to learn the correlation weights between different texture parameters. The convolutional neural network model is used to extract the local feature patterns of the input texture parameters through at least one one-dimensional convolutional block, where each one-dimensional convolutional block contains a one-dimensional convolutional layer, a batch normalization layer, and a LeakyReLU activation function.
[0073] The application of the relevant modules of the device in this example can be referred to the relevant introduction of the method principle above, and will not be repeated here.
[0074] above Figure 6 The food chewing characteristic grading device in this embodiment of the invention will be described in detail from the perspective of modular functional entities. The electronic device in this embodiment of the invention will be described in detail from the perspective of hardware processing.
[0075] Figure 6 This is a schematic diagram of the structure of an electronic device 600 provided in an embodiment of the present invention. The electronic device 600 can vary significantly due to differences in configuration or performance, and may include one or more central processing units (CPUs) 610 and memory 620, and one or more storage media 630 for storing application programs 633 or data 632. The memory 620 and storage media 630 can be temporary or persistent storage. The program stored in the storage media 630 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the electronic device 600. Furthermore, the processor 610 may be configured to communicate with the storage media 630 and execute the series of instruction operations in the storage media 630 on the electronic device 600.
[0076] Electronic device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input / output interfaces 660, and / or one or more operating systems 631, such as Windows Server, MacOSX, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 6 The illustrated electronic device structure does not constitute a limitation on electronic devices and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0077] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of any of the above-described food chewing characteristic grading methods.
[0078] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0079] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0080] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for grading the chewing characteristics of food, characterized in that, The method includes: Obtain the texture parameters of the sample to be tested, wherein the texture parameters include at least one or more of the following: texture profile analysis parameters, simulated texture parameters, and stress relaxation parameters; The texture parameters are input into a pre-trained ensemble classification model for grading to obtain the chewing characteristic grading results of the test sample output by the ensemble classification model. The ensemble classification model is obtained based on the analysis and comparison of the confusion matrix and comprehensive evaluation index of multiple base models on the test set. The base models include at least a deep multilayer perceptron model, a self-attention classification network model, and a convolutional neural network model. The deep multilayer perceptron model contains multiple sequentially connected fully connected layers, and each fully connected layer is optimized using batch normalization, Dropout, and LeakyReLU activation functions. The self-attention classification network model includes an embedding layer and a multi-head self-attention layer to learn the correlation weights between different texture parameters. The convolutional neural network model is used to extract local feature patterns of the input texture parameters through at least one one-dimensional convolutional block, where each one-dimensional convolutional block contains a one-dimensional convolutional layer, a batch normalization layer, and a LeakyReLU activation function.
2. The method for grading the chewing characteristics of food according to claim 1, characterized in that, The construction of a deep multilayer perceptron model satisfies: The activation function is defined as: LeakyReLU: ; In the formula, The output value after processing by the activation function. For the data input to this layer, The negative slope is a hyperparameter that controls the degree of tilt of the function on the negative half-axis, with a default value of 0.
01. Dropout is limited to: during training, using probability... Set the neuron's output to zero; BatchNorm satisfies: ; In the formula, To represent the output value obtained after batch normalization, This represents the average of the current batch of data. The variance of the current batch of data. The scaling parameters learned by this layer. These are the translation parameters learned by this layer. This is a smoothing term.
3. The method for grading the chewing characteristics of food according to claim 1, characterized in that, The construction of a self-attention classification network model satisfies: The embedding layer is defined as: ; In the formula, This represents the output matrix after the embedding layer transformation. For input data, For embedding matrix, The bias vector of the embedding layer. for Data dimensions and their spatial location, among which, Let B be the real number field, meaning all elements in the matrix are real numbers, and let B be the number of samples processed in the current input. This represents the length of each transformed vector; The multi-head self-attention layer is defined as: For each attention head : ; In the formula, Attention is the output of the h-th attention head, and h is the index number of the attention head. Let h be the query vector in the attention head. Let h be the key vector in the h-th attention head. Let h be the value vector in the h-th attention head. The square root of the dimension of the key vector; Multi-head attention output: ; In the formula, This represents the hidden layer output of the network after processing by the multi-head attention mechanism. `Concat` represents the concatenation operation. To output the projection matrix, This is the output bias vector; Cross-entropy loss function: ; In the formula, L is the loss value. The normalization coefficient is... To sum over the sample dimensions, To sum over the category dimension, The labels are real numbers, and log is the natural logarithm. The probability predicted by the model. This represents the Softmax probability.
4. The method for grading the chewing characteristics of food according to claim 1, characterized in that, The construction of a convolutional neural network model satisfies: The convolution operation of the first convolutional layer satisfies: ; In the formula, This is the output feature map obtained after the first convolutional operation. The data input to this convolutional layer, The function that performs the first convolution operation. This represents a one-dimensional convolution operation. Represents the convolution kernel. Indicates the bias term. Let be the dimension of the convolution kernel weights, where 1 represents the number of output channels, 1 represents the number of input channels, and k represents the length of the convolution kernel; The output shape is: ; In the formula, B is the number of samples processed in the current input, and D represents the length of the output feature map; The first-level batch normalization satisfies: ; In the formula, This is the output tensor after processing by the first batch normalization layer. This is the standard representation of a one-dimensional batch normalization function in deep learning frameworks. For learnable scaling parameters, This is the average value of the current batch. For learnable offset parameters, The standard deviation of the current batch of data. It is a constant; The first-layer activation function satisfies: ; In the formula, The output tensor is processed using the LeakyReLU activation function. For activation function representation, This is the positive part of the activation function. The activation function is used to process the negative input portion; The second convolutional layer satisfies: ; In the formula, This is the output of the second convolutional layer. The function to perform the second convolution operation. This is the output of the first layer after activation by the function. These are the weights of the convolutional kernel in the second layer. For the bias term of the second layer; The second-level batch normalization satisfies: ; In the formula, This is the output tensor after processing by the second batch normalization layer. This is the standard representation of a one-dimensional batch normalization function in deep learning frameworks. For learnable scaling parameters, The mean, For learnable offset parameters, For standard deviation, It is a constant; The second-layer activation function satisfies: ; In the formula, This is the output of the second layer after activation by the function; The flattening operation is as follows: ; In the formula, F is the flattened eigenvector. The operation of converting a multidimensional feature map into a one-dimensional vector. For the reshaping operation, The shape changed to , This indicates that the flattened data F is a real tensor; The first fully connected layer satisfies: ; In the formula, This is the output of the fully connected layer. This is the weight matrix of the fully connected layer. For the bias term of the fully connected layer, The input features are those of the fully connected layer. Define the weight matrix The size of the dimension, where H represents the output dimension. Indicates the input dimension. Define bias terms Dimension size; The activation function of a fully connected layer satisfies: ; Dropout regularization satisfies: ; In the formula, M is the output tensor of the Dropout layer. The function that performs the Dropout operation, where H is the input tensor of the Dropout layer. For Bernoulli mask, The i-th element in the mask m follows the parameter . Bernoulli distribution, This represents the probability of discarding. The output layer satisfies: ; In the formula, For the output layer's results, The weight matrix of the output layer. For the input data of the output layer, For the bias term of the output layer, Define the weight matrix Dimensions Define bias terms Dimensions.
5. The method for grading the chewing characteristics of food according to claim 1, characterized in that, The acquisition of the texture parameters of the sample to be tested includes: The sample to be tested is subjected to a texture profile analysis test using a physical property analyzer to obtain the texture profile analysis parameters, which include at least hardness, adhesion, elasticity, cohesion, adhesiveness, chewiness, and resilience. The sample to be tested is subjected to a simulated chewing test using a physical property analyzer. The test simulates at least two compression processes to obtain the simulated texture parameters, which include at least firmness and chewiness. The stress relaxation parameters are obtained by performing stress relaxation tests on the sample under test using a physical property analyzer. The stress relaxation parameters include at least the elastic modulus and the relaxation time.
6. The method for grading the chewing characteristics of food according to claim 1, characterized in that, The method further includes constructing the ensemble classification model, including: A food sample set is obtained, wherein the food sample set includes multiple food samples, each food sample has multiple sample texture parameters measured by a texture analyzer, and its corresponding chewing characteristic grade label is obtained through sensory evaluation; For the sample texture parameters, at least two different deep learning classification models with different architectures are constructed in parallel. Each deep learning classification model is trained independently, and the performance of each model is evaluated on an independent test set to obtain a comprehensive performance index. The evaluated performance index includes at least accuracy, precision, recall and F1 score calculated based on the confusion matrix. By comparing and analyzing the confusion matrix and comprehensive evaluation index of each model on the test set, at least one model is selected from the various deep learning classification models as the base model. Based on the aforementioned basic model, the ensemble classification model is constructed, and the output of the ensemble classification model is a weighted sum of the outputs of each basic model.
7. The method for grading the chewing characteristics of food according to claim 1, characterized in that, The method also includes building a base model, including: Draw confusion matrix diagrams for each candidate model on the test set, where the rows of the confusion matrix represent the true chewing characteristic level and the columns represent the chewing characteristic level predicted by the model. The candidate models are deep multilayer perceptron models and / or convolutional neural network models. By analyzing the numerical distribution of off-diagonal elements in the confusion matrix, the discriminative power of each model at each level is identified, and the confusion level category pairs are determined. Calculate the accuracy, precision, recall, and F1 score for each candidate model to obtain a comprehensive performance metric. The basic model is determined based on the confusion level category pairs and the comprehensive performance index.
8. A food chewing characteristic grading device, characterized in that, The device includes: The texture parameter acquisition module is used to acquire the texture parameters of the sample to be tested. The texture parameters include at least one or more of the following: texture profile analysis parameters, simulated texture parameters, and stress relaxation parameters. The chewing characteristic grading result determination module is used to input the texture parameters into a pre-trained ensemble classification model for grading, so as to obtain the chewing characteristic grading result of the test sample output by the ensemble classification model. The ensemble classification model is obtained based on the analysis and comparison of the confusion matrix and comprehensive evaluation index of multiple base models on the test set. The base models include at least a deep multilayer perceptron model, a self-attention classification network model, and a convolutional neural network model. The deep multilayer perceptron model contains multiple sequentially connected fully connected layers, and each fully connected layer is optimized using batch normalization, Dropout, and LeakyReLU activation functions. The self-attention classification network model includes an embedding layer and a multi-head self-attention layer, used to learn the correlation weights between different texture parameters. The convolutional neural network model is used to extract local feature patterns of the input texture parameters through at least one one-dimensional convolutional block, where each one-dimensional convolutional block contains a one-dimensional convolutional layer, a batch normalization layer, and a LeakyReLU activation function.
9. An electronic device, characterized in that, The electronic device includes a memory and at least one processor, the memory storing instructions; the at least one processor invokes the instructions in the memory to cause the electronic device to perform the various steps of food chewing characteristic grading as described in any one of claims 1-7.
10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the various steps of food chewing characteristic grading as described in any one of claims 1-7.