Risk identification method and related device

By combining knowledge graphs and hybrid attention mechanisms, and using a multi-head attention model to optimize feature channel weights, the limitations of financial knowledge graphs in risk identification are solved, and efficient and accurate credit risk identification is achieved.

CN120996919APending Publication Date: 2025-11-21AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511050071.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-29
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing risk identification methods based on financial knowledge graphs have limitations in weight allocation and feature learning, making it difficult to fully capture the impact characteristics of credit risk, especially implicit and dynamic features.

Method used

By combining knowledge graphs and hybrid attention mechanisms, this method identifies risks under complex credit relationships by constructing correlations between data. It employs multi-head attention models and classification models, and utilizes spatial attention networks and channel attention networks to optimize feature channel weights, thereby reducing computational complexity and improving the accuracy of risk identification.

Benefits of technology

It improves the accuracy and efficiency of risk identification, enhances the interpretability of risk identification results, effectively handles high-dimensional sparse user characteristics, and improves the decision-making ability of credit risk management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120996919A_ABST
    Figure CN120996919A_ABST
Patent Text Reader

Abstract

The invention discloses a risk identification method and a related device, and relates to the technical field of artificial intelligence, and the method comprises the steps: obtaining feature data of a target knowledge graph of a target user; inputting the feature data into a pre-trained risk identification model to obtain a risk identification result output by the risk identification model; the risk identification model sequentially comprises a multi-head attention model and a classification model, an attention head is formed by sequentially connecting a space attention network and a channel attention network, and the risk identification model is obtained through pre-training based on sample feature data of a sample knowledge graph and a risk label; the risk label is used for indicating whether the risk of the target risk type exists. The multi-head attention mechanism, the channel attention mechanism and the space attention mechanism are combined. In the attention head, the key area is focused in advance through the space attention, the feature channel weight is optimized only in the high-risk node selected by the space attention through the channel attention, the calculation complexity is reduced, and the gold risk prediction accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a risk identification method and related device. BACKGROUND

[0002] With the rapid development of the Internet and information technology, the banking system has accumulated a large amount of customer data, including traditional financial data and non-traditional financial data. The traditional financial data includes transaction data and credit information and other financial business related data, and the non-traditional financial data includes social media data and e-commerce platform data. Deep mining and analysis of full customer data can help improve the accuracy of customer credit risk identification, thereby improving the pre-loan risk control capability. SUMMARY

[0003] In view of the above problems, the present application provides a risk identification method and related device to achieve the purpose of improving the accuracy of risk identification. The specific scheme is as follows:

[0004] The first aspect of the present application provides a risk identification method, comprising:

[0005] obtaining feature data of a target knowledge graph of a target user;

[0006] inputting the feature data into a pre-trained risk identification model to obtain a risk identification result output by the risk identification model; the risk identification model sequentially includes a multi-head attention model and a classification model, wherein the multi-head attention model includes multiple attention heads in parallel, the attention heads are sequentially connected by a spatial attention network and a channel attention network, the risk identification model is pre-trained based on sample feature data and risk labels of a sample knowledge graph, and the risk labels are used to indicate whether there is a target risk type of risk.

[0007] In one possible implementation, obtaining the feature data of the target knowledge graph of the target user comprises:

[0008] constructing a user knowledge graph based on user data of the target user, and determining a target time window based on the target risk type;

[0009] extracting a subgraph corresponding to the target time window of the user knowledge graph as the target knowledge graph;

[0010] extracting feature data of the target knowledge graph based on a pre-trained graph neural network, the feature data including embedded feature vectors of multiple target feature types, and the multiple target feature types being determined based on the target risk type.

[0011] In a possible implementation, based on user data of the target user, a user knowledge graph is constructed, including:

[0012] User data of the target user is acquired, and the user data includes traditional financial data and non-traditional financial data.

[0013] For structured data in the user data, candidate fact triplets of the structured data are extracted according to key fields;

[0014] For semi-structured data in the user data, candidate fact triplets of the semi-structured data are extracted by using a preset rule template;

[0015] For unstructured data in the user data, candidate fact triplets of the unstructured data are extracted based on a bidirectional long short-term memory network;

[0016] After entity alignment, entity disambiguation, and conflict relation identification are performed on a candidate triplet set, a target triplet set is obtained, the candidate triplet set includes all the candidate fact triplets, and the target triplet set includes a plurality of target fact triplets.

[0017] Based on the target triplet set, a user knowledge graph of the target user is constructed.

[0018] In a possible implementation, the multi-head attention model further includes a linear mapping module and a fusion module, an output end of the linear mapping module is connected to input ends of spatial attention networks and channel attention networks in each of the attention heads, and an output end of the spatial attention network in the attention head is connected to an input end of the corresponding channel attention network and an input end of the fusion module.

[0019] In a possible implementation, the feature data is input into a pre-trained risk identification model to obtain a risk identification result output by the risk identification model, including:

[0020] The feature data is input into the risk identification model.

[0021] The feature data is mapped to three different subspaces by three independent linear layers of the linear transformation module to obtain query features, key features, and value features, and the query features, the key features, and the value features are split according to the number of the attention heads to obtain original feature maps of each of the attention heads.

