Express package safety scene assessment system based on knowledge graph and graph neural network

By building an express parcel security scenario assessment system based on knowledge graphs and graph neural networks, the problem of low efficiency in express parcel security assessment in existing technologies has been solved, accurate risk prediction and real-time security monitoring of massive data have been achieved, and the accuracy of risk prediction has been improved.

CN118052434BActive Publication Date: 2025-10-10SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410212580.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-27
Publication Date
2025-10-10
Estimated Expiration
2044-02-27

AI Technical Summary

Technical Problem

Existing technologies are inefficient in express parcel security scenario assessment and early warning, lack data mining and deep learning methods for massive heterogeneous security inspection big data, and lack real-time security scenario assessment and early warning systems.

Method used

An express parcel safety scenario assessment system based on knowledge graph and graph neural network is adopted. Through data import, preprocessing, initial screening of dangerous packages, package safety risk prediction training and prediction modules, an express parcel information knowledge graph is constructed and feature fusion is performed, and risk prediction is performed using ConvE model and heterogeneous graph attention network.

Benefits of technology

It achieves accurate risk prediction and real-time security monitoring of massive express parcel data, improves the accuracy of parcel risk prediction, and provides real-time decision support for security inspection departments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118052434B_ABST
    Figure CN118052434B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on knowledge graph and graph neural network's express package security scene evaluation system, comprising: data import module, for loading express package waybill data, express package security check data and the data in express package security scene evaluation database, and the preprocessing operation of express package waybill data and express package security check data;Dangerous package preliminary screening module, for preliminary screening to express package, and screening out possible risk express package;Package security risk prediction training module, for training the optimal express package security risk prediction model;Package security risk prediction module, for risk prediction to express package, and updating security scene evaluation database information.The application enhances the mining capacity of mass express package data, improves the accuracy of express package risk prediction, provides basis and support for security check department to carry out real-time security monitoring and decision-making on express package.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of express package safety inspection, and in particular to an express package safety scene evaluation system based on a knowledge graph and a graph neural network. BACKGROUND

[0002] With the large-scale development of the express industry, the safety scene evaluation and early warning of express packages are particularly important. Safety scene evaluation and early warning aim to discover safety hazards in a large number of express packages and perform real-time early warning. Traditional safety monitoring generally includes personal information verification, express delivery personnel acceptance, and routine X-ray security inspection machine inspection, and has problems such as low efficiency and limited human resources.

[0003] With the deepening of the concept of "Internet+", combining advanced technologies such as big data, artificial intelligence, and deep learning to develop a safety scene evaluation and monitoring system has become a mainstream trend. However, there is less research on safety scene evaluation and early warning methods for express logistics, mainly focusing on building an express management information system, building an express information database, and using data mining methods for risk monitoring, lacking the introduction of data mining and deep learning methods for massive heterogeneous security inspection big data, and lacking a real-time safety scene evaluation and early warning system that integrates data collection, processing, mining, and prediction. SUMMARY

[0004] The purpose of the present application is to overcome the shortcomings and deficiencies of the prior art, and to provide an express package safety scene evaluation system based on a knowledge graph and a graph neural network. The knowledge graph and the graph neural network are first introduced into the field of express package safety scene evaluation, massive heterogeneous express package big data is fully mined, a more accurate express package risk prediction model is established, and real-time express package safety scene evaluation and early warning are performed.

[0005] To achieve the above purpose, the technical scheme provided by the present application is as follows: an express package safety scene evaluation system based on a knowledge graph and a graph neural network, comprising:

[0006] A data import module is used to load express package waybill data, express package security inspection data, and data in an express package safety scene evaluation database, and to perform preprocessing operations on the express package waybill data and the express package security inspection data, including deleting outliers in the express package waybill data and the express package security inspection data and deleting redundant data in the express package waybill data;

[0007] The dangerous package screening module is used to perform preliminary screening of express parcels. Its input is the output of the data import module. It constructs three conditional branches consisting of if-else statements. The conditions are set as whether the recipient or sender in the input data appears in the express parcel security scenario assessment database, whether the recipient address or sender address in the input data appears in the express parcel security scenario assessment database, and whether contraband is detected in the input data. In this way, express parcels that may pose risks are screened out and express parcels that do not pose risks are output;

