A loan overdue prediction method and system based on a prototype network

CN122966360APending Publication Date: 2026-10-23QIXIN TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611453539.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-18
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

但现有技术仍存在以下难以解决的技术问题:其一,对标注逾期样本依赖度高

Benefits of technology

[0038]经由上述的技术方案可知,与现有技术相比,本发明的有益效果至少包括:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122966360A_ABST
    Figure CN122966360A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of machine learning cross, and particularly discloses a loan overdue prediction method and system based on a prototype network. The application acquires post-loan management relationship data of a loan institution, constructs a heterogeneous graph containing user nodes and post-loan management nodes; extracts graph structure embedding through a heterogeneous graph attention network, combines post-loan management behavior time sequence features extracted by a long short-term memory network, splices to generate enhanced node embedding; adopts an Episode training paradigm to simulate a training model, calculates class prototypes of overdue and normal categories based on support set samples; calculates the cosine distance between target node embedding and the class prototypes during prediction, and outputs an overdue risk probability. The application can realize effective prediction only by using a small amount of labeled overdue samples, is suitable for an overdue sample scarce scene, and improves the overdue risk identification precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine learning technology, and more specifically to a method and system for predicting loan delinquency based on prototype networks. Background Technology

[0002] Currently, with the continuous expansion of consumer credit business, loan delinquency risk prediction has become a core component of financial institutions' risk control systems. Traditional credit scoring models rely on structured data such as users' finances and assets, using independent individuals as the unit of analysis. This approach has drawbacks such as limited information dimensions, insufficient coverage of users without credit records, and difficulty in identifying information fraud.

[0003] In recent years, graph neural networks (GNNs) have been introduced into the financial risk control field due to their powerful relationship modeling capabilities. They aggregate neighborhood information by constructing user relationship networks to improve risk prediction. However, existing technologies still face the following intractable technical problems: First, they are highly dependent on labeled overdue samples. In actual business operations, the proportion of positive overdue samples is usually less than 5%, resulting in a significant sample imbalance problem. Existing supervised graph neural networks require a large number of labeled samples to learn effective node representations, leading to a substantial decrease in the model's discriminative ability. Second, the model's generalization ability is limited. Supervised models are prone to overfitting to specific label distributions. When business scenarios and user groups change, model performance degrades significantly, and retraining requires substantial labeling and time costs. Third, there is a lack of effective discrimination mechanisms. When overdue samples are extremely scarce, existing models cannot learn class boundaries with discriminative power, resulting in a high false negative rate for overdue users, which fails to meet risk control requirements.

[0004] Therefore, how to fully explore the structure and time series information of post-loan management relationship data under the condition of scarce overdue sample data, and achieve high-precision prediction of loan overdue risk, is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] In view of the above problems, the present invention is proposed to provide a method and system for predicting loan delinquency based on a prototype network to overcome or at least partially solve the above problems.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] In a first aspect, the present invention relates to a method for predicting loan delinquency based on a prototype network, comprising the following steps: S1. Obtain post-loan management relationship data of lending institutions.

[0008] S2. Construct a heterogeneous graph based on post-loan management relationship data. The heterogeneous graph contains nodes and edges. The nodes include user nodes and post-loan management nodes, and the edges correspond to the post-loan management relationships between nodes.

[0009] S3. For each user node, extract the time series of post-loan management behavior within a preset time window, input the time series of post-loan management behavior into the long short-term memory network encoder, and output the time series feature vector of each user node.

[0010] S4. Input the heterogeneous graph into the heterogeneous graph attention network encoder, encode each node in the heterogeneous graph, and output the graph structure embedding vector corresponding to each user node.

[0011] S5. Concatenate and fuse the graph structure embedding vector and temporal feature vector corresponding to each user node to generate an enhanced node embedding representation.

[0012] S6. Obtain labeled samples containing overdue and normal categories. Sample a preset number of labeled samples from each category to form a support set. Sample another preset number of labeled samples to form a query set. The support set and query set samples do not overlap. Calculate the overdue category prototype and normal category prototype using the augmented node embedding representation of each labeled sample in the support set. Calculate the loss function using the classification results of each labeled sample in the query set and update the parameters of the feature encoding model.