[0022] The original feature map of the attention head is input to the attention head, and the spatial attention map of the original feature map is generated by each attention head through a spatial attention network; the spatial attention map is multiplied with the original feature map element by element to obtain a spatial feature map; a channel attention map of the spatial feature map is generated through a channel attention network, and the channel attention map is multiplied with the spatial feature map element by element to obtain a channel feature map;

[0023] The channel feature map of each attention head is input to the fusion module, and the channel feature map of each attention head is spliced by the fusion module to obtain a target feature map;

[0024] The target feature map is input to the classification model, so that the classification model outputs a risk prediction result.

[0025] The second aspect of the application provides a risk identification device, comprising:

[0026] A feature extraction unit is configured to obtain feature data of a target knowledge graph of a target user;

[0027] A risk identification unit is configured to input the feature data into a pre-trained risk identification model to obtain a risk identification result output by the risk identification model; the risk identification model sequentially comprises a multi-head attention model and a classification model, wherein the multi-head attention model comprises a plurality of attention heads connected in parallel, the attention heads are sequentially connected by a spatial attention network and a channel attention network, the risk identification model is pre-trained based on sample feature data and a risk label of a sample knowledge graph, and the risk label is used to indicate whether a target risk type exists.

[0028] In one possible implementation, the feature extraction unit comprises:

[0029] A graph construction unit is configured to construct a user knowledge graph based on user data of the target user, and a target time window is determined based on the target risk type.

[0030] A graph extraction unit is configured to extract a subgraph corresponding to the target time window from the user knowledge graph as the target knowledge graph.

[0031] A feature embedding unit is configured to extract feature data of the target knowledge graph based on a pre-trained graph neural network, wherein the feature data comprises embedding feature vectors of a plurality of target feature types, and the plurality of target feature types are determined based on the target risk type.

[0032] The third aspect of the present application provides a computer program product, comprising computer readable instructions, which, when executed on an electronic device, cause the electronic device to implement the risk identification method of the first aspect or any implementation manner of the first aspect.

[0033] The fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:

[0034] The memory is configured to store a computer program;

[0035] The processor is configured to execute the computer program to enable the electronic device to implement the risk identification method of the first aspect or any implementation manner of the first aspect.

[0036] The fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the risk identification method of the first aspect or any implementation manner of the first aspect.

[0037] By the above technical solution, the risk identification method and related device provided by the present application obtain feature data of a target knowledge graph of a target user; input the feature data into a pre-trained risk identification model to obtain a risk identification result output by the risk identification model; the risk identification model sequentially includes a multi-head attention model and a classification model, wherein the multi-head attention model includes multiple attention heads connected in parallel, and each attention head is composed of a spatial attention network and a channel attention network connected in sequence, the risk identification model is pre-trained based on sample feature data and risk labels of a sample knowledge graph, and the risk label is used to indicate whether there is a risk of a target risk type. In summary, the present application improves the performance of the model by combining the multi-head attention mechanism, the channel attention mechanism and the spatial attention mechanism. Furthermore, in each attention head, the spatial attention is used to focus on the key area first, and the channel attention is used to optimize the feature channel weight only at the high-risk nodes selected by the spatial attention, so as to avoid invalid calculation of the channel attention on the full amount of feature data, thereby reducing the computational complexity and improving the accuracy of risk prediction. BRIEF DESCRIPTION OF DRAWINGS

[0038] The above and other features, advantages, and aspects of the embodiments of the present disclosure will become more apparent by describing in detail the following specific embodiments thereof with reference to the attached drawings. Throughout the drawings, the same or similar reference numerals refer to the same or similar elements. It should be understood that the drawings are schematic, and the original and elements are not necessarily drawn according to the scale.

[0039] Figure 1 An architecture diagram of a risk identification system provided by the present application is shown in FIG. 1;

[0040] Figure 2 A flowchart of a risk identification method provided in the present application is shown in FIG. 1.

[0041] Figure 3 A flowchart of another data processing method provided in an embodiment of the present application is shown in FIG. 2.

[0042] Figure 4a A structural diagram of a risk identification model provided in the present application is shown in FIG. 3.

[0043] Figure 4b A specific implementation flowchart of a risk identification method provided in the present application is shown in FIG. 4.

[0044] Figure 5 A structural diagram of a risk identification device provided in the present application is shown in FIG. 5.

[0045] Figure 6 A structural diagram of an electronic device provided in the present application is shown in FIG. 6. DETAILED DESCRIPTION

[0046] The embodiments of the present application are described below in conjunction with the accompanying drawings. The terms used in the embodiment part of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0047] The embodiments of the present application are described below in conjunction with the accompanying drawings. It is known to those of ordinary skill in the art that, as technology develops and new scenarios appear, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0048] The terms “first”, “second”, and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances, and this is only a distinguishing way used in the description of the embodiments of the present application to describe the objects with the same attributes. In addition, the terms “include” and “have” and any variations thereof are intended to cover non-exclusive inclusion, so that the processes, methods, systems, products or devices containing a series of units do not have to be limited to those units, but can include other units that are not clearly listed or inherent to these processes, methods, products or devices.

