A method for food risk assessment based on improved neural network

Through the improved DCN network model and decision tree technology, combined with multiple residual and cross feature extraction, the problem of excessive manual time-consuming and the limitations of neural network processing of complex data in food risk assessment is solved, achieving efficient and effective food risk assessment. Accurate predictions.

CN113887868BActive Publication Date: 2024-09-06SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111013269.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-31
Publication Date
2024-09-06
Estimated Expiration
2041-08-31

AI Technical Summary

Technical Problem

Existing food risk assessments rely on manual field inspections and inspections, which consume a lot of time and labor, and neural networks have limitations in processing complex data.

Method used

An improved DCN network model is used, combined with decision tree and feature crossover technology, to enhance feature extraction capabilities, predict food risks through multiple residual and crossover feature extraction, and reduce the workload of food risk assessment experts.

Benefits of technology

It improves the efficiency and accuracy of food risk assessment, alleviates the problems of long manual time-consuming and limitations of neural network processing of complex data in traditional methods, and achieves faster and more accurate risk prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113887868B
    Figure CN113887868B
Patent Text Reader

Abstract

The present invention discloses a method for implementing food risk assessment based on an improved neural network, comprising the steps of: 1) obtaining a sample food data set; 2) preprocessing the sample food data set, and dividing the preprocessed sample data set into a training set and a test set; 3) inputting the training set into an improved DCN network model for training, and obtaining an optimal improved DCN network model after the training is completed; 4) inputting the test set into the optimal improved DCN network model for testing, and obtaining the final prediction value of the sample food after the test, which is the risk assessment prediction score corresponding to each sample food. The present invention combines the feature extraction technology of the neural network with the food risk assessment, mines data features through the residual calculation method of the decision tree and the feature cross calculation method in the deep cross network, and uses the model to realize the prediction of the sample food risk assessment, thereby effectively alleviating the problem of labor-intensive food risk prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of feature extraction and food safety risk assessment, and in particular to a method for implementing food risk assessment based on an improved neural network. Background Art

[0002] Since the beginning of the 21st century, the country's economic development and people's living standards have been continuously improving. Food-related industries have gradually formed an independent food industry system and become a pillar industry of the national economy. The development of the food industry has also become my country's largest manufacturing industry. The development of my country's food manufacturing industry has made food safety risks a challenge that the health department must face and solve.

[0003] At present, my country mainly adopts the establishment of a national food safety risk assessment expert committee to complete the food safety assessment work in food risk assessment. That is, manual field investigation, sampling and testing, quantitative analysis of element indicators, comparison of homologous products, and evaluation data aggregation, and finally submitting the risk assessment results report of various foods to the Ministry of Health. The neural network model in the information age can mine the characteristic information of massive data on the Internet, and the commercial value it brings is gradually recognized and affirmed in the market. Everyone recognizes the great value of neural network models in content distribution, user experience, and commercial realization. In general, the current food safety risk assessment work is overly dependent on manual implementation, which means that it will take a lot of time and labor, resulting in a long evaluation time; in addition, the progress of neural networks in feature engineering technology, the enhancement of data processing capabilities, the reduction of computing costs, and the development of algorithm models themselves have made neural network models widely used in more development fields to complete the evaluation and prediction of the results of more complex data interactions. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art, and proposes a method for food risk assessment based on an improved neural network, which breaks through the problem that traditional food risk assessment requires a lot of manual effort and time, and cleverly uses a neural network model with data mining capabilities to assist in the assessment, thereby reducing the workload of food risk assessment experts. The use of feature crossover can well capture the complex interactions between features, and combines multiple residuals and cross feature extraction to strengthen the feature mining of samples, further improving the model's evaluation of risk prediction results.

[0005] To achieve the above object, the technical solution provided by the present invention is: a method for food risk assessment based on an improved neural network, comprising the following steps:

[0006] 1) Obtain a sample food data set, where each sample food data in the sample food data set contains component elements added during the production of each sample food;

[0007] 2) Preprocessing the sample food data set, and dividing the preprocessed sample data set into a training set and a test set;

[0008] 3) Inputting the training set into the improved DCN network model for training, and obtaining the optimal improved DCN network model after the training is completed; wherein, the improvement of the improved DCN network model is to strengthen the input vector of the DCN network model by adding a decision tree method to improve the feature extraction capability;

[0009] 4) The test set is input into the optimal improved DCN network model for testing. After the test, the final prediction value of the sample food is obtained, which is the risk assessment prediction score corresponding to each sample food.

