CN112508456A - Food safety risk assessment method, system, computer equipment and storage medium - Google Patents

Food safety risk assessment method, system, computer equipment and storage medium Download PDF

Info

Publication number
CN112508456A
CN112508456A CN202011558703.8A CN202011558703A CN112508456A CN 112508456 A CN112508456 A CN 112508456A CN 202011558703 A CN202011558703 A CN 202011558703A CN 112508456 A CN112508456 A CN 112508456A
Authority
CN
China
Prior art keywords
food
spot
risk
data
inspection
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
Application number
CN202011558703.8A
Other languages
Chinese (zh)
Inventor
党升
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An International Smart City Technology Co Ltd
Original Assignee
Ping An International Smart City Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ping An International Smart City Technology Co Ltd filed Critical Ping An International Smart City Technology Co Ltd
Priority to CN202011558703.8A priority Critical patent/CN112508456A/en
Publication of CN112508456A publication Critical patent/CN112508456A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0635Risk analysis of enterprise or organisation activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Game Theory and Decision Science (AREA)
  • Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Development Economics (AREA)
  • Biomedical Technology (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Animal Behavior & Ethology (AREA)
  • Databases & Information Systems (AREA)
  • Educational Administration (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a food safety risk assessment method, which comprises the following steps: obtaining sample food spot check data, wherein the sample food spot check data comprise a plurality of spot check items, spot check article types corresponding to the spot check items and risk levels of the spot check items; constructing a food spot inspection knowledge map according to the sample food spot inspection data; training a deep learning network (GCN) model based on the food sampling inspection knowledge graph and the sample food sampling inspection data to obtain a food risk prediction model; receiving the information of the types of the food to be detected and the information of the items to be spot-checked; drawing the food spot inspection knowledge graph based on the category information and the item information to be spot inspected to obtain data of the graph to be inspected; and inputting the atlas data to be detected into the food risk prediction model for calculation to obtain the target risk grade corresponding to the food to be detected. The method can efficiently predict the food risk.

Description

Food safety risk assessment method, system, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of risk management and control, in particular to a food safety risk assessment method, a food safety risk assessment system, computer equipment and a storage medium.
Background
Food safety is closely related to our life, and the national food safety administration can regularly carry out spot check and investigation on food and carry out detection and management on food safety. At present, the industry provides a method for performing random sampling for both sampling items and sampling items, and because mutual influences also exist among sampling items, sampling items and sampling items, the method for performing random sampling cannot consider the correlations, and high-risk sampling items corresponding to food are not sampled, so that the sampling mode is not accurate, and consumes time and labor.
Disclosure of Invention
In view of the above, an object of the embodiments of the present invention is to provide a method, a system, a computer device and a storage medium for evaluating food safety risk, so as to solve the problem that the sampling item and the sampling item are inaccurate during random sampling.
In order to achieve the above object, an embodiment of the present invention provides a food safety risk assessment method, including:
obtaining sample food spot inspection data;
constructing a food spot inspection knowledge map according to the sample food spot inspection data;
training a deep learning network (GCN) model based on the food sampling inspection knowledge graph and the sample food sampling inspection data to obtain a food risk prediction model;
receiving the information of the types of the food to be detected and the information of the items to be spot-checked;
drawing the food spot inspection knowledge graph based on the category information and the item information to be spot inspected to obtain data of the graph to be inspected;
and inputting the atlas data to be detected into the food risk prediction model for calculation to obtain the target risk grade corresponding to the food to be detected.
Further, the constructing a food spot inspection knowledge map according to the sample food spot inspection data comprises:
acquiring entity words in the sample food spot check data through an entity concept relationship, wherein the entity words comprise spot check item names and spot check item names;
constructing a framework of the food spot check knowledge map according to the entity conceptual relationship between the spot check item class name and the entity words of the spot check project name;
and calculating the correlation coefficient among the entity words so as to correct the frame of the sample food sampling inspection knowledge graph according to the correlation coefficient to obtain the food sampling inspection knowledge graph.
Further, the calculating the correlation coefficient between the entity words to correct the frame of the sample food sampling inspection knowledge graph according to the correlation coefficient to obtain the food sampling inspection knowledge graph comprises:
calculating a correlation coefficient between the entity words;
and filling the correlation coefficient into a frame of the food spot inspection knowledge graph, and connecting and correcting the associated entity words to obtain the food spot inspection knowledge graph.
Further, the training of a deep learning network (GCN) model based on the food spot inspection knowledge graph and the sample food spot inspection data to obtain a food risk prediction model comprises:
inputting the food sampling inspection map into the deep learning network GCN model, wherein entity words in the food sampling inspection map correspond to the number of nodes in the deep learning network GCN model one by one;
and taking the risk grade as the output of the deep learning network GCN model, training the deep learning network GCN model, and obtaining a food risk prediction model, wherein the risk grade comprises no risk, low risk, medium risk and high risk.
Further, the step of performing graph extraction on the food spot inspection knowledge graph based on the category information and the item information to be spot inspected to obtain graph data to be detected comprises:
inputting the type information of the food to be detected and the item information to be subjected to spot inspection into the food spot inspection knowledge map so as to find the association relation between the type information and the item information to be subjected to spot inspection in the food spot inspection knowledge map;
and extracting the association relation corresponding to the category information and the item information to be subjected to spot inspection, and reconstructing to obtain the atlas data to be detected.
Further, the method further comprises:
storing the target risk level into a blockchain.
In order to achieve the above object, an embodiment of the present invention provides a food safety risk assessment system, including:
the acquisition module is used for acquiring sample food spot inspection data;
the construction module is used for constructing a food sampling inspection knowledge map according to the sample food sampling inspection data;
the training module is used for training a deep learning network (GCN) model based on the food sampling inspection knowledge graph and the sample food sampling inspection data to obtain a food risk prediction model;
the receiving module is used for receiving the type information of the food to be detected and the item information to be checked;
the extraction module is used for carrying out drawing extraction on the food spot inspection knowledge graph based on the class information and the item information to be spot inspected to obtain data of the graph to be inspected;
and the calculation module is used for inputting the atlas data to be detected into the food risk prediction model for calculation to obtain the target risk grade corresponding to the food to be detected.
Further, the building module is further configured to:
acquiring entity words in the sample food spot check data through an entity concept relationship, wherein the entity words comprise spot check item names and spot check item names;
constructing a framework of the food spot check knowledge map according to the entity conceptual relationship between the spot check item class name and the entity words of the spot check project name;
and calculating the correlation coefficient among the entity words so as to correct the frame of the sample food sampling inspection knowledge graph according to the correlation coefficient to obtain the food sampling inspection knowledge graph.
To achieve the above object, an embodiment of the present invention provides a computer device, which includes a memory and a processor, where the memory stores a computer program that can run on the processor, and the computer program, when executed by the processor, implements the steps of the food safety risk assessment method as described above.
To achieve the above object, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored, where the computer program is executable by at least one processor, so as to cause the at least one processor to execute the steps of the food safety risk assessment method as described above.
According to the food safety risk assessment method, the food safety risk assessment system, the computer equipment and the storage medium, correlation between the sampling inspection item class and the sampling inspection item is analyzed based on the sampling inspection data of the sample food, the food sampling inspection knowledge graph is constructed based on the correlation relation, then the food sampling inspection knowledge graph is classified and predicted by using the deep learning network GCN model, training is carried out through the sampling inspection data of the sample food in the model, the influence of other sampling inspection item classes and sampling inspection items related to the sampling inspection item class is considered, and the food risk prediction can be well carried out by using the sampling inspection data of the sample food and the food sampling inspection knowledge graph.
Drawings
Fig. 1 is a flowchart of a first embodiment of a food safety risk assessment method according to the present invention.
Fig. 2 is a schematic diagram of program modules of a second embodiment of the food safety risk assessment system according to the present invention.
Fig. 3 is a schematic diagram of a hardware structure of a third embodiment of the computer device according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
Referring to fig. 1, a flowchart illustrating steps of a food safety risk assessment method according to a first embodiment of the present invention is shown. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description is made by way of example with the computer device 2 as the execution subject. The details are as follows.
And step S100, obtaining sample food spot inspection data.
Specifically, the sample food spot test data includes: the type of the spot check product, the time of the spot check, the batch of the spot check, the project of the spot check and the unfit batch of the spot check. The sampling type refers to the classification of specific sample food for food sampling inspection, such as milk, bread, beer and other foods. The sampling inspection items comprise items for sampling inspection of sampling inspection products, such as items for detecting whether harmful substances such as trichlorocyanamide, cyanide and the like exceed standards. Each sampling inspection class has a plurality of sampling inspection items, and each sampling inspection item has a sampling inspection unqualified batch; the risk grade refers to the correlation existing between the categories and the correlation between the categories analyzed according to the sampling data.
And S102, constructing a food spot inspection knowledge map according to the sample food spot inspection data.
Specifically, the sample food sampling inspection knowledge graph is divided into a mode layer and a data layer on the basis of a logic structure, wherein the data layer mainly comprises a series of facts, and the knowledge is stored by taking the facts as a unit. If a fact is expressed by a triple such as (entity 1, relationship, entity 2), (entity, attribute value), for example: the melamine content in the milk is sampled and checked, and then the following steps can be extracted: the method comprises the steps of (1) milk, content and melamine, wherein the milk of a sampling inspection class is an entity 1, the content is a relation, and the melamine of a sampling inspection item is an entity 2, so that a sample food sampling inspection knowledge graph is constructed. Graph databases may be selected as storage media, such as open source Neo4j, flickdb by Twitter, JanusGraph, and the like. The mode layer is built on the data layer, and a series of fact expressions of the data layer are specified mainly through an ontology library, for example: together, maps of the same spot-check item.
Exemplarily, the step S102 specifically includes:
step S102A, obtaining entity words in the sample food spot check data through entity concept relationship, wherein the entity words comprise spot check item names and spot check item names.
Specifically, entity words of the spot check item class and the spot check item are extracted through a Scheam entity concept relationship, wherein the entity concept relationship is as follows: correlations exist between the sample class and the sample item, such as: the method comprises the steps of sampling and inspecting the trichlorocyanamide in the milk powder, wherein the sampling and inspecting item is the trichlorocyanamide, and the sampling and inspecting product is the milk powder. Furthermore, the sampling items comprise entity words such as soybean, soybean soy sauce, peanut oil and the like, and the sampling items comprise entity words such as trichlorocyanamide, nitrite and the like.
Step S102B, constructing a framework of the food spot check knowledge map according to the entity concept relationship between the spot check item name and the entity words of the spot check project name.
Specifically, each spot check item is connected with a spot check item class to obtain a framework of the food spot check knowledge map.
Step S102C, calculating the correlation coefficient among the entity words, and correcting the framework of the sample food sampling inspection knowledge graph according to the correlation coefficient to obtain the food sampling inspection knowledge graph.
Exemplarily, the step S102C specifically includes:
calculating a correlation coefficient between the entity words; and filling the correlation coefficient into a frame of the food spot inspection knowledge graph, and connecting and correcting the associated entity words to obtain the food spot inspection knowledge graph.
Specifically, the correlation calculation includes a fraction defective calculation and a correlation coefficient calculation. The fraction defective is calculated by equation 1: and calculating the reject rate of all the categories in all the historical months, and carrying out statistical analysis on the rule of the data. Correlation coefficient calculation the correlation between all the spot check item classes X and all the spot check items Y is calculated by pearson correlation coefficient. The pearson correlation coefficient ρ (X, Y) is calculated as follows:
Figure BDA0002859629430000061
here, cov (X, Y) represents the covariance between the two real random variables of the sampling class X and the sampling item Y whose expected values are ex and ey, respectively, σ X represents the variance of the sampling class X, and σ Y represents the variance of the sampling item Y. The larger ρ (X, Y), the greater the degree of correlation; ρ (X, Y) ═ 0, corresponds to the lowest degree of correlation. And recording the Pearson correlation coefficient by using a correlation coefficient matrix, wherein a threshold value S is set, S is 0.5, if the Pearson correlation coefficient is more than 0.5, the correlation exists between two sampling items, two sampling items or between the sampling items, and the Pearson correlation coefficient is a corresponding value in the matrix. The details are shown in the following table:
Figure BDA0002859629430000071
and finally, filling the calculated correlation coefficient into a frame of the food spot inspection knowledge graph, and connecting and correcting the related concepts to obtain the food spot inspection knowledge graph.
And step S104, training a deep learning network (GCN) model based on the food sampling inspection knowledge graph and the sample food sampling inspection data to obtain a food risk prediction model.
Specifically, risk prediction is carried out based on the established food sampling inspection knowledge graph and sample food sampling inspection data, and a deep learning network GCN model is used for training so that the deep learning network GCN model outputs a predicted value to obtain a food risk prediction model.
Exemplarily, the step S104 specifically includes:
inputting the food sampling inspection map into the deep learning network GCN model, wherein entity words in the food sampling inspection map correspond to the number of nodes in the deep learning network GCN model one by one; and taking the risk grade as the output of the deep learning network GCN model, training the deep learning network GCN model, and obtaining a food risk prediction model, wherein the risk grade comprises no risk, low risk, medium risk and high risk.
Specifically, the GCN model is a neural network that operates on graph data, where a given graph G is (V, E), V is a vertex, E is an edge, and a one-dimensional array is used to store all vertex data in the graph; the data of the relationships (edges or arcs) between vertices are stored in a two-dimensional array called the adjacency matrix G. The inputs to the GCN model are: an input dimension is a feature matrix X of NxF, where N is the number of nodes in the graph network and F is the input feature number for each node. One graph structure is characterized by a matrix with dimension of NxN, and a hidden layer in GCN can be written as Hi=f(Hi-1And, a), wherein H ═ X, f is a propagation rule. Each hidden layer H corresponds to a feature matrix with dimension N × F, and each row in the matrix is a feature representation of a certain node. In each layer, the GCN aggregates this information using the propagation rule f to form the features of the next layer. As a result, features become increasingly abstract in each successive layer. Within this framework, the variants of GCN differ only in the choice of propagation rule f.
The GCN is also a neural network layer, and the propagation modes among layers are as follows:
Figure BDA0002859629430000081
wherein the content of the first and second substances,
Figure BDA0002859629430000082
i is a unit matrix of the image data,
Figure BDA0002859629430000083
is that
Figure BDA0002859629430000084
Degree matrix of (d), H is a feature of each layer, H(l+1)Representing the characteristics of layer l +1, H is the characteristic matrix X for the input layer, and σ is a non-linear activation function.
A GCN model of a two-layer network is constructed according to needs, the activating functions respectively adopt ReLU and Softmax, and then the overall forward propagation formula of the ReLU is as follows:
Figure BDA0002859629430000085
wherein softmax is a loss function, W(0)Denotes the first network layer, W(1)Representing a layer-two network layer.
The Softmax cross entropy loss function that defines the prediction classification target is:
Figure BDA0002859629430000086
wherein, yDRepresenting a set of knowledge-graph samples with risk classes, d representing a knowledge-graph sample with risk classes, YdfRepresenting risk classes of a knowledge-graph sample with risk classes, ZdfIn order to be able to predict the level of risk,
Figure BDA0002859629430000087
represents YdfAnd ZdfCan be understood as a probability value, which reflects the probability of the predicted risk level: the greater the probability, the greater the likelihood.
Model training of the food risk prediction model is carried out based on the deep learning network model, the food sampling inspection knowledge map and the sample food sampling inspection data, and the model input is as follows: a feature matrix X of dimension N X F, where N is the number of nodes in the graph network (category number + item number) and F is the risk level of each node (category, item) for the last 12 months of input. The dimension of the graph structure is characterized by an NxN matrix, such as a correlation coefficient matrix A of the graph class and the item. The predicted value is the 13 th month risk grade of each category, and four grades of no risk, low risk, medium risk and high risk are provided. The trained food risk prediction model is used for predicting, the relevance among categories, items and items is considered, the high-risk food categories are evaluated and predicted, key spot inspection is carried out, the randomness of random spot inspection is eliminated, and the spot inspection is carried out intelligently and reasonably based on the rule of big data.
And step S106, receiving the information of the types of the food to be detected and the information of the items to be checked.
Specifically, the type information and the item information of the food to be detected are input into a food spot inspection knowledge graph to find a corresponding association relationship, and the corresponding association relationship is extracted and reconstructed to obtain the data of the graph to be detected.
And S108, drawing the food spot inspection knowledge graph based on the category information and the item information to be spot inspected to obtain data of the graph to be inspected.
Specifically, the type information of the food to be detected and the item information to be spot-checked are input into the food spot-check knowledge graph to find out the corresponding association relation, and the corresponding association relation is extracted and then reconstructed to obtain the data of the graph to be detected.
Exemplarily, the step S108 specifically includes:
step S108A, inputting the type information of the food to be detected and the item information to be spot-checked into the food spot-check knowledge map so as to find the association relation between the type information and the item information to be spot-checked in the food spot-check knowledge map.
And step S108B, extracting the association relation corresponding to the category information and the item information to be sampled and then reconstructing to obtain the atlas data to be detected.
Specifically, maps associated with the type information of the food to be detected and the item information to be detected are found in the food spot-check knowledge maps and extracted, and then the maps are combined into data of the maps to be detected of the food to be detected, so that the data can be input into a food risk prediction model for risk grade calculation.
And S110, inputting the atlas data to be detected into the food risk prediction model for calculation to obtain the risk grade corresponding to the food to be detected.
Specifically, the atlas data to be detected is input into a food risk prediction model, so that a risk value corresponding to the food to be detected is output through the food risk prediction model, and corresponding risk grades can be obtained according to the risk values and can be divided into four grades of no risk, low risk, medium risk and high risk. When the risk level is predicted, all other types and item information are fused, graph data and various risk factors are integrated comprehensively, a deep learning neural network is fused, and the food risk can be well predicted.
Illustratively, the method further comprises:
storing the target risk level into a blockchain.
Specifically, the target risk level corresponding to the food to be detected is uploaded to the block chain, so that the safety and the fair transparency to the user of the food to be detected can be guaranteed. The user equipment may download the target risk level from the blockchain to verify whether the target risk level corresponding to the food to be detected is tampered. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Example two
Referring to fig. 2, a schematic diagram of program modules of a second embodiment of the food safety risk assessment system of the present invention is shown. In this embodiment, the food safety risk assessment system 20 may include or be divided into one or more program modules, which are stored in a storage medium and executed by one or more processors to implement the present invention and implement the above-described food safety risk assessment method. The program modules referred to in the embodiments of the present invention refer to a series of computer program instruction segments capable of performing specific functions, and are more suitable for describing the execution process of the food safety risk assessment system 20 in a storage medium than the program itself. The following description will specifically describe the functions of the program modules of the present embodiment:
the obtaining module 200 is configured to obtain sample food spot inspection data.
Specifically, the sample food spot test data includes: the type of the spot check product, the time of the spot check, the batch of the spot check, the project of the spot check and the unfit batch of the spot check. The sampling type refers to the classification of specific sample food for food sampling inspection, such as milk, bread, beer and other foods. The sampling inspection items comprise items for sampling inspection of sampling inspection products, such as items for detecting whether harmful substances such as trichlorocyanamide, cyanide and the like exceed standards. Each sampling inspection class has a plurality of sampling inspection items, and each sampling inspection item has a sampling inspection unqualified batch; the risk grade refers to the correlation existing between the categories and the correlation between the categories analyzed according to the sampling data.
And the construction module 202 is configured to construct a food spot inspection knowledge graph according to the sample food spot inspection data.
Specifically, the sample food sampling inspection knowledge graph is divided into a mode layer and a data layer on the basis of a logic structure, wherein the data layer mainly comprises a series of facts, and the knowledge is stored by taking the facts as a unit. If a fact is expressed by a triple such as (entity 1, relationship, entity 2), (entity, attribute value), for example: the melamine content in the milk is sampled and checked, and then the following steps can be extracted: the method comprises the steps of (1) milk, content and melamine, wherein the milk of a sampling inspection class is an entity 1, the content is a relation, and the melamine of a sampling inspection item is an entity 2, so that a sample food sampling inspection knowledge graph is constructed. Graph databases may be selected as storage media, such as open source Neo4j, flickdb by Twitter, JanusGraph, and the like. The mode layer is built on the data layer, and a series of fact expressions of the data layer are specified mainly through an ontology library, for example: together, maps of the same spot-check item.
And the training module 204 is used for training a deep learning network (GCN) model based on the food sampling inspection knowledge graph and the sample food sampling inspection data to obtain a food risk prediction model.
Specifically, risk prediction is carried out based on the established food sampling inspection knowledge graph and sample food sampling inspection data, and a deep learning network GCN model is used for training so that the deep learning network GCN model outputs a predicted value to obtain a food risk prediction model.
Illustratively, the training module 204 is specifically configured to:
inputting the food sampling inspection map into the deep learning network GCN model, wherein entity words in the food sampling inspection map correspond to the number of nodes in the deep learning network GCN model one by one; and taking the risk grade as the output of the deep learning network GCN model, training the deep learning network GCN model, and obtaining a food risk prediction model, wherein the risk grade comprises no risk, low risk, medium risk and high risk.
Specifically, the GCN model is a neural network that operates on graph data, where a given graph G is (V, E), V is a vertex, E is an edge, and a one-dimensional array is used to store all vertex data in the graph; the data of the relationships (edges or arcs) between vertices are stored in a two-dimensional array called the adjacency matrix G. The inputs to the GCN model are: an input dimension is a feature matrix X of NxF, where N is the number of nodes in the graph network and F is the input feature number for each node. One graph structure is characterized by a matrix with dimension of NxN, and a hidden layer in GCN can be written as Hi=f(Hi-1And, a), wherein H ═ X, f is a propagation rule. Each hidden layer H corresponds to a feature matrix with dimension N × F, and each row in the matrix is a feature representation of a certain node. In each layer, the GCN aggregates this information using the propagation rule f to form the features of the next layer. As a result, features become increasingly abstract in each successive layer. In this framework, variants of GCN are merely in flightThe choice of rule f differs.
The GCN is also a neural network layer, and the propagation modes among layers are as follows:
Figure BDA0002859629430000121
wherein the content of the first and second substances,
Figure BDA0002859629430000122
i is a unit matrix of the image data,
Figure BDA0002859629430000123
is that
Figure BDA0002859629430000124
Degree matrix of (d), H is a feature of each layer, H(l+1)Representing the characteristics of layer l +1, H is the characteristic matrix X for the input layer, and σ is a non-linear activation function.
A GCN model of a two-layer network is constructed according to needs, the activating functions respectively adopt ReLU and Softmax, and then the overall forward propagation formula of the ReLU is as follows:
Figure BDA0002859629430000125
wherein softmax is a loss function, W(0)Denotes the first network layer, W(1)Representing a layer-two network layer.
The Softmax cross entropy loss function that defines the prediction classification target is:
Figure BDA0002859629430000126
wherein, yDRepresenting a set of knowledge-graph samples with risk classes, d representing a knowledge-graph sample with risk classes, YdfRepresenting risk classes of a knowledge-graph sample with risk classes, ZdfIs the predicted risk level.
Model training of the food risk prediction model is carried out based on the deep learning network model, the food sampling inspection knowledge map and the sample food sampling inspection data, and the model input is as follows: a feature matrix X of dimension N X F, where N is the number of nodes in the graph network (category number + item number) and F is the risk level of each node (category, item) for the last 12 months of input. The dimension of the graph structure is characterized by an NxN matrix, such as a correlation coefficient matrix A of the graph class and the item. The predicted value is the 13 th month risk grade of each category, and four grades of no risk, low risk, medium risk and high risk are provided.
The receiving module 206 is configured to receive the category information of the food to be detected and the item information to be spot-checked.
Specifically, the type information and the item information of the food to be detected are input into a food spot inspection knowledge graph to find a corresponding association relationship, and the corresponding association relationship is extracted and reconstructed to obtain the data of the graph to be detected.
And the extraction module 208 is configured to perform map extraction on the food spot check knowledge map based on the category information and the item information to be spot checked to obtain map data to be detected.
Specifically, the type information of the food to be detected and the item information to be spot-checked are input into the food spot-check knowledge graph to find out the corresponding association relation, and the corresponding association relation is extracted and then reconstructed to obtain the data of the graph to be detected.
Illustratively, the extraction module 208 is specifically configured to:
inputting the type information of the food to be detected and the item information to be subjected to spot inspection into the food spot inspection knowledge map so as to find the association relation between the type information and the item information to be subjected to spot inspection in the food spot inspection knowledge map. And extracting the association relation corresponding to the category information and the item information to be subjected to spot inspection, and reconstructing to obtain the atlas data to be detected.
Specifically, maps associated with the type information of the food to be detected and the item information to be detected are found in the food spot-check knowledge maps and extracted, and then the maps are combined into data of the maps to be detected of the food to be detected, so that the data can be input into a food risk prediction model for risk grade calculation.
The calculating module 210 is configured to input the atlas data to be detected into the food risk prediction model for calculation, so as to obtain a target risk level corresponding to the food to be detected.
Specifically, the atlas data to be detected is input into a food risk prediction model, so that a risk value corresponding to the food to be detected is output through the food risk prediction model, and a corresponding target risk grade is obtained according to the risk value, and can be divided into four grades of no risk, low risk, medium risk and high risk. And the target risk grade calculated by the food risk prediction model is convenient for carrying out corresponding item spot inspection on the food to be detected with high risk in the follow-up process. When the risk level is predicted, all other types and item information are fused, graph data and various risk factors are integrated comprehensively, a deep learning neural network is fused, and the food risk can be well predicted.
EXAMPLE III
Fig. 3 is a schematic diagram of a hardware architecture of a computer device according to a third embodiment of the present invention. In the present embodiment, the computer device 2 is a device capable of automatically performing numerical calculation and/or information processing in accordance with a preset or stored instruction. The computer device 2 may be a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers), and the like. As shown in fig. 3, the computer device 2 includes, but is not limited to, at least a memory 21, a processor 22, a network interface 23, and a food safety risk assessment system 20, which are communicatively connected to each other via a system bus. Wherein:
in this embodiment, the memory 21 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 21 may be an internal storage unit of the computer device 2, such as a hard disk or a memory of the computer device 2. In other embodiments, the memory 21 may also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the computer device 2. Of course, the memory 21 may also comprise both internal and external memory units of the computer device 2. In this embodiment, the memory 21 is generally used for storing an operating system installed on the computer device 2 and various application software, such as the program code of the food safety risk assessment system 20 of the second embodiment. Further, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 22 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 22 is typically used to control the overall operation of the computer device 2. In this embodiment, the processor 22 is configured to execute the program code stored in the memory 21 or process data, for example, execute the food safety risk assessment system 20, so as to implement the food safety risk assessment method according to the first embodiment.
The network interface 23 may comprise a wireless network interface or a wired network interface, and the network interface 23 is generally used for establishing communication connection between the server 2 and other electronic devices. For example, the network interface 23 is used to connect the server 2 to an external terminal via a network, establish a data transmission channel and a communication connection between the server 2 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), Wi-Fi, and the like. It is noted that fig. 3 only shows the computer device 2 with components 20-23, but it is to be understood that not all shown components are required to be implemented, and that more or less components may be implemented instead.
In this embodiment, the food safety risk assessment system 20 stored in the memory 21 can be further divided into one or more program modules, and the one or more program modules are stored in the memory 21 and executed by one or more processors (in this embodiment, the processor 22) to complete the present invention.
For example, fig. 2 shows a schematic diagram of program modules of an embodiment implementing the food safety risk assessment system 20, in this embodiment, the food safety risk assessment system 20 may be divided into the acquisition module 200, the construction module 202, the training module 204, the receiving module 206, the extraction module 208, and the calculation module 210. The program modules referred to herein refer to a series of computer program instruction segments capable of performing specific functions, and are more suitable than programs for describing the execution process of the food safety risk assessment system 20 in the computer device 2. The specific functions of the program modules 200 and 210 have been described in detail in the second embodiment, and are not described herein again.
Example four
The present embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer-readable storage medium of this embodiment is used for a computer program, and when executed by a processor, the method for assessing food safety risk of the first embodiment is implemented.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for assessing food safety risk, comprising:
obtaining sample food spot inspection data;
constructing a food spot inspection knowledge map according to the sample food spot inspection data;
training a deep learning network (GCN) model based on the food sampling inspection knowledge graph and the sample food sampling inspection data to obtain a food risk prediction model;
receiving the information of the types of the food to be detected and the information of the items to be spot-checked;
drawing the food spot inspection knowledge graph based on the category information and the item information to be spot inspected to obtain data of the graph to be inspected;
and inputting the atlas data to be detected into the food risk prediction model for calculation to obtain the target risk grade corresponding to the food to be detected.
2. The food safety risk assessment method according to claim 1, wherein said constructing a food spot check knowledge graph from said sample food spot check data comprises:
acquiring entity words in the sample food spot check data through an entity concept relationship, wherein the entity words comprise spot check item names and spot check item names;
constructing a framework of the food spot check knowledge map according to the entity conceptual relationship between the spot check item class name and the entity words of the spot check project name;
and calculating the correlation coefficient among the entity words so as to correct the frame of the sample food sampling inspection knowledge graph according to the correlation coefficient to obtain the food sampling inspection knowledge graph.
3. The method according to claim 2, wherein the calculating the correlation coefficient between the entity words to modify the framework of the sample food spot inspection knowledge graph according to the correlation coefficient to obtain the food spot inspection knowledge graph comprises:
calculating a correlation coefficient between the entity words;
and filling the correlation coefficient into a frame of the food spot inspection knowledge graph, and connecting and correcting the associated entity words to obtain the food spot inspection knowledge graph.
4. The food safety risk assessment method according to claim 1, wherein the training of a deep learning network (GCN) model based on the food spot inspection knowledge-graph and the sample food spot inspection data to obtain a food risk prediction model comprises:
inputting the food sampling inspection map into the deep learning network GCN model, wherein entity words in the food sampling inspection map correspond to the number of nodes in the deep learning network GCN model one by one;
and taking the risk grade as the output of the deep learning network GCN model, training the deep learning network GCN model, and obtaining a food risk prediction model, wherein the risk grade comprises no risk, low risk, medium risk and high risk.
5. The food safety risk assessment method according to claim 1, wherein the performing of map extraction on the food spot inspection intellectual map based on the category information and the item information to be spot inspected comprises:
inputting the type information of the food to be detected and the item information to be subjected to spot inspection into the food spot inspection knowledge map so as to find the association relation between the type information and the item information to be subjected to spot inspection in the food spot inspection knowledge map;
and extracting the association relation corresponding to the category information and the item information to be subjected to spot inspection, and reconstructing to obtain the atlas data to be detected.
6. The food safety risk assessment method according to claim 1, wherein the method further comprises:
storing the target risk level into a blockchain.
7. A food safety risk assessment system, comprising:
the acquisition module is used for acquiring sample food spot inspection data;
the construction module is used for constructing a food sampling inspection knowledge map according to the sample food sampling inspection data;
the training module is used for training a deep learning network (GCN) model based on the food sampling inspection knowledge graph and the sample food sampling inspection data to obtain a food risk prediction model;
the receiving module is used for receiving the type information of the food to be detected and the item information to be checked;
the extraction module is used for carrying out drawing extraction on the food spot inspection knowledge graph based on the class information and the item information to be spot inspected to obtain data of the graph to be inspected;
and the calculation module is used for inputting the atlas data to be detected into the food risk prediction model for calculation to obtain the target risk grade corresponding to the food to be detected.
8. The food safety risk assessment system of claim 7, wherein the build module is further to:
acquiring entity words in the sample food spot check data through an entity concept relationship, wherein the entity words comprise spot check item names and spot check item names;
constructing a framework of the food spot check knowledge map according to the entity conceptual relationship between the spot check item class name and the entity words of the spot check project name;
and calculating the correlation coefficient among the entity words so as to correct the frame of the sample food sampling inspection knowledge graph according to the correlation coefficient to obtain the food sampling inspection knowledge graph.
9. A computer device, characterized in that the computer device comprises a memory, a processor, the memory having stored thereon a computer program being executable on the processor, the computer program, when executed by the processor, implementing the steps of the food safety risk assessment method according to any of claims 1-6.
10. A computer-readable storage medium, having stored therein a computer program, the computer program being executable by at least one processor to cause the at least one processor to perform the steps of the food safety risk assessment method according to any one of claims 1-6.
CN202011558703.8A 2020-12-25 2020-12-25 Food safety risk assessment method, system, computer equipment and storage medium Pending CN112508456A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011558703.8A CN112508456A (en) 2020-12-25 2020-12-25 Food safety risk assessment method, system, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011558703.8A CN112508456A (en) 2020-12-25 2020-12-25 Food safety risk assessment method, system, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112508456A true CN112508456A (en) 2021-03-16