[0049] The present application can be applied in the field of artificial intelligence technology, and specifically applied in the scene of identifying user credit risk combined with knowledge graph and multi-head attention mechanism. It should be noted that credit risk belongs to a specific type of financial risk, and the present application can also be applied to other types of risk identification scenarios.

[0050] The following will take the credit risk identification scenario as an example to describe the application scenario of the risk identification provided by the embodiments of the present application in detail.

[0051] The existing credit risk identification method estimates the credit risk level of a user according to the risk indicators of each node based on different risk indicators in a risk relationship graph, wherein the risk relationship graph is a financial knowledge graph constructed based on enterprise financial data. The structure of the financial knowledge graph can represent the relationship between user nodes, so that credit risk identification can be realized based on the financial knowledge graph. The knowledge graph provides structured correlation reasoning capability for credit risk analysis, but the traditional risk identification method based on the financial knowledge graph has great limitations in weight distribution and feature learning, and it is difficult to comprehensively capture credit risk influencing features, especially hidden features and dynamic features.

[0052] To solve the above problems, the embodiments of the present application provide a risk identification method, which combines a knowledge graph and a hybrid attention mechanism to identify risks of various risk types. Specifically, the knowledge graph explores the complex relationships between various types of data by constructing the relevance between data, and identifies risks under complex credit relationships. The hybrid attention mechanism improves the processing capability of high-dimensional and sparse user features for risk identification, thereby improving the accuracy of risk identification.

[0053] The present application can be applied in, but not limited to, an application program with risk identification function or a cloud service provided by a cloud-side server, etc. Next, they will be introduced respectively:

[0054] Referring to Figure 1 , Figure 1 A system architecture diagram is shown. The system can include a terminal 100 and a server 200. The server 200 can provide the method provided by the embodiments of the present application for one or more terminals.

[0055] The terminal 100 can install a risk identification application program. The above application program and webpage can provide an interface. The terminal 100 can receive the related parameters input by the user on the risk identification interface, and send the above parameters to the server 200. The server 200 can obtain the processing result based on the received parameters, and return the processing result to the terminal 100.

[0056] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received parameters by itself without the cooperation of the server. The embodiments of the present application are not limited.

[0057] Next, the product form of the terminal 100 in Figure 1 will be described.

[0058] The terminal 100 in the embodiments of the present application can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), and the like, and the embodiments of the present application do not make any limitation in this regard.

[0059] The terminal 100 can include a radio frequency unit, a memory, an input unit, a display unit, a camera (optional), an audio circuit (optional), a speaker (optional), a microphone (optional), a headset jack (optional), a processor, an external interface, a power supply, and the like. Those skilled in the art can understand that the above components are only examples and do not constitute a limitation on the terminal or the multifunctional device, and more or fewer components can be included, or some components can be combined or different components can be included.

[0060] The input unit can be used to receive inputted digital or character information, and to generate key signal input related to user settings and function control of the portable multifunctional device. Specifically, the input unit can include a touch screen (optional) and / or other input devices. Specifically, the other input devices can include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, on-off buttons, and the like), trackballs, mice, joysticks, and the like.

[0061] The input device can receive inputted data and the like.

[0062] The display unit can be used to display information inputted by the user or information provided to the user, various menus of the terminal, interactive interfaces, file display, and / or playing of any kind of multimedia files. In the embodiments of the present application, the display unit can be used to display interfaces of risk identification, processing results, and the like.

[0063] The memory can be used to store software codes related to the risk identification method, and the processor can execute steps of the risk identification method, or can dispatch other units (such as the input unit and the display unit) to realize corresponding functions.

[0064] The radio frequency unit (optional) can be used to receive and send signals in the process of receiving and sending information or calls.

[0065] In the embodiments of the present application, the radio frequency unit can send data to the server 200 and receive processing results sent by the server 200.

[0066] It should be understood that the radio frequency unit is optional, which can be replaced by other communication interfaces, for example, can be a network interface.

[0067] The terminal 100 further includes a power supply (such as a battery) for supplying power to various components.

[0068] The terminal 100 further includes an external interface, which can be a standard Micro USB interface or a multi-pin connector, and can be used to connect the terminal 100 to other devices for communication or to connect a charger to charge the terminal 100.

[0069] The server 200 includes a bus, a processor, a communication interface, and a memory. The processor, the memory, and the communication interface communicate through the bus.

[0070] The memory can be used to store software codes related to the risk identification method, and the processor can execute the steps of the risk identification method of the chip or can schedule other units to realize the corresponding functions.

[0071] The risk identification method of the embodiment of the present application will be described in detail below in conjunction with the accompanying drawings.

[0072] Referring to Figure 2 , Figure 2 The flow of a risk identification method provided by the embodiment of the present application is shown in Figure 2 The risk identification method provided by the embodiment of the present application can include S201 to S203, which will be described in detail below.

[0073] S201, obtaining feature data of a target knowledge graph of a target user;

[0074] S202, inputting the feature data into a pre-trained risk identification model to obtain a risk identification result output by the risk identification model.

[0075] In this embodiment, the risk identification model sequentially includes a multi-head attention model and a classification model, wherein the multi-head attention model includes multiple attention heads in parallel, the attention head is sequentially connected by a spatial attention network and a channel attention network, the risk identification model is pre-trained based on sample feature data and risk labels of a sample knowledge graph, and the risk label is used to indicate whether there is a risk of a target risk type.