[0010] Further, in step 1), the sample food data set refers to a set of sample food data that requires risk assessment provided by food manufacturers; the constituent elements added in the production of the sample food refer to the multiple elemental components added to the sample food, and these component information is learned by the model as characteristic values ​​of the sample food.

[0011] Furthermore, in step 2), the sample food data set is preprocessed, including screening and deleting data in the sample food data set whose constituent elements of the sample food are less than 3 constituent elements and clearing abnormal data.

[0012] Further, in step 3), the specific description of the improved DCN network model is as follows:

[0013] 3.1) A preliminary evaluation is performed using a decision regression tree method based on the characteristic information of the sample food dataset, including the following steps:

[0014] 3.1.1) The residual of the data fitted by the decision regression tree is:

[0015] c mi =y i -f m-1 (x i )

[0016] In the formula, c mi is the residual value of the data of the i-th sample food in the m-th decision regression tree, where m = 1, 2, 3, ..., M, and i = 1, 2, 3, ..., N, y i is the target evaluation value of the i-th sample food, x i is the characteristic value of the i-th sample food, f m-1 (x i ) is the m-1th decision regression tree;

[0017] 3.1.2) Update the decision regression tree after fitting the data residual to obtain a new decision regression tree:

[0018] f m (x) = f m-1 (x)+T(x;θ m )

[0019] In the formula, T(x;θ m ) is a decision regression tree after fitting the residual, θ m is the calculation parameter of the mth decision regression tree, f m (x) is the mth decision regression tree;

[0020] 3.1.3) For the preliminary evaluation value of the sample food obtained by the decision regression tree, it is first encoded into a One-Hot vector. The vector after One-Hot encoding will become a discrete feature value, that is, a discrete feature vector. Then, the embedding method is used to convert the discrete feature vector into an embedded vector of a real value:

[0021] X e,i =w e,i X i

[0022] Where, X e,i is the i-th embedding vector, X i is the discrete feature vector of the i-th sample food, w e,i is the weight value of the i-th conversion embedding vector;

[0023] 3.2) The feature superposition method is used to superimpose the embedding vector of the decision regression tree with the feature vector in the sample food data set to obtain the superimposed vector:

[0024]

[0025] In the formula, x0 is the superposition vector, is the transposed vector of the i-th embedding vector, is the transpose of the feature vector of the sample food dataset;

[0026] After the superposition vector passes through the feature learning of the Cross layer and the Deep layer of the DCN network model, the corresponding output vector is obtained, as follows:

[0027] The superposition vector is cross-multiplied layer by layer in the Cross layer of the DCN network model to obtain the output vector of the Cross layer:

[0028]

[0029] In the formula, x iis the result of the feature cross multiplication of the i-th layer, that is, the output vector of the Cross layer, is the transposed vector of the feature cross-multiplication result of the i-1th layer, w c,i is the weight value of the i-th layer, b c,i is the bias value of the i-th layer, where c represents the Cross layer;

[0030] The superimposed vector performs nonlinear feature crossover in the Deep layer of the DCN network model to obtain the output vector of the Deep layer:

[0031] h i =ReLu(W h,i-1 d i-1 +b h,i-1 )

[0032] In the formula, h i is the feature cross result of the nonlinear change of the i-th layer, that is, the output vector of the Deep layer, ReLu(W h,i- 1d i-1 +b h,i-1 ) is the activation function, W h,i-1 is the weight value of the i-1th layer, d i-1 is the feature crossover result of the nonlinear change of the i-1th layer, where the input vector d0 used by h1 in the calculation of the first layer is the superposition vector x0, b h,i-1 is the bias value of the i-1th layer, where h represents the Deep layer;

[0033] 3.3) The connection layer of the DCN network model concatenates the output vector of the Cross layer and the output vector of the Deep layer to obtain a concatenated vector:

[0034]

[0035] In the formula, x stack is the concatenation vector, is the transposed vector of the output vector of the Cross layer, is the transposed vector of the output vector of the Deep layer;

[0036] Input the concatenated vector into the logistic regression function to obtain the final predicted risk assessment value of the sample food:

[0037] p = sigmoid(W logit x stack +b logit )

[0038] Where p is the final predicted risk assessment value of the sample food, sigmoid(W logit x stack +b logit ) is the activation function, Wlogit is the weight value, b logit is the bias value, where the value of logits is obtained by weighted summation of the concatenated vector.