Family

ID=74923428

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011558703.8A Pending CN112508456A (en) 2020-12-25 2020-12-25 Food safety risk assessment method, system, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112508456A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113705786A (en) * 2021-08-26 2021-11-26 阿里巴巴(中国)有限公司 Model-based data processing method and device and storage medium
CN115964504A (en) * 2021-12-28 2023-04-14 北方工业大学 Food safety risk prediction method and system
CN117191126A (en) * 2023-09-08 2023-12-08 扬州日新通运物流装备有限公司 Container self-checking system, method, device and storage medium
JP7482199B1 (en) 2022-12-19 2024-05-13 株式会社 ゼンショーホールディングス Food risk assessment device, food risk assessment method, food risk assessment program

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170277855A1 (en) * 2016-03-24 2017-09-28 Fujitsu Limited System and a method for assessing patient risk using open data and clinician input
CN108830507A (en) * 2018-06-29 2018-11-16 成都数之联科技有限公司 A kind of food safety risk method for early warning
CN109669994A (en) * 2018-12-21 2019-04-23 吉林大学 A kind of construction method and system of health knowledge map
CN109740785A (en) * 2018-10-22 2019-05-10 北京师范大学 The method of node state prediction based on figure convolutional neural networks
CN110070364A (en) * 2019-03-27 2019-07-30 北京三快在线科技有限公司 Method and apparatus, storage medium based on the fraud of graph model detection clique
CN110781315A (en) * 2019-10-16 2020-02-11 华中农业大学 Food safety knowledge map and construction method of related intelligent question-answering system
CN111292195A (en) * 2020-02-28 2020-06-16 中国工商银行股份有限公司 Risk account identification method and device
CN111476662A (en) * 2020-04-13 2020-07-31 中国工商银行股份有限公司 Anti-money laundering identification method and device
CN111639193A (en) * 2020-05-27 2020-09-08 上海明略人工智能(集团)有限公司 Product risk assessment method and device, electronic equipment and storage medium
CN111832922A (en) * 2020-06-30 2020-10-27 北方工业大学 Food safety event risk studying and judging method and device based on knowledge graph reasoning
CN111915090A (en) * 2020-08-10 2020-11-10 哈尔滨安天科技集团股份有限公司 Prediction method and device based on knowledge graph, electronic equipment and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170277855A1 (en) * 2016-03-24 2017-09-28 Fujitsu Limited System and a method for assessing patient risk using open data and clinician input
CN108830507A (en) * 2018-06-29 2018-11-16 成都数之联科技有限公司 A kind of food safety risk method for early warning
CN109740785A (en) * 2018-10-22 2019-05-10 北京师范大学 The method of node state prediction based on figure convolutional neural networks
CN109669994A (en) * 2018-12-21 2019-04-23 吉林大学 A kind of construction method and system of health knowledge map
CN110070364A (en) * 2019-03-27 2019-07-30 北京三快在线科技有限公司 Method and apparatus, storage medium based on the fraud of graph model detection clique
CN110781315A (en) * 2019-10-16 2020-02-11 华中农业大学 Food safety knowledge map and construction method of related intelligent question-answering system
CN111292195A (en) * 2020-02-28 2020-06-16 中国工商银行股份有限公司 Risk account identification method and device
CN111476662A (en) * 2020-04-13 2020-07-31 中国工商银行股份有限公司 Anti-money laundering identification method and device
CN111639193A (en) * 2020-05-27 2020-09-08 上海明略人工智能(集团)有限公司 Product risk assessment method and device, electronic equipment and storage medium
CN111832922A (en) * 2020-06-30 2020-10-27 北方工业大学 Food safety event risk studying and judging method and device based on knowledge graph reasoning
CN111915090A (en) * 2020-08-10 2020-11-10 哈尔滨安天科技集团股份有限公司 Prediction method and device based on knowledge graph, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王红;林海舟;卢林燕;: "基于Att_GCN模型的知识图谱推理算法", 计算机工程与应用, no. 09 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113705786A (en) * 2021-08-26 2021-11-26 阿里巴巴(中国)有限公司 Model-based data processing method and device and storage medium
CN113705786B (en) * 2021-08-26 2024-06-04 阿里巴巴(中国)有限公司 Model-based data processing method, device and storage medium
CN115964504A (en) * 2021-12-28 2023-04-14 北方工业大学 Food safety risk prediction method and system
CN115964504B (en) * 2021-12-28 2023-06-30 北方工业大学 Food safety risk prediction method and system
JP7482199B1 (en) 2022-12-19 2024-05-13 株式会社 ゼンショーホールディングス Food risk assessment device, food risk assessment method, food risk assessment program
CN117191126A (en) * 2023-09-08 2023-12-08 扬州日新通运物流装备有限公司 Container self-checking system, method, device and storage medium
CN117191126B (en) * 2023-09-08 2024-06-04 扬州日新通运物流装备有限公司 Container self-checking system, method, device and storage medium