[0076] It can be seen from the technical solution that the risk identification method provided by the embodiment of the application constructs feature data based on the target knowledge graph of the target user, and inputs the feature data into a pre-trained risk identification model to obtain a risk identification result output by the risk identification model. Since the attention head is sequentially connected by a spatial attention network and a channel attention network, each attention head focuses on a key area through the spatial attention first, and then optimizes the feature channel weight only at the high-risk node selected by the spatial attention through the channel attention, avoiding invalid calculation of the channel attention on the full amount of feature data, thereby reducing the computational complexity and improving the accuracy of risk prediction.

[0077] Referring to Figure 3 , Figure 3 The flowchart of another data processing method provided by the embodiment of the application is shown in FIG. 6. Figure 3 An optional specific implementation method of obtaining the user knowledge graph of the target user is shown in FIG. 3. Figure 3 As shown in FIG. 3, the method specifically includes S301-S307, which will be described in detail below.

[0078] S301, obtaining user data of a target user.

[0079] In this embodiment, user data is collected from multiple data sources, and the user data includes multiple data items of multiple data types. The data types include personal basic information, financial status data, credit history records, consumption behavior information, social network data, public record information, occupation and education background, residence and geographic location data, third-party credit scores, blacklist information, and behavior data. Each data type of user data includes at least one data item. For example, the personal basic information includes data items such as name, age, marital status, ID number, and gender. The financial status data includes data items such as income level, asset and liability situation, and bank flow. Table 1 is a user data table showing each data type in the user data and the corresponding data items.

[0080] Table 1 User data table

[0081]

[0082]

[0083] In summary, the user data comprehensively collects traditional financial data and non-traditional financial data. The non-traditional financial data is information that is not directly derived from financial statements or traditional credit evaluation systems and can reflect user behavior patterns, social relationships, environmental adaptability and other dimensions, such as behavior data, residence and geographic location data, occupation and education background, social network data, etc. The non-traditional financial data can significantly improve the accuracy and robustness of the prediction model by capturing risk signals that cannot be covered by traditional data.

[0084] Specifically, the personal basic information is used to identify the basic identity and stability of the user, the financial status data directly reflects the repayment ability and economic status of the user, the credit history record evaluates the credit behavior and credit risk of the user, the consumption behavior information can supplement the traditional credit information and improve the risk identification efficiency of the credit information weak population, the social network data can reveal the lifestyle and social relationship of the user and indirectly reflect the credit status, the public record information is helpful to identify potential legal risks and bad credit records, the occupation and education background is helpful to evaluate the occupation stability and income potential of the user, the residence and geographic location data can be used as a reference to evaluate the life stability of the user, the transaction and payment data are helpful to construct the transaction behavior portrait of the user, the third-party credit score integrates the credit evaluation information of multiple institutions and provides a third-party institution reference for the credit status of the user, the blacklist information from various platform institutions is helpful to identify high-risk users, and the behavior data can reveal the application sincerity and potential fraud risk of the user.

[0085] It can be seen that the user data obtained in this step includes data items of various data types, which comprehensively collects traditional data and non-traditional financial data, improves the comprehensiveness of the user data, and helps to improve the accuracy of risk identification.

[0086] It should be noted that the data items in the user data are divided into structured data, semi-structured data and unstructured data.

[0087] S302, pre-processing the user data.

[0088] In this embodiment, the pre-processing includes data cleaning and data conversion, wherein the data cleaning includes operations such as processing missing values, processing abnormal values, de-duplication and error correction, and the data conversion includes data standardization.

[0089] It should be noted that the user data is denoised by data cleaning, and the user data is standardized by data conversion. The specific pre-processing method can be referred to the prior art.

[0090] S303, for the structured data in the user data, extracting candidate fact triplets of the structured data according to key fields.

[0091] S304, for the semi-structured data in the user data, a preset rule template is used to extract candidate fact triples of the semi-structured data.

[0092] S305, for the unstructured data in the user data, a bidirectional long short-term memory network is used to extract candidate fact triples of the unstructured data.

[0093] In this embodiment, the method for extracting candidate fact triples of unstructured data based on a bidirectional long short-term memory network comprises:

[0094] 1. A word2vec word embedding model is used to encode the unstructured data into a text word vector, and a feature vector is obtained.

[0095] In this embodiment, the unstructured data includes text data, for example, the structured data of the user data includes text data: p = {text1, text2, text3... text n}, and the feature set of the text data is p f = {text'1, text'2, text'3... text' m}, the word2vec is used to convert the feature set of the text data into a text word vector, so as to map the features of the text data to a low-dimensional dense vector space.

[0096] 2. The text word vector is input into a bidirectional long short-term memory network BiLSTM, and candidate fact triples in the structured data are obtained.

[0097] In this embodiment, the BiLSTM network includes two long short-term memory networks in two directions, one for processing sequence data in a forward direction and the other for processing sequence data in a reverse direction, which can simultaneously consider the context information before and after the sequence and more comprehensively capture the context dependency relationship of the sequence.