[0039] Furthermore, in step 4), the test set is input into the optimal improved DCN network model for testing. After obtaining the final risk assessment prediction score of the sample food, the cross entropy loss function is used to evaluate the prediction effect of the model:

[0040] Q=-[y i log(p i )+(1-y i )log(1-p i )]

[0041] In the formula, Q represents the cross entropy loss function value. The smaller the cross entropy loss function value Q is, the better the prediction effect of the evaluation model is. i is the target evaluation value of the i-th sample food, which takes the value of 0 or 1, p i is the risk assessment prediction score of the i-th sample food, with a probability value between 0 and 1.

[0042] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0043] 1. The present invention adopts an improved DCN network model to predict food risk assessment, breaking through the shortcoming of traditional food assessment that is labor-intensive.

[0044] 2. The present invention applies feature mining technology to the food industry, which not only makes full use of current information technology, but also achieves the purpose of alleviating the workload of food risk assessment experts.

[0045] 3. The present invention strengthens the ability of the DCN network model to process data features by using the decision regression tree decision cross feature method, improves the performance of the neural network model in extracting data features, and achieves the effect of enhancing the model to process complex data volumes.

[0046] 4. The present invention uses an improved DCN network model to complete risk assessment and prediction of sample food data, further enhancing the DCN network model's ability to process cross-features and alleviating the limitations of the neural network model in the field of processing cross-features.

[0047] 5. The method of the present invention has a wide range of applications in feature engineering models of neural networks, has strong scalability in algorithm design, and has wide adaptability, and has broad prospects in meeting prediction and evaluation needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 This is a diagram of the improved DCN network model architecture of the present invention. DETAILED DESCRIPTION

[0049] The present invention will be further described below in conjunction with specific embodiments.

[0050] This embodiment discloses a method for implementing food risk assessment based on an improved neural network, which combines multiple residual calculations and feature cross calculation methods, strengthens the DCN network model to extract features, and effectively implements risk assessment and prediction of sample food, which includes the following steps:

[0051] 1) Obtain a sample food data set, where each sample food data in the sample food data set contains the constituent elements added during the production of each sample food; the sample food data set refers to a set of sample food data that requires risk assessment provided by a food manufacturer; the constituent elements added during the production of the sample food refer to multiple elemental components added to the sample food, and these component information is learned by the model as feature values ​​of the sample food.

[0052] 2) Preprocessing the sample food data set includes screening and deleting data in which the composition elements of the sample food in the sample food data set are less than 3 elements and removing abnormal data.

[0053] 3) The training set is input into the improved DCN network model for training, and the optimal improved DCN network model is obtained after the training is completed; wherein, the improvement of the improved DCN network model is to strengthen the input vector of the DCN network model by adding a decision tree method to improve the feature extraction capability.

[0054] See also Figure 1 As shown, according to the specific application requirements and the characteristics of feature extraction of the neural network model, the proposed improved DCN network model is specifically described as follows:

[0055] 3.1) A preliminary evaluation is performed using a decision regression tree method based on the characteristic information of the sample food dataset, including the following steps:

[0056] 3.1.1) The residual of the data fitted by the decision regression tree is:

[0057] c mi =y i -f m-1 (x i )

[0058] In the formula, c mi is the residual value of the data of the i-th sample food in the m-th decision regression tree, where m = 1, 2, 3, ..., M, and i = 1, 2, 3, ..., N, y i is the target evaluation value of the i-th sample food, x iis the characteristic value of the i-th sample food, f m-1 (x i ) is the m-1th decision regression tree;

[0059] 3.1.2) Update the decision regression tree after fitting the data residual to obtain a new decision regression tree:

[0060] f m (x) = f m-1 (x)+T(x;θ m )

[0061] In the formula, T(x;θ m ) is a decision regression tree after fitting the residual, θ m is the calculation parameter of the mth decision regression tree, f m (x) is the mth decision regression tree;

[0062] 3.1.3) For the preliminary evaluation value of the sample food obtained by the decision regression tree, it is first encoded into a One-Hot vector. The vector after One-Hot encoding will become a discrete feature value, that is, a discrete feature vector. Then, the embedding method is used to convert the discrete feature vector into an embedded vector of a real value:

[0063] X e,i =w e,i X i

[0064] Where, X e,i is the i-th embedding vector, X i is the discrete feature vector of the i-th sample food, w e,i is the weight value of the i-th conversion embedding vector;