[0013] S7. After the feature encoding model training converges, for the target user node, calculate the cosine distance between the enhanced node embedding representation and the overdue category prototype and the normal category prototype, respectively, and output the overdue risk probability of the target user node based on the cosine distance.

[0014] Preferably, the time series of post-loan management behavior in S3 includes at least one of the following: post-loan management frequency series, post-loan management frequency series, and average post-loan management duration series.

[0015] Preferably, in S4, the heterogeneous graph attention network uses a type-aware attention mechanism to calculate the attention weights of neighboring nodes when aggregating features of heterogeneous neighbor nodes. The calculation formula is as follows:

[0016] Where r represents the relation type of the edge, a r and W r The learnable parameters represent the relation types of the edges. h v Represents user node v eigenvectors, h u Indicates the target user node u eigenvectors, This represents a vector concatenation operation. This represents the activation function in deep learning. This indicates normalization, and T indicates transpose operation.

[0017] Preferably, the category prototype in S6 It is calculated by taking the mean of the augmented node embedding representations of the support set samples, and the calculation formula is:

[0018] in, Indicate category k The set of labeled samples, Indicate category k The number of samples, f θ (v ) represents a user node v Embedded vector, Indicates the category of user node v. f θ This represents a parameterized graph neural network encoder.

[0019] Preferably, in S7, the target user node u Enhanced node embedding representation z u With category prototype c k The formula for calculating the cosine distance is:

[0020] Where sim( , ) represents the cosine similarity function. Represents vector z u and c k dot product, The L2 norm of a vector is used to represent the vector's L2 norm.

[0021] Target user node u The probability of belonging to category k is expressed as:

[0022] in, Represents all possible categories, Let represent the cosine distance function, and exp() represent the natural exponential function.

[0023] Preferably, in S6, the feature encoding model is trained using the Episode training paradigm. Specifically, each training Episode samples N category prototypes from the training set containing historical user nodes with overdue category labels, corresponding to overdue category prototypes and normal category prototypes.

[0024] For each category, K labeled samples are sampled from the prototype to form the support set; Q labeled samples are sampled from the prototype to form the query set, and the support set and query set samples do not overlap.

[0025] Based on the support set, overdue category prototypes and normal category prototypes are calculated. Classification prediction is then performed on the query set samples, using the negative log-likelihood loss on the query set as the training loss. The calculation formula is as follows:

[0026] in, Indicates the first i The actual labels of each query sample Indicates the first i Augmented node embedding representation of a query sample The model predicts the first... i Each query sample belongs to its true category y i The probability of.

[0027] Preferably, the post-loan management relationship data includes at least the post-loan management party ID, user ID, post-loan management start time, and post-loan management duration.

[0028] The number of overdue category samples in the training set does not exceed 10% of the number of normal category samples.

[0029] Secondly, the present invention also relates to a loan delinquency prediction system based on a prototype network, comprising: Heterogeneous graph construction module: used to obtain post-loan management relationship data of lending institutions and construct heterogeneous graphs based on the post-loan management relationship data.

[0030] The graph neural network encoding module is used to input heterogeneous graphs into the heterogeneous graph attention network encoder, encode each node in the heterogeneous graph, and output the graph structure embedding vector corresponding to each user node.

[0031] Temporal feature extraction module: used to extract the time series of post-loan management behavior within a preset time window of user nodes. By inputting a long short-term memory network encoder, it outputs the temporal feature vector of each user node.

[0032] Feature fusion module: It receives the graph structure embedding vector and temporal feature vector corresponding to the user node, performs a splicing and fusion operation, and outputs the enhanced node embedding representation.

[0033] Prototype Calculation Module: This module receives the augmented node embedding representations of labeled samples and uses these representations to calculate the overdue category prototype and the normal category prototype, respectively.