[0098] S306, after entity alignment, entity disambiguation, and conflict relationship identification on the candidate triple set, a target triple set is obtained.

[0099] In this embodiment, the candidate triple set includes candidate fact triples extracted from structured data, unstructured data, and semi-structured data.

[0100] In an optional embodiment, after entity alignment, entity disambiguation, and conflict relationship identification on the candidate triple set, a specific method for obtaining the target triple set comprises:

[0101] 1. After the same-named entities are preliminarily matched by string similarity (such as edit distance, Jaccard similarity), the alignment is verified by combining the number of shared neighbors to obtain an aligned entity set, the aligned entity set including at least two to-be-aligned entities, for each aligned entity set, a representative entity is determined, and the representative entity is used to replace all to-be-aligned entities in a candidate triple set.

[0102] 2. For each target entity, clustering is performed according to the entity features of the neighbor entities of the target entity, different meanings of the target entity expressed in different triples are distinguished, and entity disambiguation is realized.

[0103] 3. Based on preset conflict rules and logical constraints, relationship conflicts in the candidate fact triples are identified to obtain a conflict triple set, and the candidate fact triples in the conflict triple set are modified.

[0104] S307. Constructing a user knowledge graph based on the target triple set.

[0105] As can be seen from the above technical solutions, the user knowledge graph can effectively sort out a complex relationship network graph and mine the consumption financial needs of potential customers and identify potential financial fraud risks in continuous relationships. Further, by analyzing user data from multiple sources, multiple structures and multiple dimensions to construct a knowledge graph, traditional financial data and non-traditional financial data are comprehensively collected to solve information missing and bias, improve the comprehensiveness and reliability of the knowledge graph, and deepen the semantic richness of the knowledge graph.

[0106] Based on the above embodiment, the risk identification method provided by the embodiment of the present application further includes the step of dynamically updating the user knowledge graph. Specifically, a graph update timing is pre-configured, whether the graph update timing is reached is determined by listening to a preset key event, the graph update is triggered when the graph update timing is reached, the graph is updated based on the event, and the risk identification deviation caused by the knowledge lag of the user knowledge graph is reduced.

[0107] Referring to Figure 4a , Figure 4a A specific structure diagram of a risk identification model provided by the embodiment of the present application is as follows Figure 4aAs shown, the risk identification model is built based on a multi-head attention mechanism. Specifically, the risk identification model includes a multi-head attention model and a classification model. The multi-head attention model sequentially includes a linear mapping module, multiple parallel attention heads, and a fusion module. Each attention head includes a spatial attention network and a channel attention network. The spatial and channel attention networks in each attention head are connected through a residual structure; that is, the input to the channel attention network is the fusion result of the input and output of the spatial attention network, and the output of the attention head is the fusion result of the input and output of the channel attention network. The fusion module takes the output of each attention head as input and concatenates the outputs of each attention head. The linear mapping module includes three independent linear transformation layers, used to perform linear mapping on the input data based on the query matrix, key matrix, and value matrix, respectively.

[0108] See Figure 4b , Figure 4b This is a flowchart illustrating a risk identification method provided in an embodiment of this application, as shown below. Figure 4b As shown, this method includes steps S401 to S411, which are described in detail below.

[0109] S401. Extract the subgraph of the user knowledge graph corresponding to the target time window, and use it as the target knowledge graph.

[0110] In this embodiment, the target time window is determined based on the type of risk to be predicted, i.e., the target risk type. Optionally, the size of the target time window is determined based on the risk identification scenario. For example, when the risk type to be identified is default risk, the target time window is a long window; when the risk type to be identified is fraud risk, the target time window is a short window. The size of the long window is greater than a preset window threshold, and the size of the short window is less than the window threshold.

[0111] It should be noted that by adjusting the target time window based on the risk identification scenario, and thus obtaining target knowledge graphs for different time windows for different risk identification scenarios, we can not only reduce the graph size of a single processing and reduce memory requirements, but also reduce the impact of redundant graph features.

[0112] S402. Based on graph neural networks, obtain feature data of the target user's target knowledge graph.

[0113] In this embodiment, a graph neural network is used to extract the embedded feature vectors of the target feature type based on the target user's target knowledge graph. The embedded feature vectors of each type are combined to obtain feature data. The target feature type is determined based on the target risk type, and includes feature types such as node-level features, edge-level features, global graph-level features, and time-series and dynamic features.

[0114] It should be noted that, since the user data of the set of traditional financial data and non-traditional financial data is large, and the user knowledge graph structure is complex, the target risk type is determined in advance based on the risk prediction scene, the feature data is quickly reduced, and only the feature data related to the current to-be-predicted risk type is extracted, thereby improving the efficiency of risk prediction.

[0115] S403, input the feature data of the target knowledge graph of the target user to the risk identification model.

[0116] In this embodiment, the risk identification model is pre-trained based on sample feature data and risk labels of a sample knowledge graph. The risk label is used to indicate whether there is a target risk type. The sample knowledge graph is obtained based on the target risk type, that is, the time window of the sample indication graph is related to the risk type identified by the to-be-trained risk identification model.

[0117] S404, the linear transformation module maps the feature data to three different subspaces through three independent linear layers to obtain query features, key features and value features.

