Food biological contamination source identification model training method, identification method and device
By constructing a circulation network graph model and using graph convolutional neural networks to simulate food risk transmission, the problem of low efficiency in identifying food safety pollution sources in existing technologies has been solved, achieving efficient and accurate pollution source identification.
Patent Information
- Application Number
- CN202411868728.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-12-18
AI Technical Summary
Existing technologies using effective distance-based methods for identifying food safety pollution sources have low reliability, while methods based on Petri nets and Bayes inference are computationally difficult, resulting in low efficiency in identifying food safety pollution sources.
A graph model of the circulation network based on the regional and transaction information of the target agricultural products is constructed. Iterative training is performed using a graph convolutional neural network. The model is combined with the SI infectious disease model, the independent cascade model, the SIR model, and the linear threshold model to simulate the spread of food risks. The parameters of the graph convolutional neural network are optimized to improve the recognition accuracy.
It has improved the efficiency and accuracy of food safety pollution source identification, and achieved efficient identification of biological pollution sources in food.
Smart Images

Figure CN119941268B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of food safety detection, and in particular to a food biological contamination source identification model training method, an identification method and a device. Background Art
[0002] When a food safety incident occurs, if the source of contamination can be accurately identified, the transmission chain can be quickly blocked, the losses caused by the incident can be minimized, and the scope of risk spread can be estimated, which is of great significance to food safety supervision.
[0003] In related technologies, effective distance-based methods are usually used to convert the geographical distance between nodes into effective distance. However, the strong assumption that the pollution source has centrality characteristics is identified by evaluating the centrality of each node one by one, which affects the reliability of the identification results. The pollution source identification method based on Petri nets uses the data structure of Petri nets to accurately record the flow batches of each link in the agricultural product supply chain. When the flow batches are large, the efficiency of accurately recording the supply chain flow batch information one by one is low. In addition, the source identification method based on Bayesian inference is achieved by calculating the maximum posterior probability. As the number of pollution sources and the amount of observation data increase, the amount of calculation will increase exponentially, the calculation difficulty increases, and at the same time, the efficiency of food pollution source identification is low. Summary of the Invention
[0004] The present invention provides a food biological contamination source identification model training method, identification method and device, which are used to solve the problems of low reliability of the existing method of identifying food safety contamination sources based on effective distance sampling, and the difficulty of data observation and calculation when using pollution source identification methods based on Petri nets and Bayesian inference, resulting in low efficiency in food safety contamination source identification, thereby improving the efficiency and accuracy of food safety contamination source identification.
[0005] The present invention provides a method for training a food biological contamination source identification model, comprising:
[0006] Constructing a circulation network graph model based on the regional information and transaction information of the target agricultural product, wherein the circulation network graph model includes a plurality of graph nodes, wherein different graph nodes correspond to different regions, and edges between different graph nodes correspond to food circulation information between different regions; the weight of the edges is determined based on at least one of the number of food transactions, transaction amount, geographical distance, and population between the corresponding two regions;
[0007] Initializing the circulation network graph model, and performing multiple food risk propagation simulations based on the initialized circulation network graph model to obtain a training data set; wherein each set of sample data in the training data set includes a target graph node and propagation result snapshot data; the target graph node is at least one of the different graph nodes;
[0008] For each set of training data in the training data set, the graph convolutional neural network is iteratively trained with the propagation result snapshot data as input and the graph nodes corresponding to the propagation result snapshot data as output, and when the graph convolutional neural network converges, a food biological contamination source identification model is obtained.
[0009] According to a food biological contamination source identification model training method provided by the present invention, the graph convolutional neural network includes a stack of graph convolutional layers and fully connected layers; wherein, the graph convolutional layer calculates neighbor node information from the propagation result snapshot data by using first-order Chebyshev polynomials, and the graph convolutional layer uses L2 regularization and dropout to optimize network parameters, and uses a ReLU activation function; the fully connected layer is used to convert the matrix output by the graph convolutional layer into a vector; the loss function of the graph convolutional neural network is determined based on the sigmoid activation function and the cross-entropy loss.
[0010] According to a method for training a food biological contamination source identification model provided by the present invention, the training data set obtained by performing multiple food risk propagation simulations based on the initialized circulation network graph model includes:
[0011] Based on the target propagation diffusion model, the food risk propagation path information is simulated according to the initialized circulation network graph model to obtain a food risk propagation chain; the food risk propagation chain includes target graph nodes and corresponding edges;
[0012] The target propagation diffusion model includes one of the SI infectious disease model, the independent cascade model, the SIR model and the linear threshold model.
[0013] According to a method for training a food biological contamination source identification model provided by the present invention, after obtaining the food biological contamination source identification model, the method further includes:
[0014] Processing the test sample based on the food biological contamination source identification model to obtain a test result;
[0015] Based on the test results, a target evaluation index is obtained, and the food biological contamination source identification model is fine-tuned and optimized according to the target evaluation index to obtain an optimized food biological contamination source identification model; the target evaluation index includes at least one of the F score, precision and recall rate.
[0016] The present invention also provides an identification method, comprising:
[0017] Obtaining information on pollution sources to be detected, wherein the information on pollution sources to be detected includes the occurrence area and type of food safety pollution sources;
[0018] The information of the pollution source to be detected is processed based on the food biological pollution source identification model to obtain a food safety pollution source identification result; wherein, the food biological pollution source identification model is trained based on the food biological pollution source identification model training method.
[0019] The present invention also provides a food biological contamination source identification model training device, comprising:
[0020] a graph model construction module for constructing a circulation network graph model based on the regional information and transaction information of the target agricultural product, wherein the circulation network graph model includes a plurality of graph nodes, wherein different graph nodes correspond to different regions, and edges between different graph nodes correspond to food circulation information between different regions; the weight of the edges is determined based on at least one of the number of food transactions, transaction amount, geographical distance, and population between the corresponding two regions;
[0021] a sample acquisition module, configured to initialize the circulation network graph model and perform multiple food risk propagation simulations based on the initialized circulation network graph model to obtain a training data set; wherein each set of sample data in the training data set includes a target graph node and propagation result snapshot data; the target graph node is at least one of the different graph nodes;
[0022] The training module is used to iteratively train the graph convolutional neural network for each set of training data in the training data set, using the propagation result snapshot data as input and the graph nodes corresponding to the propagation result snapshot data as output, and obtain a food biological contamination source identification model when the graph convolutional neural network converges.
[0023] The present invention also provides an identification device, comprising:
[0024] A data acquisition module is used to obtain information on pollution sources to be detected, wherein the information on pollution sources to be detected includes the occurrence area and type of food safety pollution sources;
[0025] The identification module is used to process the information of the pollution source to be detected based on the food biological pollution source identification model to obtain a food safety pollution source identification result; wherein, the food biological pollution source identification model is trained based on the food biological pollution source identification model training method.
[0026] The present invention also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for training a model or identifying a source of biological contamination in food as described above is implemented.
[0027] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the training method or identification method for a food biological contamination source identification model as described above is implemented.
[0028] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-mentioned food biological contamination source identification model training methods or identification methods.
[0029] The food biological contamination source identification model training method, identification method and device provided by the present invention construct a circulation network graph model through the geographical information and transaction information of the target agricultural product, then perform multiple food risk propagation simulations based on the initialized circulation network graph model to obtain a training data set, and finally iteratively train the graph convolutional neural network with the propagation result snapshot data as input and the graph nodes corresponding to the propagation result snapshot data as output to obtain a food biological contamination source identification model, thereby improving the efficiency and accuracy of food safety contamination source identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0031] Figure 1 It is a flow chart of the food biological contamination source identification model training method provided by the present invention.
[0032] Figure 2 This is one of the flow charts of the identification method provided by the present invention.
[0033] Figure 3 This is the second flow chart of the identification method provided by the present invention.
[0034] Figure 4 It is a structural schematic diagram of the food biological contamination source identification model training device provided by the present invention.
[0035] Figure 5 It is a structural schematic diagram of the identification device provided by the present invention.
[0036] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0037] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0038] The following combination Figure 1-Figure 5 The present invention describes the food biological contamination source identification model training method, identification method and device.
[0039] Figure 1 FIG. 1 is a flow chart of the method for training a food biological contamination source identification model provided by the present invention, as shown in FIG. Figure 1 As shown, the food biological contamination source identification model training method includes the following steps:
[0040] Step 110: Construct a circulation network graph model based on the regional information and transaction information of the target agricultural product. The circulation network graph model includes multiple graph nodes, different graph nodes correspond to different regions, and edges between different graph nodes correspond to food circulation information between different regions; the weight of the edge is determined based on at least one of the food transaction quantity, transaction amount, geographical distance and population size between the two corresponding regions.
[0041] In this step, the target agricultural products include but are not limited to one or more of grain and oil crops, vegetables, fruits, livestock products and aquatic products.
[0042] Different regional divisions of target agricultural products include different administrative regions in the same country or region, or regional divisions according to different countries or regions around the world.
[0043] In this step, the division of graph nodes can be determined based on the identification accuracy requirements and data acquisition capabilities of food contamination sources; for example, graph nodes can be economically developed areas in the current region, such as the administrative center of a province or an area with a large agricultural product trade volume.
[0044] In this step, the transaction information may be the transaction quantity or transaction amount of agricultural products in the corresponding areas of the two nodes.
[0045] For example, in the circulation network graph model, each graph node is a provincial capital city, and the edges between the graph nodes indicate that there is a food transaction relationship between the corresponding provincial capital cities. The weight of the edge includes the number of food transactions or the transaction amount.
[0046] In this embodiment, the weights between the graph nodes are based on the number of transactions, average transaction amounts, geographic distance, and population correlation between the two points in the regions corresponding to the two graph nodes over a period of time.
[0047] Specifically, there are two types of factors that affect the weight of the edge: social factors f and trade factors t ; From the graph node m To graph node n The edges between are directed edges. The weights of directed edges are calculated as follows:
[0048] Step 1: Calculate the absolute value of the impact of social factors according to the following formula:
[0049] ;
[0050] in, express m population, express m and n The distance between is the average distance; 0.5.
[0051] Step 2: Convert the absolute value of social factors’ impact into a value between 0 and 1 using the following formula:
[0052] .
[0053] Step 3: Absolute value of trade factors , which represents the total trade volume of this type of agricultural products from node m to node n over a period of time.
[0054] Step 4: Convert the absolute value of the trade factor to a value between 0 and 1 using the following formula:
[0055] .
[0056] Step 5: Merge by the following formula and :
[0057] 1 + 2 ;
[0058] in, for m and n The edges between are directed edges. 1 and 2 is the weight coefficient, which is less than 1 and can be set according to user needs.
[0059] In this embodiment, each node of the circulation network graph model can also be a sub-region at each level of the same region. For example, there are M provinces in country A, and there are multiple cities in different provinces, and each city corresponds to a graph node. It should be noted that there can be an edge and its edge value between any two nodes (indicating that there are agricultural product transactions between the two nodes within a certain time range), or there can be no edge (there is no agricultural product transaction between the two nodes within a certain time range).
[0060] Step 120: Initialize the circulation network graph model, and perform multiple food risk propagation simulations based on the initialized circulation network graph model to obtain a training data set; wherein each set of sample data in the training data set includes a target graph node and propagation result snapshot data; the target graph node is at least one of the different graph nodes.
[0061] In this step, during the food risk transmission process, food contamination can be caused by biological contamination, such as microbial contamination such as bacteria, viruses and parasites.
[0062] In this step, food safety risk propagation simulation can be performed through a target propagation diffusion model, wherein the target propagation diffusion model includes but is not limited to an SI infectious disease model, an independent cascade model, an SIR model, and a linear threshold model.
[0063] In this embodiment, the circulation network graph model is initialized through the following steps:
[0064] (1) Create an empty directed graph using graphing software;
[0065] (2) By looping, a specified number of nodes are added to the directed graph, and some edges are added to the target graph nodes according to the accuracy requirements of pollution source identification and data acquisition capabilities; each graph node can also be connected to its k randomly selected neighbor nodes.
[0066] (3) Initialize the infection status of each node to -1 (uninfected) and set the infection status of the target graph node to 1 (infected).
[0067] In this embodiment, multiple food risk transmission simulations are performed according to the initialized circulation network graph model to obtain a training data set including: simulating the food risk transmission path information according to the initialized circulation network graph model based on the target propagation diffusion model to obtain a food risk transmission chain; the food risk transmission chain includes target graph nodes and corresponding edges; wherein the target propagation diffusion model includes one of the SI infectious disease model, independent cascade model, SIR model and linear threshold model.
[0068] In this embodiment, after the circulation network graph model is initialized, the target propagation diffusion model is used to propagate the risk of the infected nodes in the circulation network graph model to the susceptible nodes connected thereto with a certain probability.
[0069] Specifically, a propagation probability β is set to represent the probability that an infected node will spread the risk to an adjacent susceptible node in each time step; a number of simulation time steps (or iterations) is set; in each time step, all infected nodes are traversed according to the directed edges between nodes from one node to another, and attempts are made to spread the risk to their adjacent susceptible nodes with a propagation probability β; if a susceptible node is successfully infected, its state is updated (the feature update of the graph node depends on the features of its neighboring nodes and the direction of the edges), and the node state after each time step is recorded to generate snapshot data of risk propagation; after the simulation is completed, the risk propagation results of the specific source node are output, including the final state of each node (uninfected or infected); repeat the above three steps several times to obtain several sets of training data, which can constitute the training data set of the pollution source identification model.
[0070] Step 130: For each set of training data in the training data set, the graph convolutional neural network is iteratively trained with the propagation result snapshot data as input and the graph nodes corresponding to the propagation result snapshot data as output, and when the graph convolutional neural network converges, a food biological contamination source identification model is obtained.
[0071] In this step, the graph convolutional neural network consists of a stack of graph convolutional layers and fully connected layers; the graph convolutional layer calculates neighbor node information from the propagation result snapshot data by using first-order Chebyshev polynomials, and the graph convolutional layer uses L2 regularization and dropout to optimize network parameters, and adopts ReLU activation function; the fully connected layer is used to convert the matrix output by the graph convolutional layer into a vector; the loss function of the graph convolutional neural network is determined based on the sigmoid activation function and cross-entropy loss.
[0072] In this embodiment, a graph convolutional neural network is trained through the following steps to obtain a food biological contamination source identification model:
[0073] (1) Perform preprocessing operations such as data cleaning, normalization, and data enhancement on each sample in the training data set to obtain the preprocessed training data set.
[0074] (2) The propagation result snapshot data extracted from the preprocessed training dataset. The snapshot data should contain features such as the node status (uninfected -1 or infected 1), node type, transaction volume, etc. after each time step.
[0075] (3) In each snapshot, the infected nodes are marked as contamination sources (positive samples) and the susceptible nodes are marked as non-contamination sources (negative samples), thereby determining the sample labels.
[0076] (4) In this embodiment, a graph theory library (such as NetworkX) can be used to construct a food circulation network diagram, where nodes represent food or circulation links, edges represent the connection relationship of food flow, and feature vectors are added to each node, such as features extracted from snapshot data.
[0077] (5) Divide the preprocessed training dataset into a training set and a test set, ensuring that each set contains a sufficient number of infected nodes and sufficient snapshot time steps; when dividing, temporal continuity can be considered to avoid data leakage between the training set and the test set.
[0078] (6) Select a suitable GCN architecture (such as GCN based on spectral graph convolution or GCN based on spatial graph convolution), set the input layer and hidden layer of GCN according to the number and type of input features, and set a binary classifier (such as sigmoid function) for each node in the output layer to predict whether the node is a pollution source.
[0079] (7) The snapshot data and labels of the training set are used to train the GCN model. In each training iteration, the prediction results are calculated through forward propagation, and the model parameters are updated through back propagation. The cross entropy loss function is used to evaluate the difference between the prediction results and the true labels, and optimization (such as Adam) is used to minimize the loss. Finally, after reaching the maximum number of training times, a food biological contamination source identification model is obtained.
[0080] The food biological contamination source identification model training method of the embodiment of the present invention constructs a circulation network graph model through the geographical information and transaction information of the target agricultural product, and then performs multiple food risk propagation simulations based on the initialized circulation network graph model to obtain a training data set. Finally, the graph convolutional neural network is iteratively trained with the propagation result snapshot data as input and the graph nodes corresponding to the propagation result snapshot data as output to obtain a food biological contamination source identification model, thereby improving the efficiency and accuracy of food safety contamination source identification.
[0081] In some embodiments, after obtaining the food biological contamination source identification model, the food biological contamination source identification model training method also includes: processing the test sample based on the food biological contamination source identification model to obtain test results; obtaining target evaluation indicators based on the test results, and fine-tuning and optimizing the food biological contamination source identification model according to the target evaluation indicators to obtain an optimized food biological contamination source identification model; the target evaluation indicators include at least one of F score, precision and recall rate.
[0082] In this embodiment, the performance of the food biological contamination source identification model is evaluated on a test set, and indicators such as accuracy, recall, and F1 score are used to evaluate the model's ability to identify contamination sources.
[0083] In this embodiment, the above circulation network graph model is updated with representative food samples collected from the actual environment to obtain test samples, the test samples are pretreated such as extraction, purification and concentration for subsequent pollution source detection, and then the pretreated test samples are input into the established food biological pollution source identification model for pollution source detection to obtain test results; according to the test results, the F score (used to comprehensively measure the performance of the model) of the model in identifying the pollution source is calculated using the following formula:
[0084] F score = 2 × (precision × recall) / (precision + recall).
[0085] In this embodiment, the food biological pollution source identification model is comprehensively evaluated according to the evaluation indexes such as F score, precision and recall; if the evaluation result is not ideal, the model needs to be fine-tuned and optimized, for example, adjusting the model structure (including increasing or decreasing the number of layers of the model, changing the number of neurons or the connection mode, etc.), optimizing the parameter settings (including adjusting the values of hyperparameters such as learning rate and regularization coefficient to improve the performance of the model) or increasing the training data; finally, the model is retrained using the adjusted model structure and optimized parameter settings to obtain the optimized food biological pollution source identification model.
[0086] The food biological pollution source identification model training method of the embodiment of the application processes the test samples through the food biological pollution source identification model to obtain test results, obtains target evaluation indexes based on the test results, fine-tunes and optimizes the food biological pollution source identification model according to the target evaluation indexes, and obtains the optimized food biological pollution source identification model, thereby improving the robustness and generalization ability of the food biological pollution source identification model.
[0087] The identification method provided by the application will be described below. The identification method described below can be correspondingly referred to the food biological pollution source identification model training method described above.
[0088] Figure 2 is one of the flowcharts of the identification method provided by the application, as shown in Figure 2 The identification method comprises the following steps:
[0089] Step 210, obtaining information of a pollution source to be detected, the information of the pollution source to be detected including an occurrence area and a type of a food safety pollution source;
[0090] In this step, the information of the pollution source to be detected includes the occurrence status of any given food safety event within a certain range, that is, which nodes in the latest circulation network graph model are in an infected state, and these nodes can be used as the information of the pollution source to be detected.
[0091] Step 220: Process the information of the pollution source to be detected based on the food biological pollution source identification model to obtain a food safety pollution source identification result; wherein the food biological pollution source identification model is trained based on the food biological pollution source identification model training method.
[0092] In this step, the food biological contamination source identification model is trained through the following steps:
[0093] (1) A circulation network graph model is constructed based on the regional information and transaction information of the target agricultural products. The circulation network graph model includes multiple graph nodes. Different graph nodes correspond to different regions. The edges between different graph nodes correspond to the food circulation information between different regions. Different values of the edges correspond to the number of food transactions between different regions.
[0094] (2) Initialize the circulation network graph model, and perform multiple food risk propagation simulations based on the initialized circulation network graph model to obtain a training data set; wherein each set of sample data in the training data set includes a target graph node and propagation result snapshot data; the target graph node is at least one of the different graph nodes.
[0095] (3) For each set of training data in the training data set, the graph convolutional neural network is iteratively trained with the propagation result snapshot data as input and the graph nodes corresponding to the propagation result snapshot data as output. When the graph convolutional neural network converges, a food biological contamination source identification model is obtained.
[0096] In this embodiment, the specific implementation of each of the above steps is as described in the above embodiments corresponding to steps 110 to 130, and will not be repeated in this embodiment.
[0097] In this embodiment, the occurrence status of food safety incidents within a certain range is input into the graph nodes corresponding to the circulation network graph model into the trained food biological contamination source identification model, and the contamination source node (including the real geographical location of the area corresponding to the graph node, such as longitude and latitude and administrative division identification, etc.) is output. The calculation result of this contamination source node is then used to guide the food safety supervision department to conduct on-site verification and prevention and control.
[0098] The identification method provided in an embodiment of the present invention processes the information of the pollution source to be detected through a food biological pollution source identification model to obtain a food safety pollution source identification result. It utilizes the feature learning ability of the graph neural network for graph structure data and combines the characteristics of the food circulation network to realize the identification of the source of food safety pollution.
[0099] Figure 3 This is the second flow chart of the identification method provided by the present invention. Figure 3In the illustrated embodiment, an identification method is implemented by the following steps: constructing a food circulation network graph model; constructing a training data set; constructing a pollution source identification model; and identifying the pollution source.
[0100] The food biological contamination source identification model training device provided by the present invention is described below. The food biological contamination source identification model training device described below and the food biological contamination source identification model training method described above can be referenced to each other.
[0101] Figure 4 This is a schematic diagram of the structure of the food biological contamination source identification model training device provided by the present invention. Figure 4 As shown, the food biological contamination source identification model training device includes: a graph model construction module 410, a sample acquisition module 420 and a training module 430.
[0102] A graph model construction module 410 is configured to construct a circulation network graph model based on the regional information and transaction information of the target agricultural product. The circulation network graph model includes a plurality of graph nodes, where different graph nodes correspond to different regions, and edges between different graph nodes correspond to food circulation information between different regions. The weight of the edges is determined based on at least one of the number of food transactions, transaction amount, geographical distance, and population between the corresponding two regions.
[0103] Sample acquisition module 420 is used to initialize the circulation network graph model and perform multiple food risk propagation simulations based on the initialized circulation network graph model to obtain a training dataset; wherein each set of sample data in the training dataset includes a target graph node and propagation result snapshot data; the target graph node is at least one of different graph nodes;
[0104] The training module 430 is used to iteratively train the graph convolutional neural network for each set of training data in the training data set, using the propagation result snapshot data as input and the graph nodes corresponding to the propagation result snapshot data as output, and obtain a food biological contamination source identification model when the graph convolutional neural network converges.
[0105] The food biological contamination source identification model training device of the embodiment of the present invention constructs a circulation network graph model through the geographical information and transaction information of the target agricultural product, and then performs multiple food risk propagation simulations based on the initialized circulation network graph model to obtain a training data set. Finally, the graph convolutional neural network is iteratively trained with the propagation result snapshot data as input and the graph nodes corresponding to the propagation result snapshot data as output to obtain a food biological contamination source identification model, thereby improving the efficiency and accuracy of food safety contamination source identification.
[0106] The identification device provided by the present invention is described below. The identification device described below and the identification method described above can be referenced to each other.
[0107] Figure 5 is a structural schematic diagram of the identification device provided by the present application, as Figure 5 shown, the identification device comprises: a data acquisition module 510 and an identification module 520.
[0108] The data acquisition module 510 is configured to acquire to-be-detected pollution source information, and the to-be-detected pollution source information comprises an occurrence area and a type of a food safety pollution source.
[0109] The identification module 520 is configured to process the to-be-detected pollution source information based on a food biological pollution source identification model to obtain a food safety pollution source identification result, wherein the food biological pollution source identification model is obtained based on a food biological pollution source identification model training method.
[0110] The identification device provided by the embodiment of the present application processes the to-be-detected pollution source information based on the food biological pollution source identification model to obtain the food safety pollution source identification result, utilizes the feature learning capability of the graph neural network for the graph structure data, and combines the food circulation network features to realize the identification of the food safety pollution source.
[0111] Figure 6 is a structural schematic diagram of the electronic device provided by the present application, as Figure 6 shown, the electronic device can comprise a processor 610, a communications interface 620, a memory 630 and a communications bus 640, wherein the processor 610, the communications interface 620 and the memory 630 complete mutual communication through the communications bus 640. The processor 610 can invoke a logical instruction in the memory 630 to execute a food biological pollution source identification model training method, and the method comprises the following steps: constructing a circulation network graph model based on regional information and transaction information of a target agricultural product, the circulation network graph model comprises a plurality of graph nodes, different graph nodes correspond to different regions, and edges between different graph nodes correspond to food circulation information between different regions; the weight of the edge is determined based on at least one of the food transaction quantity, the transaction amount, the geographic distance and the population number between the two corresponding regions; initializing the circulation network graph model, and performing multiple food risk propagation simulations according to the initialized circulation network graph model to obtain a training data set; wherein each set of sample data in the training data set comprises a target graph node and propagation result snapshot data; the target graph node is at least one of different graph nodes; for each set of training data in the training data set, the graph convolutional neural network is iteratively trained with the propagation result snapshot data as the input and the graph node corresponding to the propagation result snapshot data as the output, and the food biological pollution source identification model is obtained in the case where the graph convolutional neural network converges.
[0112] Or execute the identification method, the method comprises: obtaining the information of the pollution source to be detected, the information of the pollution source to be detected includes the occurrence area and type of the food safety pollution source; the food biological pollution source identification model is obtained by processing the information of the pollution source to be detected based on the food biological pollution source identification model; wherein the food biological pollution source identification model is trained based on the food biological pollution source identification model training method.
[0113] In addition, the logical instructions in the memory 630 described above can be realized in the form of a software function unit and sold or used as an independent product, which can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the part of the prior art or the part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present application. The foregoing storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and various program code storage media.
[0114] On the other hand, the present application also provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer readable storage medium, when the computer program is executed by a processor, the computer can execute the food biological pollution source identification model training method provided by the above-mentioned method, the method comprises: based on the regional information and transaction information of the target agricultural product, a circulation network graph model is constructed, the circulation network graph model includes a plurality of graph nodes, different graph nodes correspond to different regions, and the edges between different graph nodes correspond to the food circulation information between different regions; the weight of the edge is determined based on at least one of the food transaction quantity, transaction amount, geographical distance and population number between the corresponding two regions; the circulation network graph model is initialized, and the circulation network graph model after initialization is used for multiple food risk propagation simulation, to obtain a training data set; wherein each set of sample data in the training data set includes a target graph node and propagation result snapshot data; the target graph node is at least one of different graph nodes; for each set of training data in the training data set, the propagation result snapshot data is input, the graph node corresponding to the propagation result snapshot data is output, and the graph convolutional neural network is iteratively trained, and in the case of convergence of the graph convolutional neural network, the food biological pollution source identification model is obtained.
[0115] Or execute an identification method, which includes: obtaining information on the pollution source to be detected, the information on the pollution source to be detected includes the occurrence area and type of the food safety pollution source; processing the information on the pollution source to be detected based on a food biological pollution source identification model to obtain a food safety pollution source identification result; wherein the food biological pollution source identification model is trained based on a food biological pollution source identification model training method.
[0116] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the food biological contamination source identification model training method provided by the above-mentioned methods, the method comprising: constructing a circulation network graph model based on the geographical information and transaction information of the target agricultural product, the circulation network graph model comprising a plurality of graph nodes, different graph nodes corresponding to different regions, and edges between different graph nodes corresponding to food circulation information between different regions; the weight of the edge is determined based on at least one of the number of food transactions, transaction amount, geographical distance and population between the two corresponding regions; initializing the circulation network graph model, and performing multiple food risk propagation simulations based on the initialized circulation network graph model to obtain a training data set; wherein each group of sample data in the training data set comprises a target graph node and propagation result snapshot data; the target graph node is at least one of different graph nodes; for each group of training data in the training data set, the graph convolutional neural network is iteratively trained with the propagation result snapshot data as input and the graph node corresponding to the propagation result snapshot data as output, and when the graph convolutional neural network converges, a food biological contamination source identification model is obtained.
[0117] Or execute an identification method, which includes: obtaining information on the pollution source to be detected, the information on the pollution source to be detected includes the occurrence area and type of the food safety pollution source; processing the information on the pollution source to be detected based on a food biological pollution source identification model to obtain a food safety pollution source identification result; wherein the food biological pollution source identification model is trained based on a food biological pollution source identification model training method.
[0118] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0119] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for training a food biological contamination source identification model, characterized in that: include: Constructing a circulation network graph model based on the regional information and transaction information of the target agricultural product, wherein the circulation network graph model includes a plurality of graph nodes, wherein different graph nodes correspond to different regions, and edges between different graph nodes correspond to food circulation information between different regions; the weight of the edges is determined based on at least one of the number of food transactions, transaction amount, geographical distance, and population between the corresponding two regions; Initializing the circulation network graph model, and performing multiple food risk propagation simulations based on the initialized circulation network graph model to obtain a training data set; wherein each set of sample data in the training data set includes a target graph node and propagation result snapshot data; the target graph node is at least one of the different graph nodes; For each set of training data in the training data set, the graph convolutional neural network is iteratively trained with the propagation result snapshot data as input and the graph nodes corresponding to the propagation result snapshot data as output, and when the graph convolutional neural network converges, a food biological contamination source identification model is obtained.
2. The method for training a food biological contamination source identification model according to claim 1, characterized in that: The graph convolutional neural network includes a stack of graph convolutional layers and fully connected layers; wherein, the graph convolutional layer calculates neighbor node information from the propagation result snapshot data by using first-order Chebyshev polynomials, and the graph convolutional layer uses L2 regularization and dropout to optimize network parameters, and uses a ReLU activation function; the fully connected layer is used to convert the matrix output by the graph convolutional layer into a vector; the loss function of the graph convolutional neural network is determined based on the sigmoid activation function and the cross-entropy loss.
3. The method for training a food biological contamination source identification model according to claim 1, wherein: The training data set obtained by performing multiple food risk transmission simulations based on the initialized circulation network graph model includes: Based on the target propagation diffusion model, the food risk propagation path information is simulated according to the initialized circulation network graph model to obtain a food risk propagation chain; the food risk propagation chain includes target graph nodes and corresponding edges; The target propagation diffusion model includes one of the SI infectious disease model, the independent cascade model, the SIR model and the linear threshold model.
4. The method for training a food biological contamination source identification model according to claim 1, wherein: After obtaining the food biological contamination source identification model, the method further includes: Processing the test sample based on the food biological contamination source identification model to obtain a test result; Based on the test results, a target evaluation index is obtained, and the food biological contamination source identification model is fine-tuned and optimized according to the target evaluation index to obtain an optimized food biological contamination source identification model; the target evaluation index includes at least one of the F score, precision and recall rate.
5. A recognition method, characterized in that: include: Obtaining information on pollution sources to be detected, wherein the information on pollution sources to be detected includes the occurrence area and type of food safety pollution sources; The information of the pollution source to be detected is processed based on the food biological pollution source identification model to obtain a food safety pollution source identification result; wherein, the food biological pollution source identification model is trained based on the food biological pollution source identification model training method as described in any one of claims 1-4.
6. A food biological contamination source identification model training device, characterized in that: include: a graph model construction module for constructing a circulation network graph model based on the regional information and transaction information of the target agricultural product, wherein the circulation network graph model includes a plurality of graph nodes, wherein different graph nodes correspond to different regions, and edges between different graph nodes correspond to food circulation information between different regions; the weight of the edges is determined based on at least one of the number of food transactions, transaction amount, geographical distance, and population between the corresponding two regions; a sample acquisition module, configured to initialize the circulation network graph model and perform multiple food risk propagation simulations based on the initialized circulation network graph model to obtain a training data set; wherein each set of sample data in the training data set includes a target graph node and propagation result snapshot data; the target graph node is at least one of the different graph nodes; The training module is used to iteratively train the graph convolutional neural network for each set of training data in the training data set, using the propagation result snapshot data as input and the graph nodes corresponding to the propagation result snapshot data as output, and obtain a food biological contamination source identification model when the graph convolutional neural network converges.
7. An identification device, characterized in that: include: A data acquisition module is used to obtain information on pollution sources to be detected, wherein the information on pollution sources to be detected includes the occurrence area and type of food safety pollution sources; An identification module is used to process the information of the pollution source to be detected based on a food biological contamination source identification model to obtain a food safety contamination source identification result; wherein, the food biological contamination source identification model is trained based on the food biological contamination source identification model training method as described in any one of claims 1 to 4.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
The high-risk area identification method and differential processing method for land agricultural product producing areas
AU2020100440A4
A pollution source abnormal data identification method based on a deep learning algorithm
CN109711547A