[0034] Prediction output module: used to calculate the cosine distance between the enhanced node embedding representation and the overdue category prototype and the normal category prototype, respectively, and output the overdue risk probability of the target user node based on the cosine distance.

[0035] Preferred options also include: Sample sampling module: Used to obtain labeled samples and generate support sets and query sets by sampling according to the Episode paradigm.

[0036] Loss calculation module: used to calculate negative log-likelihood loss based on the classification results of the query set.

[0037] Parameter update module: used to update the learnable parameters of the encoder based on backpropagation of the loss function.

[0038] As can be seen from the above technical solutions, compared with the prior art, the beneficial effects of the present invention include at least the following: ① This invention is a few-shot learning framework based on prototype networks. It only requires a small number of labeled samples to calculate the effective category prototypes, without the need for a large amount of overdue labeled data. It is perfectly adapted to the scenario where overdue samples are extremely scarce in actual business, and greatly reduces the cost of data labeling.

[0039] ② The prototype network independently calculates the prototype category for each category, unaffected by the difference in the number of samples between categories; even if the proportion of overdue samples is extremely low, it can still generate a valid overdue category prototype, which solves the model bias problem caused by sample imbalance from the mechanism level and avoids the model tilting towards the majority class.

[0040] ③ Through the Episode training paradigm, the model simulates a few-shot classification task during the training phase and learns meta-learning capabilities; when the business scenario or user group changes, only a small number of new scenario labeled samples are needed to update the category prototype, without the need to retrain the model with all samples, and the scenario adaptation efficiency is greatly improved. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0042] Figure 1 This is a flowchart of a loan delinquency prediction method for a prototype network provided in an embodiment of the present invention. Detailed Implementation

[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0044] This invention discloses a method for predicting loan delinquency based on a prototype network, comprising the following steps: S1. Obtain post-loan management relationship data of lending institutions.

[0045] Post-loan management relationship data should include at least the post-loan management party ID, user ID, post-loan management start time, and post-loan management duration.

[0046] S2. Construct a heterogeneous graph based on post-loan management relationship data. The heterogeneous graph contains nodes and edges. The nodes include user nodes and post-loan management nodes, and the edges correspond to the post-loan management relationships between nodes.

[0047] Post-loan management nodes should include at least the lending institution's salesperson or a third-party institution.

[0048] S3. For each user node, extract the time series of post-loan management behavior within a preset time window, input the time series of post-loan management behavior into the long short-term memory network encoder, and output the time series feature vector of each user node.

[0049] The time series of post-loan management behavior in S3 includes at least one of the following: the post-loan management frequency series, the post-loan management frequency series, and the average post-loan management duration series.

[0050] S4. Input the heterogeneous graph into the heterogeneous graph attention network encoder, encode each node in the heterogeneous graph, and output the graph structure embedding vector corresponding to each user node.

[0051] In S4, the heterogeneous graph attention network uses a type-aware attention mechanism to calculate the attention weights of neighboring nodes when aggregating features of heterogeneous neighbor nodes. The calculation formula is as follows:

[0052] Where r represents the relation type of the edge. a r and W r The learnable parameters represent the relation types of the edges. h v Represents user node v eigenvectors, h u Indicates the target user node u eigenvectors, This represents a vector concatenation operation. This represents the activation function in deep learning. This indicates normalization, and T indicates transpose operation.

[0053] S5. Concatenate and fuse the graph structure embedding vector and temporal feature vector corresponding to each user node to generate an enhanced node embedding representation.

[0054] S6. Obtain labeled samples containing overdue and normal categories. Sample a preset number of labeled samples from each category to form a support set. Sample another preset number of labeled samples to form a query set. The support set and query set samples do not overlap. Calculate the overdue category prototype and normal category prototype using the augmented node embedding representation of each labeled sample in the support set. Calculate the loss function using the classification results of each labeled sample in the query set and update the parameters of the feature encoding model.

[0055] Category prototypes in S6 It is calculated by taking the mean of the augmented node embedding representations of the support set samples, and the calculation formula is:

[0056] in, Indicate category k The set of labeled samples, Indicate category k The number of samples, f θ (v ) represents a user node v Embedded vector, Represents user node v Category f θ This represents a parameterized graph neural network encoder.

[0057] S6 uses the Episode training paradigm to train the feature encoding model. Specifically, each training Episode samples N category prototypes from the training set containing historical user nodes with overdue category labels, corresponding to overdue category prototypes and normal category prototypes.

[0058] For each category, K labeled samples are sampled from the prototype to form the support set; Q labeled samples are sampled from the prototype to form the query set, and the support set and query set samples do not overlap.

[0059] Based on the support set, overdue category prototypes and normal category prototypes are calculated. Classification prediction is then performed on the query set samples, using the negative log-likelihood loss on the query set as the training loss. The calculation formula is as follows:

[0060] in, Indicates the first i The actual labels of each query sample This represents the augmented node embedding representation of the i-th query sample. This indicates that the model predicts the i-th query sample belongs to its true class y. i The probability of.

[0061] The number of overdue category samples in the training set does not exceed 10% of the number of normal category samples.

[0062] S7. After the feature encoding model training converges, for the target user node, calculate the cosine distance between the enhanced node embedding representation and the overdue category prototype and the normal category prototype, respectively, and output the overdue risk probability of the target user node based on the cosine distance.

[0063] In S7, the target user node u Enhanced node embedding representation z u With category prototype c k The formula for calculating the cosine distance is:

[0064] Where sim( , ) represents the cosine similarity function. Represents vector z u and c k dot product, The L2 norm of a vector is used to represent the vector's L2 norm.

[0065] Target user node u The probability of belonging to category k is expressed as:

[0066] in, Represents all possible categories, Let represent the cosine distance function, and exp() represent the natural exponential function.

[0067] This invention also discloses a loan delinquency prediction system based on a prototype network, comprising: Heterogeneous graph construction module: used to obtain post-loan management relationship data of lending institutions and construct heterogeneous graphs based on the post-loan management relationship data.

[0068] The graph neural network encoding module is used to input heterogeneous graphs into the heterogeneous graph attention network encoder, encode each node in the heterogeneous graph, and output the graph structure embedding vector corresponding to each user node.

[0069] Temporal feature extraction module: used to extract the time series of post-loan management behavior within a preset time window of user nodes. By inputting a long short-term memory network encoder, it outputs the temporal feature vector of each user node.

[0070] Feature fusion module: It receives the graph structure embedding vector and temporal feature vector corresponding to the user node, performs a splicing and fusion operation, and outputs the enhanced node embedding representation.

[0071] Prototype Calculation Module: This module receives the augmented node embedding representations of labeled samples and uses these representations to calculate the overdue category prototype and the normal category prototype, respectively.

[0072] Prediction output module: used to calculate the cosine distance between the enhanced node embedding representation and the overdue category prototype and the normal category prototype, respectively, and output the overdue risk probability of the target user node based on the cosine distance.

[0073] Also includes: Sample sampling module: Used to obtain labeled samples and generate support sets and query sets by sampling according to the Episode paradigm.

[0074] Loss calculation module: used to calculate negative log-likelihood loss based on the classification results of the query set.

[0075] Parameter update module: used to update the learnable parameters of the encoder based on backpropagation of the loss function.

[0076] The technical solution of the present invention will be described in detail through specific embodiments.

[0077] This invention proposes a loan delinquency prediction method based on prototype networks. The core idea is to construct a heterogeneous graph from the massive communication records of telecommunications operators, and map each node in the graph to an embedding vector using a graph neural network encoder. In the embedding space, a very small number of delinquent samples (e.g., 5-10 per class) are used to calculate "delinquent prototypes" and "normal prototypes." New users are classified and predicted by calculating the distance between their embedding vectors and the two prototype classes. The entire method employs an Episode training paradigm, simulating small-sample scenarios for model training, enabling the model to quickly adapt to new classification tasks with only a small number of labeled samples.