[0118] In this embodiment, the feature data is denoted as X=[x1,x2,…,x n , where n represents the dimension of the feature data, each dimension xi, i∈1, 2,…, n, is mapped through three linear layers based on the query matrix key matrix and value matrix to map the feature data to three different subspaces to obtain query features Q, key features K and value features V.

[0119] S405, the linear transformation module splits the query features, key features and value features by the number of attention heads to obtain the original feature map of each attention head, and inputs the original feature map to the corresponding attention head.

[0120] In this embodiment, the number of attention heads is denoted as h, the feature dimension of the query features, key features and value features is split into h sub-matrices to obtain the original feature map Fi of each attention head. The original feature map Fi includes the query feature matrix Q i , the key feature matrix K i and the value feature matrix V i .

[0121] S406, for each attention head, a spatial attention map is output through a spatial attention network.

[0122] In this embodiment, the spatial attention network sequentially adopts average pooling and maximum pooling to compress the dimension of the original feature map, capture local features at multiple scales based on three convolution kernels, and finally output a spatial attention map using a Sigmoid function. Optionally, the sizes of the three convolution kernels are 1x3, 3x1 and 3x3 respectively.

[0123] S407, element-wise multiplication of the spatial attention map and the original feature map to obtain a spatial feature map.

[0124] Taking the i-th attention head as an example, the original feature map input to the i-th attention head is denoted as Fi, Fi e R H×W×C , and a spatial attention map M s (Fi) is output by the spatial attention network. s (Fi) = σ(∑Conv(AvgPool(MaxPool(Fi)))). The spatial attention map M s (Fi) is element-wise multiplied with the original feature map Fi to obtain a spatial feature map Fi' based on spatial attention weighting:

[0125] S408, inputting the spatial feature map into a channel attention network to output a channel attention map by the channel attention network.

[0126] In this embodiment, the spatial attention network respectively adopts average pooling and maximum pooling to compress the dimension of the spatial feature map, and obtains two contexts: average pooling feature and maximum pooling feature The average pooling feature and the maximum pooling feature are input into a shared multi-layer perceptron (MLP) to learn the features of each channel, and then a Sigmoid activation function is used to obtain a channel attention map.

[0127] S409, element-wise multiplication of the channel attention map and the spatial feature map to obtain a channel feature map.

[0128] Still taking the i-th attention head as an example, Fi' is input into the channel attention network, and average pooling and maximum pooling are respectively adopted to obtain average pooling feature and maximum pooling feature Through an MLP containing two hidden layers, a channel attention map M c (Fi') is output.