[0008] The package safety risk prediction training module is used to train the optimal express package safety risk prediction model. This prediction model consists of a ConvE model and a graph neural network, and its input is the output of the dangerous package initial screening module. First, a knowledge graph of express package information is constructed. The express package information knowledge graph consists of a series of triples <head entity, relationship, tail entity>. Then, the express package information knowledge graph is embedded using the ConvE model to obtain the embedded representation of the entity and the embedded representation of the relationship. Finally, the graph neural network is used to perform feature fusion and update on the embedded representation of the entity and the embedded representation of the relationship, and the embedded representation of the entity is extracted for package safety risk prediction. Among them, both the ConvE model and the graph neural network are trained in a supervised manner, and finally the optimal express package safety risk prediction model is obtained.

[0009] The package safety risk prediction module is used to predict the risks of express packages. Its input is the output of the dangerous package initial screening module. It uses the optimal express package safety risk prediction model to predict the risks of express packages and writes the data of express packages predicted to be at risk into the express package safety scenario assessment database.

[0010] Furthermore, the data import module includes a data loading module and a data preprocessing module, wherein:

[0011] The data import module reads the express parcel waybill data, express parcel security inspection data and data from the express parcel security scenario assessment database locally. The express parcel waybill data includes: mail barcode, collection and delivery time, collection person, organization code, destination administrative region, destination province and city, customer code, product code, sender, sender address, sender phone number, recipient, recipient address and recipient phone number. The express parcel security inspection data includes: category and confidence level of detected contraband. The data in the express parcel security scenario assessment database is the data of express parcels that have been historically detected as risky.

[0012] The data preprocessing module is used to delete abnormal package information in the express parcel waybill data and the express parcel security inspection data, and to remove redundant waybill information in the express parcel waybill data, including the mail barcode, the administrative area of ​​the destination and the customer code.

[0013] Furthermore, the dangerous package initial screening module performs the following operations:

[0014] If the recipient or sender in the express package bill data appears in the express package security scenario assessment database, the package status is judged to be at risk;

[0015] If the recipient address or sender address in the express package bill data appears in the express package security scenario assessment database, the package status is judged to be at risk;

[0016] If prohibited items are detected in the express package security inspection data, the package status is judged to be at risk.

[0017] Furthermore, the parcel safety risk prediction training module includes an express parcel information knowledge graph construction module, an express parcel information knowledge graph embedding representation module and a feature fusion prediction module, wherein:

[0018] The express package information knowledge graph construction module performs the following operations:

[0019] 1) Extract the express package label data and express package security inspection data into triplets: select the sender, sender address, sender phone number, recipient, recipient address, recipient phone number, product code, organization code, and prohibited item category as entities. The relationship between the sender and the sender address, sender phone number, and organization code is defined as "has", the relationship between the sender and the product code is defined as "send", the relationship between the recipient and the recipient address and recipient phone number is defined as "has", the relationship between the recipient and the product code is defined as "receive", the relationship between the sender and the recipient is defined as "send to", and the relationship between the product code and the prohibited item category is defined as "is";

[0020] 2) Store the triples in the Neo4j graph database and visualize the knowledge graph;

[0021] The express parcel information knowledge graph embedding module uses the ConvE model to embed the knowledge graph to obtain the embedding representation of entities and relationships, and performs the following operations:

[0022] 1) Obtain the initial vector representation e of the head entity, relation, and tail entity through pre-training method s 、r r 、e o , reshape the initial vectors of the head entity and relationship into two-dimensional vectors, splice them together, and perform dropout operation;

[0023] 2) Pass the two-dimensional vector through several convolution kernels to obtain a feature map;

[0024] 3) Expand the feature map into a one-dimensional vector and pass it through a fully connected layer to obtain the vector representation of the head entity and relationship;

[0025] 4) Multiply the vector representation of the head entity and relationship with the initial vector of the tail entity to obtain the score corresponding to each tail entity, and pass it through a sigmoid layer to obtain the predicted score;

[0026] The ConvE model can be expressed as follows:

[0027]