Similar Documents

Publication Publication Date Title
CN110516910B (en) Insurance policy and insurance model training method and insurance risk assessment method based on big data
CN112508456A (en) Food safety risk assessment method, system, computer equipment and storage medium
CN108170909B (en) Intelligent modeling model output method, equipment and storage medium
CN108182515B (en) Intelligent rule engine rule output method, equipment and computer readable storage medium
CN109961165B (en) Method, device, equipment and storage medium for predicting part quantity
US20040002929A1 (en) System and method for mining model accuracy display
CN112966583A (en) Image processing method, image processing device, computer equipment and storage medium
Yvette Zhang A density‐ratio model of crop yield distributions
CN112861980B (en) Calendar task table mining method based on big data and computer equipment
CN113868498A (en) Data storage method, electronic device, device and readable storage medium
CN115423040A (en) User portrait identification method and AI system of interactive marketing platform
CN114565196B (en) Multi-event trend prejudging method, device, equipment and medium based on government affair hotline
CN114328277A (en) Software defect prediction and quality analysis method, device, equipment and medium
CN113268665A (en) Information recommendation method, device and equipment based on random forest and storage medium
CN112328869A (en) User loan willingness prediction method and device and computer system
CN113129064A (en) Automobile part price prediction method, system, equipment and readable storage medium
CN117271522A (en) Logistics data processing method and system
CN111324594A (en) Data fusion method, device, equipment and storage medium for grain processing industry
CN112529319A (en) Grading method and device based on multi-dimensional features, computer equipment and storage medium
CN114897607A (en) Data processing method and device for product resources, electronic equipment and storage medium
CN114372867A (en) User credit verification and evaluation method and device and computer equipment
CN113379212A (en) Block chain-based logistics information platform default risk assessment method, device, equipment and medium
CN113052604A (en) Object detection method, device, equipment and storage medium
CN111027296A (en) Report generation method and system based on knowledge base
CN111737319A (en) User cluster prediction method and device, computer equipment and storage medium

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