[0129] Element-wise multiplication of the channel attention map M c (Fi') and the spatial feature map Fi' to obtain a channel feature map Fi" based on channel attention weighting:

[0130] It should be noted that the channel attention utilizes the channel relationship between the features to obtain the feature map, and different channels are enhanced or suppressed for different tasks. In this embodiment, the channel attention network adopts a four-layer MLP, that is, only two hidden layers, which reduces the complexity of the attention network and reduces the parameters.

[0131] S410, the channel feature maps output by each attention head are spliced by the fusion module to obtain a target feature map.

[0132] In this embodiment, the output of each attention head is head i Each head i is spliced by the fusion module to obtain the output MultiHead(Q, K, V) of the multi-head attention model, that is:

[0133] MultiHead(Q, K, V) = Concat(head1, head2, …, head h ).

[0134] It should be noted that each attention head in the multi-head attention model uses the spatial attention network and the channel attention network in series, and then uses multiple attention heads in parallel. Based on the preset risk prediction scenario, the number of attention heads is configured, the model complexity is adjusted, and the model training effect is improved.

[0135] S411, the risk identification result of the target user is output by the output layer based on the target feature map of the target user.

[0136] In this embodiment, the output layer includes a pre-trained classification model. The classification model compresses the spatial dimension of the feature map to a fixed size through global average pooling, performs nonlinear transformation on the feature vector through a fully connected layer, and then outputs the risk identification result through a Sigmoid function.

[0137] It should be noted that the graph neural network, the multi-head attention model and the classification model are all pre-trained through historical data. The specific training method can refer to the prior art.

[0138] As can be seen from the above technical solutions, the risk identification method provided by the embodiments of the present application combines the multi-head attention mechanism with the knowledge graph, not only improves the accuracy and efficiency of financial risk identification and evaluation, but also enhances the explainability of the risk identification result.

[0139] Specifically, the neighborhood information of the knowledge graph obtained in the previous step is aggregated by a multi-head attention mechanism of the risk identification model, converted to a vector space or a semantic space of vectors, and subjected to numerical calculation to obtain a feature vector of the neighborhood. Parallel processing of information from different angles enables the model to capture more rich features and relationships in the input data, and reduces the complexity of the model while processing high-dimensional sparse data, thereby improving the accuracy of risk identification. The attention mechanism increases the interpretability of the model by revealing the features that the model focuses on. This helps credit risk management personnel understand the decision-making process of the model, thereby better managing and making decisions on risks. In financial risk identification, user features are often high-dimensional and sparse. The attention mechanism can effectively process such data by assigning different importance to different features, thereby improving the model's ability to identify risky behavior. A deep learning model combined with an attention mechanism can establish a risk prediction model by learning the hidden features in the data.

[0140] The above introduces a risk identification method provided by an embodiment of the present application. The following describes a device for executing the above risk identification method.

[0141] Please refer to Figure 5 , Figure 5 FIG. 1 is a structural schematic diagram of a risk identification device provided by an embodiment of the present application. As shown in the figure, the risk identification device 500 includes: Figure 5

[0142] The feature extraction unit 501 is configured to obtain feature data of a target knowledge graph of a target user.

[0143] The risk identification unit 502 is configured to input the feature data into a pre-trained risk identification model to obtain a risk identification result output by the risk identification model. The risk identification model sequentially includes a multi-head attention model and a classification model. The multi-head attention model includes multiple attention heads connected in parallel.

[0144] In a possible implementation, the feature extraction unit includes:

[0145] The graph construction unit is configured to construct a user knowledge graph based on user data of the target user.

[0146] The graph extraction unit is configured to extract a subgraph corresponding to a target time window from the user knowledge graph as the target knowledge graph.

[0147] ​The feature embedding unit is configured to extract feature data of the target knowledge graph based on a pre-trained graph neural network, the feature data including embedded feature vectors of a plurality of target feature types, the plurality of target feature types being determined based on the target risk type.

[0148] In a possible implementation, the graph construction unit is configured to construct a user knowledge graph based on user data of the target user, and specifically configured to:

[0149] Obtain user data of the target user, the user data including traditional financial data and non-traditional financial data.

[0150] For structured data in the user data, candidate fact triplets of the structured data are extracted according to key fields.

[0151] For semi-structured data in the user data, candidate fact triplets of the semi-structured data are extracted by using a preset rule template.

[0152] For unstructured data in the user data, candidate fact triplets of the unstructured data are extracted based on a bidirectional long short-term memory network.

[0153] After entity alignment, entity disambiguation, and conflict relation identification are performed on the candidate triplet set, a target triplet set is obtained, the candidate triplet set including all the candidate fact triplets, and the target triplet set including a plurality of target fact triplets.

[0154] The target user's user knowledge graph is constructed based on the target triplet set.

[0155] In a possible implementation, the multi-head attention model further includes a linear mapping module and a fusion module, an output end of the linear mapping module being connected to input ends of spatial attention networks and channel attention networks in each of the attention heads, an output end of the spatial attention network in the attention head being connected to an input end of the corresponding channel attention network and an input end of the fusion module.

[0156] In a possible implementation, the risk identification unit is configured to input the feature data into a pre-trained risk identification model to obtain a risk identification result output by the risk identification model, and specifically configured to:

[0157] Input the feature data into the risk identification model.

[0158] The linear transformation module maps the feature data to three different subspaces through three independent linear layers to obtain query features, key features and value features, splits the query features, the key features and the value features according to the number of the attention heads to obtain original feature maps of each attention head;

[0159] The original feature maps of the attention heads are input into the attention heads, and the spatial attention network is used to generate a spatial attention map of the original feature map by each attention head; the spatial attention map is multiplied with the original feature map element by element to obtain a spatial feature map; the channel attention network is used to generate a channel attention map of the spatial feature map, and the channel attention map is multiplied with the spatial feature map element by element to obtain a channel feature map;

[0160] The channel feature maps of each attention head are input into the fusion module, and the channel feature maps of each attention head are spliced by the fusion module to obtain a target feature map;

[0161] The target feature map is input into the classification model, so that the classification model outputs a risk prediction result.

[0162] The embodiment of the application also provides an electronic device. Referring to Figure 6 The electronic device shown in FIG. 1 shows a structural schematic diagram suitable for realizing the electronic device in the embodiment of the application. The electronic device in the embodiment of the application can include but is not limited to a fixed terminal such as a mobile phone, a notebook computer, a PDA (personal digital assistant), a PAD (tablet computer), a desktop computer and the like. Figure 6 The electronic device shown in FIG. 1 is only an example, and should not bring any limitation to the function and use range of the embodiment of the application.

[0163] As Figure 6 shown in FIG. 1, the electronic device can include a processing device (for example, a central processing unit, a graphics processing unit and the like) 601, which can perform various appropriate actions and processes according to the program stored in a read-only memory (ROM) 602 or the program loaded from a storage device 608 into a random access memory (RAM) 603. In the state that the electronic device is powered on, the RAM 603 also stores various programs and data required for the operation of the electronic device. The processing device 601, the ROM 602 and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0164] In general, the following devices can be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, and the like; storage devices 608 including, for example, a memory card, a hard disk, and the like; and communication devices 609. The communication devices 609 can allow the electronic device to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 Electronic devices having various devices are shown, but it is understood that all of the shown devices are not required to be implemented or present. More or less devices can alternatively be implemented or present.

[0165] The embodiments of the present application also provide a computer program product comprising computer readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the risk identification methods provided by the embodiments of the present application.

[0166] The embodiments of the present application also provide a computer readable storage medium carrying one or more computer programs, which, when executed by an electronic device, can cause the electronic device to implement any of the risk identification methods provided by the embodiments of the present application.