[0028] Where, for e s The result after reshape, For r r The result after reshape, [;] is the splicing operation, * is the convolution operation, ω is the convolution kernel parameter, f(·) is the nonlinear function, vec(·) is the flattening operation, W is the fully connected layer parameter, e o is the tail entity embedding representation, σ(·) is the sigmoid function, and p is the predicted score obtained by the model.

[0029] The loss function of the ConvE model is:

[0030]

[0031] Where, t i is the i-th true value, p i is the i-th predicted value, N is the number of samples, and L is the loss value;

[0032] Use backpropagation to train the ConvE model to obtain the embedded representation of the knowledge graph of express package information;

[0033] The feature fusion prediction module uses a heterogeneous graph attention network to perform feature fusion and prediction on the embedded representation of the express package information knowledge graph, performing the following operations:

[0034] 1) Calculate the node-level attention coefficient of the embedding representation of the target entity and the embedding representation of its neighboring entities in a specific path:

[0035]

[0036] Where, α ij is the embedding representation h of the target entity in the path i Embedding representation h for the jth neighbor entity j The node-level attention coefficient, σ is the activation function, a is the learnable parameter, N iis the number of neighbor entities of the target entity, h k is the kth neighbor entity of the target entity;

[0037] 2) Based on the node-level attention coefficient, the embedding representations of neighboring entities are weighted summed to obtain the updated embedding representation of the target entity:

[0038]

[0039] Where z i is the updated target entity embedding representation, j is the neighbor entity embedding representation h j 's index;

[0040] 3) The entity embedding representations under b different paths are averaged and normalized to obtain the relationship-level attention coefficient:

[0041]

[0042]

[0043] In the formula, b represents the number of all nodes, q, W and c are the parameters that need to be trained for the heterogeneous graph attention network, z s is the embedding representation of the s-th target entity, T represents the transposition, w p is the relation-level attention weight, β p is the relation-level attention coefficient, P is the relation set, and p is a different relation;

[0044] 4) Update the target entity embedding representation based on the relation-level attention coefficient:

[0045]

[0046] Among them, Z i represents the updated target entity embedding representation;

[0047] 5) Construct an entity classification layer to make final predictions on the updated target entity embedding representation:

[0048] R i =sigmoid(w i ·Z i )

[0049] Where w i is a learnable parameter, R i To predict the results;

[0050] 6) Use backpropagation to train the heterogeneous graph attention network, and the loss function is cross entropy loss.

[0051] Furthermore, the package safety risk prediction module performs the following operations:

[0052] 1) Use the data import module to load the express parcel waybill data, express parcel security inspection data, and data from the express parcel security scenario assessment database, and perform pre-processing operations on the express parcel waybill data and express parcel security inspection data;

[0053] 2) The express package label data and express package security inspection data processed in step 1) are input into the dangerous package screening module for preliminary screening. If the screening result determines that the package status is risky, the prediction result is directly output and the process ends; otherwise, the process proceeds to step 3);

[0054] 3) Input the screening results in step 2) into the optimal express parcel security risk prediction model obtained by the parcel security risk prediction training module to predict the risk of the express parcel. If the parcel is predicted to be a prohibited item, the parcel status is judged to be at risk, and the parcel data and prediction results are written into the express parcel security scenario assessment database. Otherwise, it is safe.

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

[0056] 1. For the first time, a knowledge graph of express parcel information based on massive heterogeneous express parcel data was constructed and visualized, which is conducive to the analysis and mining of massive express parcel data.

[0057] 2. Graph neural networks and deep learning methods are introduced to process the knowledge graph of express package information, obtain more effective express package feature representation, and improve the accuracy of package risk prediction.

[0058] 3. The system integrates the import, processing, mining and prediction of express parcel data, providing a basis and support for the security inspection department to conduct real-time security monitoring and execution decision-making on express parcels. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is a framework diagram of the system of the present invention.

[0060] Figure 2 Flowchart of the data import module.

[0061] Figure 3 Flowchart of building a module for express parcel information knowledge graph, where<h,r,t> Represents <head entity, relationship, tail entity>.

[0062] Figure 4 Schematic diagram of the ConvE model structure in the express package information knowledge graph embedding representation module, where sigmoid is used to limit the value to between 0 and 1.