[0078] 1. Heterogeneous graph construction Retrieve post-loan management relationship data, with core fields including: post-loan management party ID, user ID, post-loan management start time, and post-loan management duration. Based on this, construct a heterogeneous graph H=(V,E,A,R): Heterogeneous nodes: V contains two types of nodes: v u (User's mobile phone number) and v s (Post-loan management service provider number). Node attribute A v It includes static features such as the location of the number (discrete attribute, using one-hot encoding) and the duration of network access (continuous attribute, using maximum-minimum normalization).

[0079] Heterogeneous edge: edge e = (v i ,v j ,r) indicates from v i to v jThe r-type post-loan management relationship. Edge characteristic A. e This includes communication duration, number of calls, etc. The edge relationship type R includes two categories: user-to-user calls and user-to-loan management service provider number calls.

[0080] 2. Graph Neural Network Encoder The encoder employs a heterogeneous graph attention network, which encodes each node in the heterogeneous graph as a fixed-dimensional embedding vector.

[0081] A type-aware attention mechanism is used when aggregating heterogeneous neighbor nodes:

[0082] Where r is the relation type of the edge. a r and W r h is the learnable parameter corresponding to relation type r. v and h u is the node feature vector, and ⊕ is the vector concatenation operation.

[0083] The encoder outputs the embedding representation z of each node. v = f θ (v), where f θ A parameterized graph neural network encoder.

[0084] 3. Temporal Feature Fusion For each user node v, extract its post-loan management behavior time series X within a preset time window. v ={x1,x2,...,x T The time series includes at least one of the following: post-loan management frequency series, post-loan management frequency series, and average post-loan management duration series.

[0085] Time series X v Inputting the Long Short-Term Memory (LSTM) network encoder yields temporal feature vectors.

[0086] Time series feature vectors The output of the graph neural network encoder The nodes are concatenated to form an enhanced node embedding representation:

[0087] 4. Prototype Calculation In the embedding space, for a category k ∈ {overdue, normal}, the category prototype is calculated using the embedding vectors of a small number of labeled samples in that category:

[0088] in, This is the set of labeled samples (support set) for category k. The number of samples in this category. f θ (v) is a node v The embedding vector. Support set S k Number of samples in the overdue category k The value ranges from 5 to 10, and the number of samples in the overdue category does not exceed 10% of the number of samples in the normal category.

[0089] 5. Distance Measurement and Classification For the target user node u, calculate its embedding vector z. u = f θ (u) with each category prototype c k Distance:

[0090] Where sim( , ) is the cosine similarity function.

[0091] The probability that the target user belongs to category k is:

[0092] When p(y=overdue|z) u If the value exceeds a preset threshold, the user is deemed to have a risk of overdue payment.

[0093] 6. Episode Training Paradigm The model uses an episode training paradigm, with each training episode simulating a few-shot classification scenario: N categories (N-way) are randomly sampled from the training set, where N is 2 (i.e., overdue and normal categories). K labeled samples are sampled from each category to form a support set, which is used to calculate the prototype. The value of K is between 5 and 10. A query set is formed by sampling Q different samples from the same category, and the value of Q is between 10 and 20. The model calculates a prototype based on the support set, then classifies the query set, calculates the classification loss, and updates the parameters.

[0094] Through training with a large number of episodes, the model learns to quickly adapt to new classification tasks with only a small number of labeled samples.

[0095] The training loss function is the negative log-likelihood loss on the query set:

[0096] in, Let be the true label of the i-th query sample.

[0097] Example 1 This embodiment provides a complete method for predicting loan delinquency based on a prototype network.

[0098] S1. Data Preparation and Preprocessing We retrieved 12 months of post-loan management relationship data from a telecommunications operator. Key fields included: caller ID, called ID, call start time, and call duration. We also retrieved loan repayment records matching some of the phone numbers as tag data (overdue for more than 30 days was marked as 1, otherwise 0). The data was then cleaned to remove non-standard numbers such as test numbers and customer service numbers.

[0099] The data from the first nine months was used as the training period, and the data from the last three months was used as the testing period. During the training period, overdue samples accounted for only 3% of the total samples, simulating a scenario where overdue samples are extremely scarce in real-world business.

[0100] S2, Constructing a heterogeneous graph A heterogeneous graph was constructed from the 9 months of training data: Nodes: All user mobile phone numbers and post-loan management service provider numbers appearing in the communication records. Initial node features include the number's location (one-hot encoded, encoded as a 10-dimensional vector), network access duration (maximum-minimum normalized, mapped to the [0,1] interval), etc.

[0101] Edges: If there is a call record between two users, a bidirectional edge of type "user call" is established; if there is a call record between a user and the post-loan management service provider's number, a directed edge from the post-loan management service provider's number to the user is established, of type "post-loan management call". Edge features are initialized as total call duration and number of calls.

[0102] S3, Graph Neural Network Encoding Input the heterogeneous graph into the heterogeneous graph attention network encoder. The encoder configuration is as follows: Heterogeneous graph attention layer: 2 layers, with each layer having a hidden dimension of 128.

[0103] Node-level attention: For each relation type r (“user call” and “post-loan management call”), independently calculate the attention weight α. vu r .

[0104] Activation function: LeakyReLU (negative slope 0.2).

[0105] Discard rate: 0.3%.

[0106] The encoder maps each node to a 128-dimensional embedding vector z. v = f θ (v).

[0107] S4, Episode Training The model is trained using the Episode training paradigm. Each Episode is constructed as follows: N-way settings: N=2 (two categories: overdue and normal).

[0108] K-shot settings: K=5 (5 labeled samples are sampled for each category to form the support set).

[0109] Query set size: 10 samples are sampled from each category to form the query set.

[0110] The specific execution process for each episode: S4.1, Sampling Support Set and Query Set Two categories (overdue and normal) are randomly sampled from the training set, and five samples are randomly sampled from the labeled samples of each category to form the support set S. k (k=1,2), then randomly sample 10 samples from the samples that were never selected into the support set to form the query set Q. k .

[0111] S4.2 Calculation Prototype The encoder fθ will support inputting all samples into the support set, yielding the embedding vector for each sample. For each category, its category prototype will be computed:

[0112]

[0113] S4.3 Classification and Loss Calculation Each sample in the query set is input into the encoder to obtain the embedding vector. z i .calculate z i Cosine similarity with the prototypes of the two categories:

[0114]

[0115] Calculate the probability that this sample belongs to the overdue category:

[0116] Calculate the negative log-likelihood loss:

[0117] S4.4, Adam optimizer, updates encoder parameters θ based on the Episode loss function. The learning rate is set to 0.001.

[0118] Repeat steps S4.1-S4.4 to train 20,000 episodes until the model converges.

[0119] S5. Overdue Risk Prediction The test-period data is used to construct a heterogeneous graph, which is then input into the trained encoder. f θ This yields the embedding vector for each user.

[0120] S5.1 Building a Test Prototype The final class prototype is calculated using all labeled samples in the training set (or a mini-batch of labeled samples provided at test time):

[0121]

[0122] S5.2, Prediction For each user u in the test set, calculate their delinquency probability:

[0123] When p u If the value is greater than 0.5, it is predicted that the user is at risk of default.

[0124] Example 2 Based on Embodiment 1, this embodiment also includes a temporal feature extraction module to further enrich the representation of user nodes.

[0125] Step A: Extracting temporal features For each user node v, extract the following behavior sequence for each week during the training period: Active call count sequence: X1={x1 1 x2 1 ,...,x T 1} Call count sequence: X2={x1} 2 x2 2 ,...,x T 2} Average call duration sequence: X3={x1} 3 x2 3 ,...,x T 3} Where T is the total number of weeks (in this example, T=36).