[0065] 3.2) The feature superposition method is used to superimpose the embedding vector of the decision regression tree with the feature vector in the sample food data set to obtain the superimposed vector:

[0066]

[0067] In the formula, x0 is the superposition vector, is the transposed vector of the i-th embedding vector, is the transpose of the feature vector of the sample food dataset;

[0068] After the superposition vector passes through the feature learning of the Cross layer and the Deep layer of the DCN network model, the corresponding output vector is obtained, as follows:

[0069] The superposition vector is cross-multiplied layer by layer in the Cross layer of the DCN network model to obtain the output vector of the Cross layer:

[0070]

[0071] In the formula, x i is the result of the feature cross multiplication of the i-th layer, that is, the output vector of the Cross layer, is the transposed vector of the feature cross-multiplication result of the i-1th layer, w c,i is the weight value of the i-th layer, b c,i is the bias value of the i-th layer, where c represents the Cross layer;

[0072] The superimposed vector performs nonlinear feature crossover in the Deep layer of the DCN network model to obtain the output vector of the Deep layer:

[0073] h i =ReLu(W h,i-1 d i-1 +b h,i-1 )

[0074] In the formula, h i is the feature cross result of the nonlinear change of the i-th layer, that is, the output vector of the Deep layer, ReLu(W h,i- 1d i-1 +b h,i-1 ) is the activation function, W h,i-1 is the weight value of the i-1th layer, d i-1 is the feature crossover result of the nonlinear change of the i-1th layer, where the input vector d0 used by h1 in the calculation of the first layer is the superposition vector x0, b h,i-1 is the bias value of the i-1th layer, where h represents the Deep layer;

[0075] 3.3) The connection layer of the DCN network model concatenates the output vector of the Cross layer and the output vector of the Deep layer to obtain a concatenated vector:

[0076]

[0077] In the formula, x stack is the concatenation vector, is the transposed vector of the output vector of the Cross layer, is the transposed vector of the output vector of the Deep layer;

[0078] Input the concatenated vector into the logistic regression function to obtain the final predicted risk assessment value of the sample food:

[0079] p = sigmoid(W logit x stack +b logit )

[0080] Where p is the final predicted risk assessment value of the sample food, sigmoid(W logit x stack +b logit ) is the activation function, W logit is the weight value, b logit is the bias value, where the value of logits is obtained by weighted summation of the concatenated vector.

[0081] 4) Input the test set into the optimal improved DCN network model for testing. After the test, the final prediction value of the sample food is obtained, which is the risk assessment prediction score corresponding to each sample food. The cross entropy loss function is used to evaluate the prediction effect of the model:

[0082] Q=-[y i log(p i )+(1-y i )log(1-p i )]

[0083] In the formula, Q represents the cross entropy loss function value. The smaller the cross entropy loss function value Q is, the better the prediction effect of the evaluation model is. i is the target evaluation value of the i-th sample food, which takes the value of 0 or 1, p i is the risk assessment prediction score of the i-th sample food, with a probability value between 0 and 1.

[0084] In summary, after adopting the above method, the present invention provides a new method for food risk assessment. Using the neural network model as an effective means to assist experts in food risk assessment can effectively alleviate the workload of food risk assessment experts, effectively promote the development of my country's food industry, and is beneficial to the application of neural network models in multiple fields. It has practical promotion value and is worthy of promotion.