[0063] Figure 5Schematic diagram of the structure of the heterogeneous graph attention network in the feature fusion prediction module, where sigmoid is used to limit the value to between 0 and 1. DETAILED DESCRIPTION

[0064] The present invention will be described in further detail below with reference to the embodiments and drawings, but the embodiments of the present invention are not limited thereto.

[0065] like Figure 1 As shown, this embodiment provides a courier package safety scenario assessment system based on knowledge graph and graph neural network, developed in Python and using deep learning algorithms. It includes:

[0066] The data import module is used to load the express parcel bill data, express parcel security inspection data and data from the express parcel security scenario assessment database, and perform pre-processing operations on the express parcel bill data and the express parcel security inspection data, including: deleting outliers in the express parcel bill data and the express parcel security inspection data and deleting redundant data in the express parcel bill data;

[0067] The dangerous package screening module is used to perform preliminary screening of express parcels. Its input is the output of the data import module. It constructs three conditional branches consisting of if-else statements. The conditions are set as whether the recipient or sender in the input data appears in the express parcel security scenario assessment database, whether the recipient address or sender address in the input data appears in the express parcel security scenario assessment database, and whether contraband is detected in the input data. In this way, express parcels that may pose risks are screened out and express parcels that do not pose risks are output;

[0068] The package safety risk prediction training module is used to train the optimal express package safety risk prediction model. This prediction model consists of a ConvE model and a graph neural network, and its input is the output of the dangerous package initial screening module. First, a knowledge graph of express package information is constructed. The express package information knowledge graph consists of a series of triples <head entity, relationship, tail entity>. Then, the express package information knowledge graph is embedded using the ConvE model to obtain the embedded representation of the entity and the embedded representation of the relationship. Finally, the graph neural network is used to perform feature fusion and update on the embedded representation of the entity and the embedded representation of the relationship, and the embedded representation of the entity is extracted for package safety risk prediction. Among them, both the ConvE model and the graph neural network are trained in a supervised manner, and finally the optimal express package safety risk prediction model is obtained.

[0069] The package safety risk prediction module is used to predict the risks of express packages. Its input is the output of the dangerous package initial screening module. It uses the optimal express package safety risk prediction model to predict the risks of express packages and writes the data of express packages predicted to be at risk into the express package safety scenario assessment database.

[0070] Specifically, the data import module includes a data loading module and a data preprocessing module. Figure 2 As shown, where:

[0071] The data import module reads the express parcel waybill data, express parcel security inspection data and data from the express parcel security scenario assessment database locally. The express parcel waybill data includes: mail barcode, collection and delivery time, collection person, organization code, destination administrative region, destination province and city, customer code, product code, sender, sender address, sender phone number, recipient, recipient address and recipient phone number. The express parcel security inspection data includes: category and confidence level of detected contraband. The data in the express parcel security scenario assessment database is the data of express parcels that have been historically detected as risky.

[0072] The data preprocessing module is used to delete abnormal package information in the express parcel waybill data and the express parcel security inspection data, and to remove redundant waybill information in the express parcel waybill data, including the mail barcode, the administrative area of ​​the destination and the customer code.

[0073] Specifically, the dangerous package initial screening module performs the following operations:

[0074] If the recipient or sender in the express package bill data appears in the express package security scenario assessment database, the package status is judged to be at risk;

[0075] If the recipient address or sender address in the express package bill data appears in the express package security scenario assessment database, the package status is judged to be at risk;

[0076] If the express package security inspection data detects that the package contains prohibited items, the package status is judged to be at risk.

[0077] Specifically, the parcel safety risk prediction training module includes an express parcel information knowledge graph construction module, an express parcel information knowledge graph embedding representation module, and a feature fusion prediction module, wherein:

[0078] like Figure 3 As shown, the express package information knowledge graph construction module performs the following operations:

[0079] 1) Extract the express package slip data and express package security data into triples: select the sender, sender address, sender phone, recipient, recipient address, recipient phone, product code, organization code, and prohibited item category as entities, define the relationship between the sender and the sender address, sender phone, and organization code as "has", define the relationship between the sender and the product code as "send", define the relationship between the recipient and the recipient address, recipient phone as "has", define the relationship between the recipient and the product code as "receive", define the relationship between the sender and the recipient as "send to", and define the relationship between the product code and the prohibited item category as "is";