[0167] In addition, it should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e. they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiments according to actual needs. In addition, the connection relationship between the modules in the device embodiments provided by the present application indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines.

[0168] Those skilled in the art can clearly understand that the application can be implemented by means of software plus necessary universal hardware, of course, also can be implemented by special hardware including special integrated circuit, special CPU, special memory, special component, etc. Generally, the functions completed by computer program can be easily implemented by corresponding hardware, and the specific hardware structure for implementing the same function can be various, such as analog circuit, digital circuit or special circuit, etc. However, for the application, the software program implementation is the better embodiment. Based on such understanding, the technical solutions of the application can be embodied in the form of software product, which is stored in a readable storage medium, such as a floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk, etc., including a plurality of instructions for making a computer device (which can be a personal computer, a training device, or a network device, etc.) execute the methods described in various embodiments of the application.

[0169] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product.

[0170] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another, for example, the computer instructions can be transmitted from one website, computer, training device or data center to another website, computer, training device or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be stored by a computer or a data storage device such as a training device, a data center, etc. integrated with one or more available media sets. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.

Claims

1. A risk identification method, characterized in that, include: Obtain feature data of the target user's target knowledge graph; The feature data is input into a pre-trained risk identification model to obtain the risk identification result output by the risk identification model. The risk identification model sequentially includes a multi-head attention model and a classification model. The multi-head attention model includes multiple attention heads in parallel. Each attention head is composed of a spatial attention network and a channel attention network connected sequentially. The risk identification model is pre-trained based on sample feature data and risk labels from a sample knowledge graph. The risk labels are used to indicate whether there is a risk of the target risk type.

2. The risk identification method according to claim 1, characterized in that, The acquisition of feature data of the target user's target knowledge graph includes: Based on the user data of the target users, a user knowledge graph is constructed; Extract the subgraph of the user knowledge graph corresponding to the target time window, and use it as the target knowledge graph. The target time window is determined based on the target risk type. Based on a pre-trained graph neural network, feature data of the target knowledge graph is extracted. The feature data includes embedded feature vectors of multiple target feature types, which are determined based on the target risk type.

3. The risk identification method according to claim 2, characterized in that, The construction of a user knowledge graph based on the user data of the target user includes: Acquire user data of the target user, including traditional financial data and non-traditional financial data; For the structured data in the user data, candidate fact triples are extracted from the structured data based on key fields; For the semi-structured data in the user data, candidate fact triples of the semi-structured data are extracted using a preset rule template; For unstructured data in the user data, candidate fact triples of unstructured data are extracted based on a bidirectional long short-term memory network; After performing entity alignment, entity disambiguation, and conflict relationship identification on the candidate triple set, a target triple set is obtained. The candidate triple set includes all the candidate fact triples, and the target triple set includes multiple target fact triples. Construct a user knowledge graph of the target user based on the target triple set.

4. The risk identification method according to claim 1, characterized in that, The multi-head attention model further includes a linear mapping module and a fusion module. The output of the linear mapping module is connected to the input of the spatial attention network and the channel attention network in each attention head, respectively. The output of the spatial attention network in each attention head is connected to the input of the corresponding channel attention network and the input of the fusion module, respectively.

5. The risk identification method according to claim 4, characterized in that, The step of inputting the feature data into a pre-trained risk identification model to obtain the risk identification result output by the risk identification model includes: The feature data is input into the risk identification model; The linear transformation module maps the feature data to three different subspaces through three independent linear layers to obtain query features, key features, and value features. The query features, key features, and value features are then split according to the number of attention heads to obtain the original feature map of each attention head. The original feature map of the attention head is input into the attention head. For each attention head, a spatial attention map of the original feature map is generated through a spatial attention network. The spatial attention map is multiplied element-wise with the original feature map to obtain a spatial feature map. A channel attention map of the spatial feature map is generated through a channel attention network. The channel attention map is multiplied element-wise with the spatial feature map to obtain a channel feature map. The channel feature map of each attention head is input into the fusion module, which then splices the channel feature maps of each attention head to obtain the target feature map. The target feature map is input into the classification model so that the classification model outputs a risk prediction result.

6. A risk identification device, characterized in that, include: The feature extraction unit is used to obtain feature data of the target user's target knowledge graph. A risk identification unit is used to input the feature data into a pre-trained risk identification model to obtain the risk identification result output by the risk identification model; The risk identification model sequentially includes a multi-head attention model and a classification model. The multi-head attention model includes multiple attention heads in parallel, which are composed of spatial attention networks and channel attention networks connected sequentially.

7. The risk identification device according to claim 6, characterized in that, The feature extraction unit includes: The graph construction unit is used to construct a user knowledge graph based on the user data of the target user. The graph extraction unit is used to extract the subgraphs of the user knowledge graph corresponding to the target time window, and use them as the target knowledge graph. The feature embedding unit is used to extract feature data of the target knowledge graph based on a pre-trained graph neural network. The feature data includes embedded feature vectors of multiple target feature types, which are determined based on the target risk type.

8. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the risk identification method as described in any one of claims 1 to 5.

9. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the risk identification method as described in any one of claims 1 to 5.

10. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the risk identification method as described in any one of claims 1 to 5.