CN111882150A - Food safety risk early warning method combining neural network and analytic hierarchy process - Google Patents
Food safety risk early warning method combining neural network and analytic hierarchy process Download PDFInfo
- Publication number
- CN111882150A CN111882150A CN202010546055.8A CN202010546055A CN111882150A CN 111882150 A CN111882150 A CN 111882150A CN 202010546055 A CN202010546055 A CN 202010546055A CN 111882150 A CN111882150 A CN 111882150A
- Authority
- CN
- China
- Prior art keywords
- food safety
- neural network
- early warning
- safety risk
- radial basis
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 235000013305 food Nutrition 0.000 title claims abstract description 128
- 238000013528 artificial neural network Methods 0.000 title claims abstract description 107
- 238000000034 method Methods 0.000 title claims abstract description 36
- 230000008569 process Effects 0.000 title description 8
- 238000001514 detection method Methods 0.000 claims abstract description 47
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 42
- 230000004927 fusion Effects 0.000 claims abstract description 22
- 238000004458 analytical method Methods 0.000 claims abstract description 20
- 238000005354 coacervation Methods 0.000 claims abstract description 8
- 230000006870 function Effects 0.000 claims description 38
- 238000004364 calculation method Methods 0.000 claims description 23
- 238000012549 training Methods 0.000 claims description 22
- 239000011159 matrix material Substances 0.000 claims description 18
- 238000005314 correlation function Methods 0.000 claims description 8
- 238000004519 manufacturing process Methods 0.000 abstract description 7
- 230000009286 beneficial effect Effects 0.000 abstract description 5
- 238000005728 strengthening Methods 0.000 abstract description 4
- 238000004220 aggregation Methods 0.000 abstract 3
- 230000002776 aggregation Effects 0.000 abstract 3
- 235000013622 meat product Nutrition 0.000 description 13
- 238000010586 diagram Methods 0.000 description 11
- 230000000694 effects Effects 0.000 description 5
- 238000012360 testing method Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 4
- 239000000126 substance Substances 0.000 description 4
- 238000011156 evaluation Methods 0.000 description 3
- VYZAMTAEIAYCRO-UHFFFAOYSA-N Chromium Chemical compound [Cr] VYZAMTAEIAYCRO-UHFFFAOYSA-N 0.000 description 2
- IOVCWXUNBOPUCH-UHFFFAOYSA-M Nitrite anion Chemical compound [O-]N=O IOVCWXUNBOPUCH-UHFFFAOYSA-M 0.000 description 2
- 230000004913 activation Effects 0.000 description 2
- 229910052793 cadmium Inorganic materials 0.000 description 2
- BDOSMKKIYDKNTQ-UHFFFAOYSA-N cadmium atom Chemical compound [Cd] BDOSMKKIYDKNTQ-UHFFFAOYSA-N 0.000 description 2
- 229910052804 chromium Inorganic materials 0.000 description 2
- 239000011651 chromium Substances 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- BEFDCLMNVWHSGT-UHFFFAOYSA-N ethenylcyclopentane Chemical compound C=CC1CCCC1 BEFDCLMNVWHSGT-UHFFFAOYSA-N 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 238000003064 k means clustering Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 238000003062 neural network model Methods 0.000 description 2
- 238000010606 normalization Methods 0.000 description 2
- 238000000611 regression analysis Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 229940075582 sorbic acid Drugs 0.000 description 2
- 235000010199 sorbic acid Nutrition 0.000 description 2
- 239000004334 sorbic acid Substances 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 239000002778 food additive Substances 0.000 description 1
- 235000013373 food additive Nutrition 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 229910001385 heavy metal Inorganic materials 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000005304 joining Methods 0.000 description 1
- 244000005700 microbiome Species 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000012502 risk assessment Methods 0.000 description 1
- 238000012954 risk control Methods 0.000 description 1
- 238000013058 risk prediction model Methods 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0635—Risk analysis of enterprise or organisation activities
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/10—Services
- G06Q50/26—Government or public services
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Human Resources & Organizations (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Tourism & Hospitality (AREA)
- Evolutionary Computation (AREA)
- Economics (AREA)
- General Engineering & Computer Science (AREA)
- Strategic Management (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Molecular Biology (AREA)
- Entrepreneurship & Innovation (AREA)
- Biophysics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Biomedical Technology (AREA)
- General Business, Economics & Management (AREA)
- Development Economics (AREA)
- Marketing (AREA)
- Educational Administration (AREA)
- Computational Linguistics (AREA)
- Game Theory and Decision Science (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Biology (AREA)
- Primary Health Care (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a food safety risk early warning method combining a neural network and a hierarchical analysis algorithm, which is characterized in that a hierarchical analysis algorithm based on entropy weight is utilized to carry out risk fusion on food safety detection data, an obtained risk fusion value is taken as expected output of an aggregation hierarchical clustering-radial basis function neural network, the detection data is taken as input of the aggregation hierarchical clustering-radial basis function neural network, and an aggregation hierarchical clustering-radial basis function neural network early warning model is established to predict the food safety risk of the detection data. The early warning model of the coacervation hierarchical clustering-radial basis function neural network improves the generalization precision of the traditional early warning model of the radial basis function neural network, and can accurately realize the prediction of food safety risks. And finally, carrying out food safety early warning analysis according to the modeling result, and being beneficial to strengthening supervision on related food production enterprises by related departments, thereby improving the food safety level and reducing the food safety risk.
Description
Technical Field
The invention relates to the technical field of food safety, in particular to a food safety risk early warning method combining a neural network and an analytic hierarchy process.
Background
Food safety is a social problem affecting the nationality of the people. However, in recent years, food safety accidents frequently occur, which seriously threatens the health of consumers and arouses great attention of consumers to food safety problems. In order to reduce the occurrence of food safety accidents, food safety supervision needs to be strengthened, food safety risk early warning research is developed, the change trend of food safety risks is mastered, and relevant departments are helped to carry out targeted risk control.
Establishing a food safety risk prediction model with good performance is important for effective food safety early warning. Currently common predictive modeling methods include regression analysis methods and bayesian network methods. However, in terms of modeling of food safety warnings, regression analysis methods are not suitable for describing multidimensional nonlinear relationships. The bayesian network method cannot impose constraints on the state values of the variables, so that the established early warning model is often disjointed from reality.
Disclosure of Invention
In order to solve the limitations and defects of the prior art, the invention provides a food safety risk early warning method combining a coacervation hierarchical clustering-radial basis function neural network and an entropy weight-based hierarchical analysis algorithm, which comprises the following steps:
obtaining food safety detection data of food to be detected;
performing risk fusion on the food safety detection data by using a hierarchical analysis algorithm based on entropy weight to obtain food safety risk fusion data of the food safety detection data;
taking the food safety risk fusion data as expected output of a food safety risk early warning model;
taking the food safety detection data as the input of a food safety risk early warning model;
forming a food safety risk early warning model according to the coacervation hierarchical clustering-radial basis function neural network;
and carrying out food safety risk early warning on the food to be detected by using the food safety risk early warning model.
Optionally, the step of performing risk fusion on the food safety detection data by using a hierarchical analysis algorithm based on entropy weight to obtain food safety risk fusion data of the food safety detection data includes:
for the p-th sample, the standard correlation function f of the parameter qpq(x) The definition is as follows:
wherein x isq(1),xq(2),xq(3),xq(4) Is fpq(x) A node of (2);
if xq(2) And xq(3) Overlapping to obtain a lower side correlation function fpq(x):
Data after pretreatment were X ═ X (1) X (2) Λ X (n)]TObtaining the information according to the lower side correlation functionInformation matrix Fn×m:
Wherein x isq(2) (q ═ 1,2, L, m) is an average value;
obtain a positive matrix Rq n×mThe following were used:
according to Rq n×mObtaining an n-dimensional symmetric matrix COR:
calculating the entropy e of each indexpThe calculation formula is as follows:
calculating the weight wpThe calculation formula is as follows:
wherein, the weight value wpRepresenting the degree of importance of each index;
fusing data by using the weight vector to obtain fused data Y:
wherein the weight vector is W ═ W1,w2,...,wn]T。
Optionally, the step of forming the food safety risk early warning model according to the agglomerative hierarchical clustering-radial basis function neural network includes:
input data using a agglomerative hierarchical clustering algorithmPolymerization into k types: a. the1,A2,...,Ak;
Calculating a cluster center position C for each cluster1,C2,...,CkThe calculation formula is as follows:
wherein, numiIs the ith cluster AiNumber of samples of (1), xjIs cluster AiS is the dimension of the sample data, CiFor the ith cluster AiThe cluster center of (a);
calculating the width sigma of the Gaussian function of the jth node in the hidden layerjThe calculation formula is as follows:
σj=min||Cj-Ci||,(j,i=1,2,...,k)∩(i≠j) (16)
wherein, | | Cj-CiI is CjAnd CiEuclidean distance between;
when the number of samples is P, the output matrix U of the hidden layer is calculated as follows:
wherein, the output uij of the jth node of the hidden layer of the ith sample is:
obtaining output Z of agglomerative hierarchical clustering-radial basis function neural networktThe calculation formula is as follows:
Zt=U·Wt(19)
wherein, WtIs the weight matrix between the hidden layer and the output layer during the t-th training, the initial value of t is 1, WtThe calculation formula of (a) is as follows:
Wtthe updated calculation formula of (2) is:
Wt+1=Wt+ηUT·(Y-Zt),η∈(0,1) (20)
where eta is the learning rate, ZtIs the output of the agglomerative hierarchical clustering-radial basis function neural network during the t-th training.
The invention has the following beneficial effects:
the invention provides a food safety risk early warning method combining a neural network and a hierarchical analysis algorithm, aiming at the characteristics of high dimensionality and complexity of food safety monitoring data, the hierarchical analysis algorithm based on entropy weight is utilized to carry out risk fusion on food safety detection data, an obtained risk fusion value is used as expected output of an aggregation-hierarchical clustering-radial basis function neural network, the detection data is used as input of the aggregation-hierarchical clustering-radial basis function neural network, and an aggregation-hierarchical clustering-radial basis function neural network early warning model is established to predict food safety risk of the detection data. The early warning model of the coacervation hierarchical clustering-radial basis function neural network improves the generalization precision of the traditional early warning model of the radial basis function neural network, and can accurately realize the prediction of food safety risks. And finally, carrying out food safety early warning analysis according to the modeling result, and being beneficial to strengthening supervision on related food production enterprises by related departments, thereby improving the food safety level and reducing the food safety risk.
Drawings
Fig. 1 is a flow chart of food safety pre-warning provided in an embodiment of the present invention.
Fig. 2 is a schematic diagram of a truncated hierarchical tree according to an embodiment of the present invention.
Fig. 3 is a flowchart of an algorithm of the agglomerative hierarchical clustering-radial basis function neural network according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of a partial detection result of a detection index according to a first embodiment of the present invention.
Fig. 5 is a weight ratio schematic diagram of a meat product detection index according to an embodiment of the present invention.
Fig. 6 is a schematic diagram illustrating comparison of fitting curves of three types of neural networks according to an embodiment of the present invention.
Fig. 7 is a schematic diagram of generalized error curves of three neural networks according to an embodiment of the present invention.
Fig. 8 is a schematic diagram of the distribution of risk value intervals of meat products from 3 months to 7 months in 2015 according to the first embodiment of the present invention.
Fig. 9 is a schematic view of the risk value of the meat product of month 8 in 2015 provided by the first embodiment of the invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the food safety risk early warning method combining the neural network and the analytic hierarchy process provided by the present invention is described in detail below with reference to the accompanying drawings.
Example one
An artificial neural network is a parallel distributed information processing structure consisting of input layer, hidden layer and output layer neurons. The artificial neural network has the characteristic of strong fault tolerance, and can establish a complex nonlinear relation model. Meanwhile, due to the non-linear and noise tolerance characteristics, the artificial neural network can well fit data and accurately predict output. At present, the artificial neural network is widely applied in the fields of food science, food processing and food safety early warning.
A Back Propagation (BP) neural network is a commonly used feedforward artificial neural network. However, when the early warning model is constructed by using the BP neural network, the convergence rate of the model is slow, and the training process is easy to fall into a local minimum value, so that the training effect is poor. A Radial Basis Function (RBF) neural network is an artificial neural network with better performance developed after a BP neural network. As a feedforward artificial neural network, the RBF neural network is different from other feedforward artificial neural networks in that the radial basis function is selected as the activation function of the hidden layer. The performance of the RBF neural network depends greatly on the center position of its hidden layer, which is usually obtained by k-means clustering algorithm. However, since the k-means algorithm randomly determines the initial clustering center, the clustering result is sensitive to the position of the initial clustering center. At the same time, the method often ends with a locally optimal solution.
Unlike the k-means clustering algorithm, the Agglomerative Hierarchical Clustering (AHC) algorithm is a bottom-up hierarchical clustering algorithm, which avoids random determination of the original clustering center. The AHC algorithm treats each object as an independent cluster, and merges all objects in one cluster by continuously merging two closest clusters. Therefore, the clustering result of the algorithm is more stable, and the AHC algorithm can avoid entering a local optimal solution. The AHC algorithm has gained wide application in information retrieval, image classification and food science.
Therefore, in order to overcome the sensitivity of the traditional RBF neural network to the initial clustering center and improve the generalization accuracy of the RBF neural network, the present embodiment utilizes the AHC algorithm to adaptively acquire the center position of the hidden layer node of the RBF neural network, and proposes an AHC-RBF neural network model for food safety early warning. However, due to the high dimensionality and complexity of food inspection data, it is difficult to accurately determine the risk level of overly entered food inspection data. Therefore, it is necessary to fuse the risks of the multi-input food detection data by using an Analytic Hierarchy Process (AHP), and establish an early warning model by using the obtained risk value as an output, so as to improve the accuracy of food safety early warning and facilitate food safety control.
The AHP algorithm is a common risk assessment method and is suitable for the decision of processing multi-index complex problems. However, the traditional AHP algorithm has poor objectivity, because the judgment of the relative importance of each evaluation index completely depends on the subjective judgment of the operator, and therefore, once the operator makes an incorrect judgment, the evaluation result is unreasonable. The AHP-EW algorithm is an improved AHP algorithm with data-driven characteristics that calculates index weights by measuring the differences between data. Therefore, compared with the traditional AHP method, the AHP-EW algorithm is more objective and can reflect the inherent objective rule of data.
Fig. 1 is a flow chart of food safety pre-warning provided in an embodiment of the present invention. As shown in fig. 1, in order to effectively implement the food safety risk pre-warning, the embodiment provides a food safety pre-warning method combining an AHC-RBF neural network and an AHP-EW algorithm. The method uses an AHP-EW algorithm to fuse the safety risk of food detection data, uses the obtained risk fusion value as the expected output of an AHC-RBF neural network, uses the detection data as the input of the AHC-RBF neural network, and establishes an AHC-RBF neural network early warning model to predict the food safety risk of the detection data. And finally, the proposed food safety early warning method is used for predicting the food safety risk of meat products in certain province of China to verify the effectiveness of the method. The method is helpful for government departments to strengthen the supervision of food enterprises and control food safety.
In the embodiment, the AHP-EW algorithm is used for risk fusion of the food safety detection data to obtain a food safety risk fusion value of the detection data. The principle of the AHP-EW algorithm is as follows:
for the p-th sample, the standard correlation function f of the parameter qpq(x) The definition is as follows:
wherein x isq(1),xq(2),xq(3),xq(4) Is fpq(x) The node of (2).
The early warning model of the coacervation hierarchical clustering-radial basis function neural network provided by the embodiment improves the generalization precision of the traditional early warning model of the radial basis function neural network, and can accurately realize the prediction of food safety risks. And finally, carrying out food safety early warning analysis according to the modeling result, and being beneficial to strengthening supervision on related food production enterprises by related departments, thereby improving the food safety level and reducing the food safety risk.
If xq(2) And xq(3) Overlapping to obtain a lower side correlation function fpq(x):
Data after pretreatment were X ═ X (1) X (2) Λ X (n)]TObtaining an information matrix F using a lower-side correlation functionn×m:
Wherein x isq(2) (q is 1,2, L, m) is an average value.
Then, the present embodiment performs the center normalization processing as follows:
subsequently, the present embodiment migrates the negative number to positive zero, i.e., zero plus a positive fraction rpq=fp'q-tqN ( p 1,2, 1.. cndot., n; q 1, 2.. cndot., m), where tq=min(fp'q)<0(q=1,2,...,m)。
Obtain a positive matrix Rq n×mThe following were used:
according to Rq n×mObtaining an n-dimensional symmetric matrix COR:
the entropy is used for measuring the difference of data, and the entropy e of each index is calculated by the embodimentpThe calculation formula is as follows:
if it is notepTake the maximum value of 1. The smaller the entropy value of the index is, the larger the data difference is, and the higher the importance of the index is in comprehensive evaluation. Conversely, a larger entropy of the indicator indicates a smaller variance of the data and a lower importance of the indicator.
Calculating the weight wpThe calculation formula is as follows:
wherein, the weight value wpRepresenting the degree of importance of each index;
fusing data by using the weight vector to obtain fused data Y:
wherein the weight vector is W ═ W1,w2,...,wn]T。
In the embodiment, the fusion data Y is used as expected output of the food safety early warning model, the detection data is used as input of the early warning model, and the AHC-RBF neural network is used for establishing the food safety early warning model to realize food safety risk early warning. Setting the input vector of the AHC-RBF neural network as X ═ X1,x2,...,xn]The output vector is Z ═ Z1,z2,...,zm]The expected output of the AHC-RBF neural network is Y ═ Y obtained by the AHP-EW algorithm1,y2,...,ym]The number of hidden layer nodes is k. The training process of the AHC-RBF neural network is as follows:
fig. 2 is a schematic diagram of a truncated hierarchical tree according to an embodiment of the present invention. As shown in fig. 2, the present embodiment uses the AHC clustering algorithm to cluster the input data into k classes: a. the1,A2,...,Ak. The specific execution steps are as follows:
1) the embodiment calculates the Euclidean distance between every two samples in the data set, and stores the distance calculation result into the distance matrixD, in the formula (I). For any two samples x in the data seti、xj,xiAnd xjEuclidean distance d (x) between themi,xj) The calculation formula of (a) is as follows:
where s is the dimension of the sample data.
Then, the present embodiment treats each sample in the data set as a single sample cluster containing only the sample itself, and since the samples are independent of each other, the single sample clusters are independent of each other.
2) The present embodiment combines two clusters corresponding to the minimum euclidean distance in the distance matrix D to form a new cluster. And calculating Euclidean distances between the new cluster and other clusters, and updating the distance matrix D. This embodiment calculates euclidean distances between the new cluster and each of the other clusters using the WPGMC joining (linking) method. For cluster a and cluster b, the distance d (a, b) between cluster a and cluster b calculated by the WPGMC linkage method is as follows:
wherein the content of the first and second substances,to representAndthe euclidean distance between.Andrespectively, the weighted centroids of cluster a and cluster b. If cluster a is formed by combining cluster p and cluster q,thenObtained by the following formula:
3) and repeating the step 2) until all the clusters in the data set are merged into one cluster to form a hierarchical tree.
4) And 3) for the hierarchical tree obtained in the step 3), searching the whole hierarchical tree layer by layer from the top of the tree, and simultaneously recording the branch number G of the tree. When G equals k, the hierarchical tree is truncated, at which point the input data is divided into k clusters: a. the1,A2,...,Ak。
For cluster A1,A2,...,AkCalculating a cluster center position C of each cluster1,C2,...,Ck. Ith cluster AiCluster center C ofiThe calculation formula of (a) is as follows:
wherein, numiIs the ith cluster AiNumber of samples of (1), xjIs cluster AiS is the dimension of the sample data, CiFor the ith cluster AiThe cluster center of (a);
fig. 3 is a flowchart of an algorithm of the agglomerative hierarchical clustering-radial basis function neural network according to an embodiment of the present invention. As shown in fig. 3, in the present embodiment, a gaussian function is used as an activation function of hidden layer nodes of an AHC-RBF neural network, and C is calculated1,C2,...,CkAnd calculating the width of the Gaussian function center of each node of the hidden layer and an output matrix of the hidden layer as the central vector of the Gaussian function of the node of the hidden layer.
This embodiment calculates the width σ of the Gaussian function of the jth node in the hidden layerjThe calculation formula is as follows:
σj=min||Cj-Ci||,(j,i=1,2,...,k)∩(i≠j) (16)
wherein, | | Cj-CiI is CjAnd CiEuclidean distance between;
when the number of samples is P, the output matrix U of the hidden layer is calculated as follows:
wherein, the output uij of the jth node of the hidden layer of the ith sample is:
obtaining output Z of agglomerative hierarchical clustering-radial basis function neural networktThe calculation formula is as follows:
Zt=U·Wt(19)
wherein, WtIs the weight matrix between the hidden layer and the output layer during the t-th training, the initial value of t is 1, WtThe calculation formula of (a) is as follows:
Wtthe updated calculation formula of (2) is:
Wt+1=Wt+ηUT·(Y-Zt),η∈(0,1) (20)
where eta is the learning rate, ZtIs the output of the agglomerative hierarchical clustering-radial basis function neural network during the t-th training.
Finally, the present embodiment determines whether the training of the AHC-RBF neural network reaches a training stop condition. And if the training of the network reaches the training stopping condition, stopping the training to obtain the AHC-RBF neural network model. And if the training stopping condition is not met, continuing training. The training stopping condition is that the training times of the AHC-RBF neural network reach the preset training times or the training error of the AHC-RBF neural network is not more than the upper limit of the preset training error.
In order to verify the effectiveness of the food safety risk early warning method combining the AHC-RBF neural network and the AHP-EW algorithm, the food safety detection data of a meat product in a province in china from 3 to 8 months in 2015 is taken as a research object in the embodiment to perform early warning on the meat product safety risk. The early warning process of the embodiment is as follows: the method comprises the steps of preprocessing food detection data, and then performing risk fusion on risks of various food safety detection indexes by using an AHP-EW algorithm. And then, establishing a food safety early warning model by adopting an AHC-RBF neural network to predict the safety risk of the food detection data. And finally, analyzing the modeling result and carrying out food safety early warning analysis.
Fig. 4 is a schematic diagram of a partial detection result of a detection index according to a first embodiment of the present invention. As shown in fig. 4, in this embodiment, 7 detection indexes related to meat product safety, including cadmium, chromium, lead, coliform group, total number of colonies, sorbic acid, and nitrite, are selected to analyze the food safety risk of the meat product detection data. Cadmium, chromium and lead belong to heavy metal indexes, coliform group and colony total number belong to microorganism indexes, and sorbic acid and nitrite belong to food additive indexes.
Because the dimensions of each detection index are different, normalization processing needs to be carried out on meat product detection data when food safety early warning is carried out:
in the embodiment, a risk fusion value calculated by an AHP-EW algorithm is used as expected output of an AHC-RBF neural network, preprocessed detection sample data is used as input of the AHC-RBF neural network, and the AHC-RBF neural network is adopted to establish a food safety early warning model. The weighting ratio of the 7 detection indexes obtained by the AHP-EW algorithm is shown in fig. 5.
The number of meat products tested in 2015 from 3 months to 8 months is 337. 299 samples from 3 to 7 months in 2015 are used for training an AHC-RBF neural network early warning model, and 38 samples from 8 months in 2015 are used for predicting food safety risks. In order to verify the effectiveness of the proposed AHC-RBF model, a BP neural network and an RBF neural network are adopted for comparison experiments, risk prediction is carried out on detection data, and prediction effects of the three neural networks are compared. The experimental parameter settings are shown in table 1.
TABLE 1 Experimental parameters of three neural networks
In order to evaluate the prediction accuracy of the early warning models, the Average Relative Generalization Error (ARGE) and the Root Mean Square Error (RMSE) of each model are calculated respectively for the prediction result of each early warning model. The ARGE and RMSE of the early warning model are calculated through a formula (22) and a formula (23) respectively to obtain:
wherein, NetOutiAnd ExpectOutiThe actual output and the expected output of the early warning model are respectively.
A comparison of the results of the three neural network predictions is shown in table 2. Of the three neural networks, the BP neural network had the highest ARGE and RMSE values of 8.3348% and 0.0317, respectively, and the predicted performance of the neural network was the worst. The ARGE and RMSE values of the RBF neural network are 2.2123% and 0.0175 respectively, and the prediction effect is better than that of the BP neural network. The AHC-RBF neural network has the best generalization effect, and the ARGE and RMSE values of the AHC-RBF neural network are the minimum in the three neural networks, namely 1.3780% and 0.0092 respectively.
TABLE 2 comparison of the predicted results of three neural networks
Fig. 6 is a schematic diagram illustrating comparison of fitting curves of three types of neural networks according to an embodiment of the present invention. As can be seen from fig. 6, the prediction result of the BP neural network is worst and has a large difference from the actual value. The prediction result of the RBF neural network is superior to that of the BP neural network, but a certain difference still exists between the prediction value and the actual value. Among the three neural networks, the AHC-RBF neural network has the best prediction effect, and the prediction result is closest to the actual value.
Fig. 7 is a schematic diagram of generalized error curves of three neural networks according to an embodiment of the present invention. As can be seen from fig. 7, the BP neural network has the largest overall error, the RBF neural network has the smaller overall error, and the AHC-RBF neural network has the smallest overall error. The maximum prediction error of the three neural networks is achieved at the 33 th sample, wherein the prediction error of the BP neural network at the sample is 0.1079, the prediction error of the RBF neural network is 0.0999, and the prediction error of the AHC-RBF neural network is 0.0494, which is obviously smaller than the prediction errors of the BP neural network and the RBF neural network.
In this embodiment, statistical analysis is performed on the risk values of the detection samples from 3 to 7 months in 2015 to determine the early warning threshold, and early warning analysis is performed on the detection samples from 8 months in 2015.
Fig. 8 is a schematic diagram of the distribution of risk value intervals of meat products from 3 months to 7 months in 2015 according to the first embodiment of the present invention. As can be seen from fig. 8, the number of samples in the interval [0.2, 0.3) is the largest, and 111 samples in total account for 37.12% of the total number of samples. The number of samples in the interval [0, 0.1) was 79, accounting for 26.42% of the total number of samples. Followed by an interval [0.3, 0.4) within which a total of 66 samples were located, representing 22.07% of the total samples. The number of samples in the interval [0.1, 0.2) is small, and 29 samples in total account for 9.70% of the total number of samples. The number of samples in the interval [0.4, 0.5) is the smallest, and only 14 samples account for 4.68% of the total number of samples. In all samples from 3 months to 7 months, the samples with the risk value exceeding 0.4 are higher than those of other samples, and are more likely to cause food safety accidents, so that food safety supervision departments need to pay more attention to the samples, and therefore, the early warning threshold value is set to be 0.4.
Fig. 9 is a schematic view of the risk value of the meat product of month 8 in 2015 provided by the first embodiment of the invention. As can be seen from fig. 9, the risk values for most samples are below the warning threshold. However, the risk value for the 33 rd sample was 0.433, exceeding the pre-warning threshold. The government department needs to trace back the production information of the 33 th sample, supervise and urge related food production enterprises to strengthen risk management and control, and reduce food safety risks. The risk value for the fifth sample was 0.370, which is below the pre-warning threshold, but is relatively high compared to the risk values for the other test samples in month 8. Therefore, the government department should pay close attention to the risk condition of the sample, and sample test is carried out on the sample with relatively high risk value. The risk value for the 28 th sample was 0.268, which is lower than the average risk value for the 8 month sample. The risk value for this sample was relatively low compared to the other test samples of 8 months. Thus, the food safety status of the 28 th sample can be substantially reassured.
The overall risk level is higher at month 8 compared to the food safety risk at months 3 to 7. The average risk value of the 8-month test sample is 0.302, which is obviously higher than the average risk value of 0.227 of the test sample from 3 months to 7 months. Therefore, government departments should pay close attention to the meat product detection samples in 8 months, strengthen the supervision of related food production enterprises, take measures to control food safety risks and reduce hidden dangers.
The embodiment provides a food safety risk early warning method combining a neural network and a hierarchical analysis algorithm, aiming at the characteristics of high dimensionality and complexity of food safety monitoring data, the hierarchical analysis algorithm based on entropy weight is utilized to carry out risk fusion on food safety detection data, an obtained risk fusion value is used as expected output of an aggregation-hierarchy clustering-radial basis function neural network, the detection data is used as input of the aggregation-hierarchy clustering-radial basis function neural network, and an aggregation-hierarchy clustering-radial basis function neural network early warning model is established to predict food safety risk of the detection data. The early warning model of the coacervation hierarchical clustering-radial basis function neural network improves the generalization precision of the traditional early warning model of the radial basis function neural network, and can accurately realize the prediction of food safety risks. And finally, carrying out food safety early warning analysis according to the modeling result, and being beneficial to strengthening supervision on related food production enterprises by related departments, thereby improving the food safety level and reducing the food safety risk.
It will be understood that the above embodiments are merely exemplary embodiments taken to illustrate the principles of the present invention, which is not limited thereto. It will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the spirit and substance of the invention, and these modifications and improvements are also considered to be within the scope of the invention.
Claims (3)
1. A food safety risk early warning method combining a coacervation hierarchical clustering-radial basis function neural network and an entropy weight-based hierarchical analysis algorithm is characterized by comprising the following steps:
obtaining food safety detection data of food to be detected;
performing risk fusion on the food safety detection data by using a hierarchical analysis algorithm based on entropy weight to obtain food safety risk fusion data of the food safety detection data;
taking the food safety risk fusion data as expected output of a food safety risk early warning model;
taking the food safety detection data as the input of a food safety risk early warning model;
forming a food safety risk early warning model according to the coacervation hierarchical clustering-radial basis function neural network;
and carrying out food safety risk early warning on the food to be detected by using the food safety risk early warning model.
2. The food safety risk early warning method combining the agglomerative hierarchical clustering-radial basis function neural network and the hierarchical analysis algorithm based on entropy weight as claimed in claim 1, wherein the step of performing risk fusion on the food safety detection data by using the hierarchical analysis algorithm based on entropy weight to obtain the food safety risk fusion data of the food safety detection data comprises:
for the p-th sample, the standard correlation function f of the parameter qpq(x) The definition is as follows:
wherein x isq(1),xq(2),xq(3),xq(4) Is fpq(x) A node of (2);
if xq(2) And xq(3) Overlapping to obtain a lower side correlation function fpq(x):
Data after pretreatment were X ═ X (1) X (2) Λ X (n)]TObtaining an information matrix F according to the lower side correlation functionn×m:
Wherein x isq(2) (q ═ 1,2, L, m) is an average value;
obtain a positive matrix Rq n×mThe following were used:
according to Rq n×mObtaining an n-dimensional symmetric matrix COR:
calculating the entropy e of each indexpThe calculation formula is as follows:
calculating weightsValue wpThe calculation formula is as follows:
wherein, the weight value wpRepresenting the degree of importance of each index;
fusing data by using the weight vector to obtain fused data Y:
wherein the weight vector is W ═ W1,w2,...,wn]T。
3. The method for food safety risk early warning by combining the agglomerative hierarchical clustering-radial basis function neural network with an entropy weight-based hierarchical analysis algorithm according to claim 1, wherein the step of forming the food safety risk early warning model according to the agglomerative hierarchical clustering-radial basis function neural network comprises:
clustering the input data into k classes using a agglomerative hierarchical clustering algorithm: a. the1,A2,...,Ak;
Calculating a cluster center position C for each cluster1,C2,...,CkThe calculation formula is as follows:
wherein, numiIs the ith cluster AiNumber of samples of (1), xjIs cluster AiS is the dimension of the sample data, CiFor the ith cluster AiThe cluster center of (a);
calculating the width sigma of the Gaussian function of the jth node in the hidden layerjThe calculation formula is as follows:
σj=min||Cj-Ci||,(j,i=1,2,...,k)∩(i≠j) (16)
wherein, | | Cj-CiI is CjAnd CiEuclidean distance between;
when the number of samples is P, the output matrix U of the hidden layer is calculated as follows:
wherein, the output u of the jth node of the hidden layer of the ith sampleijComprises the following steps:
obtaining output Z of agglomerative hierarchical clustering-radial basis function neural networktThe calculation formula is as follows:
Zt=U·Wt(19)
wherein, WtIs the weight matrix between the hidden layer and the output layer during the t-th training, the initial value of t is 1, WtThe calculation formula of (a) is as follows:
Wtthe updated calculation formula of (2) is:
Wt+1=Wt+ηUT·(Y-Zt),η∈(0,1) (20)
where eta is the learning rate, ZtIs the output of the agglomerative hierarchical clustering-radial basis function neural network during the t-th training.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010546055.8A CN111882150A (en) | 2020-06-16 | 2020-06-16 | Food safety risk early warning method combining neural network and analytic hierarchy process |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010546055.8A CN111882150A (en) | 2020-06-16 | 2020-06-16 | Food safety risk early warning method combining neural network and analytic hierarchy process |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111882150A true CN111882150A (en) | 2020-11-03 |
Family
ID=73156709
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010546055.8A Pending CN111882150A (en) | 2020-06-16 | 2020-06-16 | Food safety risk early warning method combining neural network and analytic hierarchy process |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111882150A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112330332A (en) * | 2021-01-05 | 2021-02-05 | 南京智闪萤科技有限公司 | Methods, computing devices, and media for identifying fraud risk with respect to node tasks |
CN114004719A (en) * | 2021-10-12 | 2022-02-01 | 杭州畅鸿信息技术有限公司 | Food and drug supervision system and method based on big data and cloud computing |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108876100A (en) * | 2018-04-28 | 2018-11-23 | 北京化工大学 | Neural network food safety risk prediction model based on ISM and AHP |
CN109086887A (en) * | 2018-08-06 | 2018-12-25 | 贵州大学 | Method for early warning of the depth RBF neural in conjunction with the AHP based on entropy weight |
-
2020
- 2020-06-16 CN CN202010546055.8A patent/CN111882150A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108876100A (en) * | 2018-04-28 | 2018-11-23 | 北京化工大学 | Neural network food safety risk prediction model based on ISM and AHP |
CN109086887A (en) * | 2018-08-06 | 2018-12-25 | 贵州大学 | Method for early warning of the depth RBF neural in conjunction with the AHP based on entropy weight |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112330332A (en) * | 2021-01-05 | 2021-02-05 | 南京智闪萤科技有限公司 | Methods, computing devices, and media for identifying fraud risk with respect to node tasks |
CN114004719A (en) * | 2021-10-12 | 2022-02-01 | 杭州畅鸿信息技术有限公司 | Food and drug supervision system and method based on big data and cloud computing |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Huang et al. | An empirical analysis of data preprocessing for machine learning-based software cost estimation | |
Geng et al. | Early warning and control of food safety risk using an improved AHC-RBF neural network integrating AHP-EW | |
Tang et al. | A pruning neural network model in credit classification analysis | |
Xie et al. | Blockchain financial investment based on deep learning network algorithm | |
CN109101584B (en) | Sentence classification improvement method combining deep learning and mathematical analysis | |
CN112735097A (en) | Regional landslide early warning method and system | |
CN113572625B (en) | Fault early warning method, early warning device, equipment and computer medium | |
CN110852856A (en) | Invoice false invoice identification method based on dynamic network representation | |
CN109472088A (en) | A kind of shale controlled atmosphere production well production Pressure behaviour prediction technique | |
CN109191276B (en) | P2P network lending institution risk assessment method based on reinforcement learning | |
CN111882150A (en) | Food safety risk early warning method combining neural network and analytic hierarchy process | |
CN115348074A (en) | Deep space-time mixed cloud data center network flow real-time detection method | |
Zhang | Food safety risk intelligence early warning based on support vector machine | |
CN114580934A (en) | Early warning method for food detection data risk based on unsupervised anomaly detection | |
CN107016416A (en) | The data classification Forecasting Methodology merged based on neighborhood rough set and PCA | |
US11816556B1 (en) | Method for predicting air quality index (AQI) based on a fusion model | |
CN116713631A (en) | Welding quality prediction method, device and equipment | |
CN115392618A (en) | AHP-EW and AE-RNN fusion-based food safety risk early warning model and establishment method thereof | |
CN113837481B (en) | Financial big data management system based on block chain | |
CN113935846A (en) | Financial risk prediction and evaluation system and method based on mathematical statistics | |
Ding et al. | Research on Shanghai Stock Exchange 50 Index Forecast Based on Deep Learning | |
Tian et al. | Structure feature extraction for hierarchical alarm flood classification and alarm prediction | |
Kaur et al. | Blog response volume prediction using adaptive neuro fuzzy inference system | |
CN111859798A (en) | Flow industrial fault diagnosis method based on bidirectional long-time and short-time neural network | |
Yadav | Software Reliability Prediction by using Deep Learning Technique |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20201103 |
|
RJ01 | Rejection of invention patent application after publication |