[0080] 2) Store the triples in the Neo4j graph database and visualize the knowledge graph.

[0081] The express package information knowledge graph embedding representation module uses the ConvE model to perform embedding representation on the knowledge graph, to obtain the embedding representation of entities and the embedding representation of relationships, as shown in Figure 4 The following operations are performed:

[0082] 1) Obtain the initial vector representation e s , r r , e o of the head entity, relationship, and tail entity through a pre-training method, reshape the initial vector of the head entity and relationship into a two-dimensional vector, concatenate them together, and perform a dropout operation;

[0083] 2) Obtain a feature map by passing the two-dimensional vector through several convolution kernels;

[0084] 3) Expand the feature map into a one-dimensional vector and obtain the vector representation of the head entity and relationship through a fully connected layer;

[0085] 4) Multiply the vector representation of the head entity and relationship with the initial vector of the tail entity to obtain the score corresponding to each tail entity, and obtain the prediction score through a sigmoid layer;

[0086] The ConvE model can be represented by the following formula:

[0087]

[0088] In the formula, is the result of reshaping e s , is the result of reshaping r r , [;] is the concatenation operation, * is the convolution operation, ω is the convolution kernel parameter, f(·) is the nonlinear function, vec(·) is the flattening operation, W is the fully connected layer parameter, and e ois the tail entity embedding representation, σ(·) is the sigmoid function, and p is the predicted score obtained by the model.

[0089] The loss function of the ConvE model is:

[0090]

[0091] Where, t i is the i-th true value, p i is the i-th predicted value, N is the number of samples, and L is the loss value;

[0092] Use backpropagation to train the ConvE model and obtain the embedded representation of the express package information knowledge graph.

[0093] The feature fusion prediction module uses a heterogeneous graph attention network to perform feature fusion and prediction on the embedded representation of the express package information knowledge graph, such as Figure 5 As shown, do the following:

[0094] 1) Calculate the node-level attention coefficient of the embedding representation of the target entity and the embedding representation of its neighboring entities in a specific path:

[0095]

[0096] Where, α ij is the embedding representation h of the target entity in the path i Embedding representation h for the jth neighbor entity j The node-level attention coefficient, σ is the activation function, a is the learnable parameter, N i is the number of neighbor entities of the target entity, h k is the kth neighbor entity of the target entity;

[0097] 2) Based on the node-level attention coefficient, the embedding representations of neighboring entities are weighted summed to obtain the updated embedding representation of the target entity:

[0098]

[0099] Where z i is the updated target entity embedding representation, j is the neighbor entity embedding representation h j 's index;

[0100] 3) The entity embedding representations under b different paths are averaged and normalized to obtain the relationship-level attention coefficient:

[0101]

[0102]

[0103] where b denotes the number of all nodes, q, W and c are parameters that need to be trained for the heterogeneous graph attention network, and z s is the embedding representation of the s-th target entity, T denotes the transpose, and w p is the relation-level attention weight, and β p is the relation-level attention coefficient, P is the set of relations, and p is different relations.

[0104] 4) updating the embedding representation of the target entity according to the relation-level attention coefficient:

[0105]

[0106] where Z i is the updated embedding representation of the target entity.

[0107] 5) constructing an entity classification layer to make a final prediction on the updated embedding representation of the target entity:

[0108] R i = sigmoid(w i · Z i )

[0109] where w i is a learnable parameter, and R i is the prediction result.

[0110] 6) training the heterogeneous graph attention network using back propagation, and the loss function is cross-entropy loss.

[0111] Specifically, the parcel safety risk prediction module performs the following operations:

[0112] 1) loading the express parcel waybill data, express parcel security inspection data and data in the express parcel safety scene evaluation database using a data import module, and performing a preprocessing operation on the express parcel waybill data and the express parcel security inspection data;

[0113] 2) inputting the express parcel waybill data and the express parcel security inspection data processed in step 1) into a dangerous parcel preliminary screening module for preliminary screening, and for the screening result, if it is judged that the parcel state is at risk, directly outputting a prediction result and ending; otherwise, entering step 3);