[0126] Step B, Timing Coding The above three sequences are concatenated into a multidimensional time series X. v =[X1,X2,X3] T Input to the Long Short-Term Memory (LSTM) encoder:

[0127] Obtain the time series feature vector h v seq (Dimension 64).

[0128] Step C, Feature Fusion Embed the graph structure output by the graph neural network encoder into z v graph (Dimension 128) and temporal features h v seq (Dimension 64) is stitched together:

[0129] The enhanced node embedding representation z is obtained. v (Dimension 192).

[0130] Step D, Prototype Calculation In the embedding space, for a category k ∈ {overdue, normal}, the category prototype is calculated using the embedding vectors of a small number of labeled samples in that category:

[0131] in, This is the set of labeled samples (support set) for category k. The number of samples in this category. f θ (v) is a node v The embedding vector. Support set S k Number of samples in the overdue category k The value ranges from 5 to 10, and the number of samples in the overdue category does not exceed 10% of the number of samples in the normal category.

[0132] Step E: Distance Measurement and Classification For the target user node u, calculate its embedding vector z. u = f θ (u) with each category prototype c k Distance:

[0133] Where sim( , ) is the cosine similarity function.

[0134] The probability that the target user belongs to category k is:

[0135] When p(y=overdue|z) u If the value exceeds a preset threshold, the user is deemed to have a risk of overdue payment.