[0085] The above-described embodiments are only preferred embodiments of the present invention and are not intended to limit the scope of implementation of the present invention. Therefore, all changes made according to the shape and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for food risk assessment based on an improved neural network, characterized in that: The following steps are involved: 1) Obtain a sample food data set, where each sample food data in the sample food data set contains component elements added during the production of each sample food; 2) Preprocessing the sample food data set, and dividing the preprocessed sample data set into a training set and a test set; 3) Inputting the training set into the improved DCN network model for training, and obtaining the optimal improved DCN network model after the training is completed; wherein, the improvement of the improved DCN network model is to strengthen the input vector of the DCN network model by adding a decision tree method to improve the feature extraction capability; The specific description of the improved DCN network model is as follows: 3.1) A preliminary evaluation is performed using a decision regression tree method based on the characteristic information of the sample food dataset, including the following steps: 3.1.1) The residual of the data fitted by the decision regression tree is: c mi =y i -f m-1 (x i ) In the formula, c mi is the residual value of the data of the i-th sample food in the m-th decision regression tree, where m = 1, 2, 3, ..., M, and i = 1, 2, 3, ..., N, y i is the target evaluation value of the i-th sample food, x i is the characteristic value of the i-th sample food, f m-1 (x i ) is the m-1th decision regression tree; 3.1.2) Update the decision regression tree after fitting the data residual to obtain a new decision regression tree: f m (x)=f m-1 (x)+T(x;θ m ) In the formula, T(x;θ m ) is a decision regression tree after fitting the residual, θ m is the calculation parameter of the mth decision regression tree, f m (x) is the mth decision regression tree; 3.1.3) For the preliminary evaluation value of the sample food obtained by the decision regression tree, it is first encoded into a One-Hot vector. The vector after One-Hot encoding will become a discrete feature value, that is, a discrete feature vector. Then, the embedding method is used to convert the discrete feature vector into an embedded vector of a real value: X e,i =w e,i X i In the formula, X e,i is the i-th embedding vector, X i is the discrete feature vector of the i-th sample food, w e,i is the weight value of the i-th conversion embedding vector; 3.2) The feature superposition method is used to superimpose the embedding vector of the decision regression tree with the feature vector in the sample food data set to obtain the superimposed vector: In the formula, x0 is the superposition vector, is the transposed vector of the i-th embedding vector, is the transpose of the feature vector of the sample food dataset; After the superposition vector passes through the feature learning of the Cross layer and the Deep layer of the DCN network model, the corresponding output vector is obtained, as follows: The superposition vector is cross-multiplied layer by layer in the Cross layer of the DCN network model to obtain the output vector of the Cross layer: In the formula, x i is the result of the feature cross multiplication of the i-th layer, that is, the output vector of the Cross layer, is the transposed vector of the feature cross-multiplication result of the i-1th layer, w c,i is the weight value of the i-th layer, b c,i is the bias value of the i-th layer, where c represents the Cross layer; The superimposed vector performs nonlinear feature crossover in the Deep layer of the DCN network model to obtain the output vector of the Deep layer: h i =ReLu(W h,i-1 d i-1 +b h,i-1 ) In the formula, h i is the feature cross result of the nonlinear change of the i-th layer, that is, the output vector of the Deep layer, ReLu(W h,i-1 d i-1 +b h,i-1 ) is the activation function, W h,i-1 is the weight value of the i-1th layer, d i-1 is the feature crossover result of the nonlinear change of the i-1th layer, where the input vector d0 used by h1 in the calculation of the first layer is the superposition vector x0, b h,i-1 is the bias value of the i-1th layer, where h represents the Deep layer; 3.3) The connection layer of the DCN network model concatenates the output vector of the Cross layer and the output vector of the Deep layer to obtain a concatenated vector: In the formula, x stack is the concatenation vector, is the transposed vector of the output vector of the Cross layer, is the transposed vector of the output vector of the Deep layer; Input the concatenated vector into the logistic regression function to obtain the final predicted risk assessment value of the sample food: p=sigmoid(W logit x stack +b logit ) Where p is the final predicted risk assessment value of the sample food, sigmoid(W logit x stack +b logit ) is the activation function, W logit is the weight value, b logit is the bias value, where the value of logits is obtained by weighted summation of the concatenated vector; 4) The test set is input into the optimal improved DCN network model for testing. After the test, the final prediction value of the sample food is obtained, which is the risk assessment prediction score corresponding to each sample food.

2. The method for food risk assessment based on an improved neural network according to claim 1, characterized in that: In step 1), the sample food data set refers to a set of sample food data that requires risk assessment provided by food manufacturers; the constituent elements added in the production of the sample food refer to the multiple elemental components added to the sample food, and these component information is learned by the model as the characteristic values ​​of the sample food.

3. The method for food risk assessment based on an improved neural network according to claim 1, characterized in that: In step 2), the sample food data set is preprocessed, including screening and deleting data in the sample food data set where the constituent elements of the sample food are less than 3 constituent elements and removing abnormal data.

4. The method for food risk assessment based on an improved neural network according to claim 1, characterized in that: In step 4), the test set is input into the optimal improved DCN network model for testing. After obtaining the final risk assessment prediction score of the sample food, the cross entropy loss function is used to evaluate the prediction effect of the model: Q=-[y i log(p i )+(1-y i )log(1-p i )] In the formula, Q represents the cross entropy loss function value. The smaller the cross entropy loss function value Q is, the better the prediction effect of the evaluation model is. i is the target evaluation value of the i-th sample food, which takes the value of 0 or 1, p i is the risk assessment prediction score of the i-th sample food, with a probability between 0 and 1.