[0114] 3) inputting the screening result in step 2) into the optimal express parcel safety risk prediction model obtained by the parcel safety risk prediction training module to perform risk prediction on the express parcel, if the predicted parcel is contraband, it is judged that the parcel state is at risk, and the parcel data and the prediction result are written into the express parcel safety scene evaluation database, otherwise, it is safe.

[0115] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.

Claims

1. Express package safety scenario assessment system based on knowledge graph and graph neural network, characterized by: include: The data import module is used to load the express parcel bill data, express parcel security inspection data and data from the express parcel security scenario assessment database, and perform pre-processing operations on the express parcel bill data and the express parcel security inspection data, including: deleting outliers in the express parcel bill data and the express parcel security inspection data and deleting redundant data in the express parcel bill data; The dangerous package screening module is used to perform preliminary screening of express parcels. Its input is the output of the data import module. It constructs three conditional branches consisting of if-else statements. The conditions are set as whether the recipient or sender in the input data appears in the express parcel security scenario assessment database, whether the recipient address or sender address in the input data appears in the express parcel security scenario assessment database, and whether contraband is detected in the input data. In this way, express parcels that may pose risks are screened out and express parcels that do not pose risks are output; The package safety risk prediction training module is used to train the optimal express package safety risk prediction model. This prediction model consists of a ConvE model and a graph neural network, and its input is the output of the dangerous package initial screening module. First, a knowledge graph of express package information is constructed. The express package information knowledge graph consists of a series of triples <head entity, relationship, tail entity>. Then, the express package information knowledge graph is embedded using the ConvE model to obtain the embedded representation of the entity and the embedded representation of the relationship. Finally, the graph neural network is used to perform feature fusion and update on the embedded representation of the entity and the embedded representation of the relationship, and the embedded representation of the entity is extracted for package safety risk prediction. Among them, both the ConvE model and the graph neural network are trained in a supervised manner, and finally the optimal express package safety risk prediction model is obtained. The package safety risk prediction module is used to predict the risks of express packages. Its input is the output of the dangerous package initial screening module. It uses the optimal express package safety risk prediction model to predict the risks of express packages and writes the data of express packages predicted to be at risk into the express package safety scenario assessment database.

2. The express package safety scenario assessment system based on knowledge graph and graph neural network according to claim 1 is characterized in that: The data import module includes a data loading module and a data preprocessing module, wherein: The data import module reads the express parcel waybill data, express parcel security inspection data and data from the express parcel security scenario assessment database locally. The express parcel waybill data includes: mail barcode, collection and delivery time, collection person, organization code, destination administrative region, destination province and city, customer code, product code, sender, sender address, sender phone number, recipient, recipient address and recipient phone number. The express parcel security inspection data includes: category and confidence level of detected contraband. The data in the express parcel security scenario assessment database is the data of express parcels that have been historically detected as risky. The data preprocessing module is used to delete abnormal package information in the express parcel waybill data and the express parcel security inspection data, and to remove redundant waybill information in the express parcel waybill data, including the mail barcode, the administrative area of ​​the destination and the customer code.

3. The express package safety scenario assessment system based on knowledge graph and graph neural network according to claim 1 is characterized in that: The dangerous package screening module performs the following operations: If the recipient or sender in the express package bill data appears in the express package security scenario assessment database, the package status is judged to be at risk; If the recipient address or sender address in the express package bill data appears in the express package security scenario assessment database, the package status is judged to be at risk; If prohibited items are detected in the express package security inspection data, the package status is judged to be at risk.