[0136] Step F, Episode Training Paradigm The model uses an episode training paradigm, with each training episode simulating a few-shot classification scenario: N categories (N-way) are randomly sampled from the training set, where N is 2 (i.e., overdue and normal categories). K labeled samples are sampled from each category to form a support set, which is used to calculate the prototype. The value of K is between 5 and 10. A query set is formed by sampling Q different samples from the same category, and the value of Q is between 10 and 20. The model calculates a prototype based on the support set, then classifies the query set, calculates the classification loss, and updates the parameters.

[0137] Through training with a large number of episodes, the model learns to quickly adapt to new classification tasks with only a small number of labeled samples.

[0138] The training loss function is the negative log-likelihood loss on the query set:

[0139] in, Let be the true label of the i-th query sample.

[0140] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0141] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for predicting loan delinquency based on prototype networks, characterized in that, Includes the following steps: S1. Obtain post-loan management relationship data of lending institutions; S2. Construct a heterogeneous graph based on post-loan management relationship data. The heterogeneous graph contains nodes and edges. The nodes include user nodes and post-loan management nodes, and the edges correspond to the post-loan management relationships between nodes. S3. For each user node, extract the time series of post-loan management behavior within a preset time window, input the time series of post-loan management behavior into the long short-term memory network encoder, and output the time series feature vector of each user node. S4. Input the heterogeneous graph into the heterogeneous graph attention network encoder, encode each node in the heterogeneous graph, and output the graph structure embedding vector corresponding to each user node. S5. Concatenate and fuse the graph structure embedding vector and temporal feature vector corresponding to each user node to generate an enhanced node embedding representation. S6. Obtain labeled samples containing overdue and normal categories. Sample a preset number of labeled samples from each category to form a support set. Sample another preset number of labeled samples to form a query set. The support set and query set samples do not overlap. Calculate the overdue category prototype and normal category prototype using the augmented node embedding representation of each labeled sample in the support set. Calculate the loss function using the classification results of each labeled sample in the query set and update the parameters of the feature encoding model. S7. After the feature encoding model training converges, for the target user node, calculate the cosine distance between the enhanced node embedding representation and the overdue category prototype and the normal category prototype, respectively, and output the overdue risk probability of the target user node based on the cosine distance.

2. The method for predicting loan delinquency based on a prototype network according to claim 1, characterized in that, The time series of post-loan management behavior in S3 includes at least one of the following: the post-loan management frequency series, the post-loan management frequency series, and the average post-loan management duration series.

3. The method for predicting loan delinquency based on a prototype network according to claim 1, characterized in that, In S4, the heterogeneous graph attention network uses a type-aware attention mechanism to calculate the attention weights of neighboring nodes when aggregating features of heterogeneous neighbor nodes. The calculation formula is as follows: Where r represents the relation type of the edge, a r and W r The learnable parameters represent the relation types of the edges. h v Represents user node v eigenvectors, h u Indicates the target user node u eigenvectors, This represents a vector concatenation operation. This represents the activation function in deep learning. This indicates normalization, and T indicates transpose operation.

4. The method for predicting loan delinquency based on a prototype network according to claim 1, characterized in that, Category prototypes in S6 The result is calculated by taking the mean of the augmented node embedding representations of the support set samples. The calculation formula is as follows: in, Indicates category k The set of labeled samples Indicates category k The number of samples, f θ (v ) represents a user node v Embedded vector, Indicates the category of user node v. f θ This represents a parameterized graph neural network encoder.

5. The method for predicting loan delinquency based on a prototype network according to claim 1, characterized in that, In S7, the target user node u Enhanced node embedding representation z u With category prototype c k The formula for calculating the cosine distance is: Where sim( , ) represents the cosine similarity function. Represents vector z u and c k dot product, The second norm of a vector; Target user node u The probability of belonging to category k is expressed as: in, Represents all possible categories, Let represent the cosine distance function, and exp() represent the natural exponential function.

6. The method for predicting loan delinquency based on a prototype network according to claim 1, characterized in that, Supports centralized training. In S6, the Episode training paradigm is used to train the feature encoding model. Specifically, each training Episode samples N category prototypes from the training set containing historical user nodes with overdue category labels, corresponding to overdue category prototypes and normal category prototypes. For each category, K labeled samples are sampled from the prototype to form the support set; Q labeled samples are sampled from the prototype to form the query set, and the support set and query set samples do not overlap. Based on the support set, overdue category prototypes and normal category prototypes are calculated. Classification prediction is then performed on the query set samples, using the negative log-likelihood loss on the query set as the training loss. The calculation formula is as follows: in, Indicates the first i The actual labels of each query sample This represents the augmented node embedding representation of the i-th query sample. The model predicts the first... i Each query sample belongs to its true category. y i The probability of.

7. The method for predicting loan delinquency based on a prototype network according to claim 1, characterized in that, Post-loan management relationship data should include at least the post-loan management party ID, user ID, post-loan management start time, and post-loan management duration.

8. The loan delinquency prediction method based on prototype networks according to claim 1, characterized in that, The number of overdue category samples in the training set does not exceed 10% of the number of normal category samples.

9. A loan delinquency prediction system based on a prototype network, employing the loan delinquency prediction method based on a prototype network as described in any one of claims 1-8, characterized in that, include: Heterogeneous graph construction module: used to obtain post-loan management relationship data of lending institutions and construct heterogeneous graphs based on the post-loan management relationship data; Graph Neural Network Encoding Module: This module is used to input heterogeneous graphs into the heterogeneous graph attention network encoder, encode each node in the heterogeneous graph, and output the graph structure embedding vector corresponding to each user node. Temporal feature extraction module: used to extract the time series of post-loan management behavior within a preset time window of user nodes. By inputting the Long Short-Term Memory network encoder, it outputs the temporal feature vector of each user node. Feature fusion module: Used to receive the graph structure embedding vector and temporal feature vector corresponding to the user node, perform concatenation and fusion operation, and output the enhanced node embedding representation; Prototype Calculation Module: Used to receive the augmented node embedding representation of labeled samples, and calculate the overdue category prototype and the normal category prototype using the augmented node embedding representation of each sample in the support set; Prediction output module: used to calculate the cosine distance between the enhanced node embedding representation and the overdue category prototype and the normal category prototype, respectively, and output the overdue risk probability of the target user node based on the cosine distance.

10. A loan delinquency prediction system based on a prototype network according to claim 9, characterized in that, Also includes: Sample sampling module: used to obtain labeled samples and generate support set and query set according to the Episode paradigm; Loss calculation module: used to calculate negative log-likelihood loss based on the classification results of the query set; Parameter update module: used to update the learnable parameters of the encoder based on backpropagation of the loss function.