4. The express package safety scenario assessment system based on knowledge graph and graph neural network according to claim 1 is characterized in that: The parcel safety risk prediction training module includes an express parcel information knowledge graph construction module, an express parcel information knowledge graph embedding representation module, and a feature fusion prediction module, wherein: The express package information knowledge graph construction module performs the following operations: Extract the express parcel waybill data and express parcel security inspection data into triplets: select the sender, sender address, sender phone number, recipient, recipient address, recipient phone number, product code, organization code, and prohibited goods category as entities. The relationship between the sender and the sender address, sender phone number, and organization code is defined as "has", the relationship between the sender and the product code is defined as "send", the relationship between the recipient and the recipient address and recipient phone number is defined as "has", the relationship between the recipient and the product code is defined as "receive", the relationship between the sender and the recipient is defined as "send to", and the relationship between the product code and the prohibited goods category is defined as "is"; Store triples in the Neo4j graph database and visualize the knowledge graph; The express parcel information knowledge graph embedding module uses the ConvE model to embed the knowledge graph to obtain the embedding representation of entities and relationships, and performs the following operations: The initial vector representations e of the head entity, relation, and tail entity are obtained through pre-training methods s 、r r 、e o , reshape the initial vectors of the head entity and relationship into two-dimensional vectors, splice them together, and perform dropout operation; Pass the two-dimensional vector through several convolution kernels to obtain a feature map; Expand the feature map into a one-dimensional vector and pass it through a fully connected layer to obtain the vector representation of the head entity and relationship; Multiply the vector representation of the head entity and relationship with the initial vector of the tail entity to obtain the score corresponding to each tail entity, and pass it through a sigmoid layer to obtain the predicted score; The ConvE model can be expressed as follows: Where, for e s The result after reshape, For r r The result after reshape, [;] is the splicing operation, * is the convolution operation, ω is the convolution kernel parameter, f(·) is the nonlinear function, vec(·) is the flattening operation, W is the fully connected layer parameter, e o is the tail entity embedding representation, σ(·) is the sigmoid function, and p is the prediction score obtained by the model; The loss function of the ConvE model is: Where, t i is the i-th true value, p i is the i-th predicted value, N is the number of samples, and L is the loss value; Use backpropagation to train the ConvE model to obtain the embedded representation of the knowledge graph of express package information; The feature fusion prediction module uses a heterogeneous graph attention network to perform feature fusion and prediction on the embedded representation of the express package information knowledge graph, performing the following operations: Calculate the node-level attention coefficient of the embedding representation of the target entity and the embedding representation of its neighbor entities in a specific path: Where, α ij is the embedding representation h of the target entity in the path i Embedding representation h for the jth neighbor entity j The node-level attention coefficient, σ′ is the activation function, a is the learnable parameter, N i is the number of neighbor entities of the target entity, h k is the kth neighbor entity of the target entity; According to the node-level attention coefficient, the embedding representations of neighbor entities are weighted summed to obtain the updated embedding representation of the target entity: Where z i is the updated target entity embedding representation, j is the neighbor entity embedding representation h j 's index; The entity embedding representations under different paths are averaged and normalized to obtain the relation-level attention coefficient: In the formula, b represents the number of all nodes, q, W′ and c are the parameters that need to be trained for the heterogeneous graph attention network, z s is the embedding representation of the s-th target entity, T represents the transposition, w p is the relation-level attention weight, β p is the relation-level attention coefficient, P is the relation set, and p is a different relation; Update the target entity embedding representation based on the relation-level attention coefficient: Among them, Z i represents the updated target entity embedding representation; Construct the entity classification layer to make the final prediction on the updated target entity embedding representation: R i =sigmoid(w i ·Z i ) Where w i is a learnable parameter, R i To predict the results; Backpropagation is used to train the heterogeneous graph attention network, and the loss function is cross entropy loss.

5. The express package safety scenario assessment system based on knowledge graph and graph neural network according to claim 1 is characterized in that: The package security risk prediction module performs the following operations: 1) Use the data import module to load the express parcel waybill data, express parcel security inspection data, and data from the express parcel security scenario assessment database, and perform pre-processing operations on the express parcel waybill data and express parcel security inspection data; 2) The express package label data and express package security inspection data processed in step 1) are input into the dangerous package screening module for preliminary screening. If the screening result determines that the package status is risky, the prediction result is directly output and the process ends; Otherwise go to step 3); 3) Input the screening results in step 2) into the optimal express parcel security risk prediction model obtained by the parcel security risk prediction training module to predict the risk of the express parcel. If the parcel is predicted to be a prohibited item, the parcel status is judged to be at risk, and the parcel data and prediction results are written into the express parcel security scenario assessment database. Otherwise, it is safe.

Citation Information

Patent Citations

  • X-ray contraband package detection method and device based on feature map re-empowerment

    CN112070079A

  • Risk parcel identification method and device, equipment and storage medium

    CN113421007A