Model training method, object classification method, device and electronic equipment
Patent Information
- Application Number
- CN202510439862.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]本申请实施例提供了一种模型训练方法、对象分类方法、装置、电子设备、计算机可读存储介质及计算机程序产品,用于解决现有技术对对象进行分类时,分类结果准确率低的技术问题
[0066]本申请实施例,考虑到了目标对象与各个第一对象的资源转移行为描述了目标对象的静态交互关系,目标对象与各个第二对象的资源转移行为描述了目标对象的动态交互关系,因此在获取目标对象的对象相关数据时,获取目标对象与各个第一对象的资源转移行为对应的资源转移相关数据而不获取对应的时间信息,用于防止时间信息对静态交互数据的产生的噪声影响,获取目标对象与各个第二对象的资源转移行为对应的资源转移相关数据时,获取对应的时间信息,用于得到资源转移数据与时间的关联性,增强对时序信息的利用;基于训练后的对象分类模型,对将目标对象的静态交互关系对应的第一特征表示和动态交互关系对应的第二特征表示进行融合,获得目标用户的类型预测结果,该预测过程利用了目标对象的静态交互关系和静态交互关系,提高了确定样本对象类型的准确性。
Smart Images

Figure CN122926064A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of artificial intelligence and information processing technology. Specifically, this application relates to a model training method, an object classification method, an apparatus, an electronic device, a computer-readable storage medium, and a product. Background Technology
[0002] Before approving a user's resource request, a resource management platform needs to accurately determine whether the user will default on resource returns. This is crucial for reducing the platform's risk and losses. Currently, most resource management platforms rely on relevant user data to predict the likelihood of default and then decide whether to approve the user's resource request based on this prediction.
[0003] However, existing forecasting methods do not fully consider the correlation between time information and different data when making forecasts based on user-related data, resulting in low accuracy of forecast results. Therefore, further improvements are needed to enhance the accuracy of forecasts and the correctness of decisions. Summary of the Invention
[0004] This application provides a model training method, an object classification method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product to solve the technical problem of low accuracy in classification results when classifying objects in the prior art.
[0005] According to a first aspect of the embodiments of this application, an object classification method is provided, the method comprising:
[0006] Acquire object-related data of the target object, including attribute information, first transaction information, and second transaction information of the target object. The first transaction information includes attribute information of a first object that has a resource transfer relationship with the target object, and resource transfer-related data of the resource transfer relationship. The second transaction information includes attribute information of a second object that has a resource transfer relationship with the target object, the occurrence time of the resource transfer relationship, and resource transfer-related data. Specifically, for the resource transfer relationship between the target object and the first object, the target object is either the resource spender or the recipient; for the resource transfer relationship between the target object and the second object, the target object is only the resource spender.
[0007] Based on the object-related data, a trained object classification model is used to classify the target object, resulting in a type prediction result. This type prediction result characterizes the resource expenditure capacity of the target object. The classification operation includes:
[0008] Feature extraction is performed on the attribute information and first transaction information of the target object to obtain a first feature representation of the target object; feature extraction is performed on the attribute information and second transaction information of the target object to obtain a second feature representation of the target object.
[0009] The first feature representation of the target object is fused with the second feature representation of the target object to obtain the target feature representation of the target object. Based on the target feature representation of the target object, a prediction is made to obtain the type prediction result.
[0010] As an optional embodiment, the first feature representation and the second feature representation are fused to obtain the target feature representation of the target object, including:
[0011] Obtain the first weight corresponding to the first feature representation and the second weight corresponding to the second feature representation; wherein, the first weight and the second weight are obtained through training;
[0012] Based on the first weight and the second weight, the first feature representation and the second feature representation are weighted and fused to obtain the target feature representation of the target object.
[0013] According to a second aspect of the embodiments of this application, a model training method is provided, the method comprising:
[0014] Multiple labeled training samples are obtained. Each training sample includes attribute information of a sample object, first transaction information, and second transaction information. The first transaction information includes attribute information of a first object that has a resource transfer behavior with the sample object, and resource transfer-related data of the resource transfer behavior. The second transaction information includes attribute information of a second object that has a resource transfer behavior with the sample object, the occurrence time of the resource transfer behavior, and resource transfer-related data. The label of each training sample represents the resource expenditure capacity of the sample object corresponding to the training sample.
[0015] The neural network model is continuously trained based on the multiple training samples until a preset training termination condition is met, resulting in a trained object classification model; the training operations include:
[0016] For each training sample, feature extraction is performed on the attribute information and first transaction information of the sample object in the training sample to obtain a first feature representation of the sample object; feature extraction is performed on the attribute information and second transaction information of the sample object in the training sample to obtain a second feature representation of the sample object; the first feature representation and the second feature representation are fused to obtain a target feature representation of the sample object; prediction is performed based on the target feature representation to obtain a type prediction result of the sample object;
[0017] Based on the label and type prediction results corresponding to each training sample, the training loss is determined, and the model parameters of the neural network model are adjusted according to the training loss.
[0018] As an optional embodiment, for each training sample, the determination time of the object type of the sample object is also included, the number of second objects of the sample object is a first preset number, and the behavior corresponding to each second object occurs before the determination time of the object type of the sample object;
[0019] For each training sample, the step of extracting features from the attribute information and second transaction information of the sample object in the training sample to obtain the second feature representation of the sample object includes:
[0020] The attribute information of the sample object is used to extract features, resulting in the feature vector of the sample object;
[0021] For each second object of the sample object, feature extraction is performed on the second transaction information corresponding to the second object to obtain the feature vector of the sample object corresponding to the second object.
[0022] Based on the correlation between the feature vector of the sample object and the feature vectors of each corresponding second object, the weight of each second object with respect to the sample object is determined.
[0023] Based on the weights of each second object relative to the sample object, the feature vectors of the sample object corresponding to the second object are weighted and fused to obtain the second feature representation of the sample object.
[0024] As an optional embodiment, for each sample object, the first preset number of second objects corresponding to that sample object are determined in the following way:
[0025] A first graph structure is constructed, which includes multiple first nodes and multiple second nodes. Each first node represents a sample object, and each second node represents a third object that has a resource transfer behavior with at least one sample object. For the resource transfer behavior between a sample object and a third object, the sample object is only the resource provider. There are edges between the nodes corresponding to the sample object and the third object that have resource transfer behavior. Each first node and each edge in the first graph structure has its own timestamp. The timestamp of the first node indicates the time when the object type of the corresponding sample object is determined, and the timestamp of the edge indicates the time when the behavior of the two nodes connected by the edge occurs.
[0026] For each sample object, based on the timestamp of the first node corresponding to the sample object in the first graph structure and the timestamp of each edge connecting the first node, the second nodes connected by each edge are sampled to obtain the first preset number of second nodes connected by each edge whose timestamp is earlier than the timestamp of the first node connected by the edge. The third object corresponding to each sampled second node is determined as the second object of the sample object.
[0027] As an optional embodiment, for each training sample, the step of extracting features from the attribute information and second transaction information of the sample object in the training sample to obtain the second feature representation of the sample object further includes:
[0028] For each second object of the sample object, the time of occurrence of the resource transfer behavior corresponding to the second object is extracted to obtain the time feature vector of the time of occurrence of the behavior corresponding to the second object.
[0029] The step of determining the weight of each second object relative to the sample object based on the correlation between the feature vector of the sample object and the feature vectors of each corresponding second object includes:
[0030] For each second object of the sample object, determine the time feature vector of the behavior occurrence time corresponding to the second object, and the correlation between the time feature vector of the behavior occurrence time corresponding to each second object. Based on the correlation, adjust the feature vector of the sample object corresponding to the second object to obtain the adjusted feature vector.
[0031] The weights of each second object relative to the sample object are determined based on the correlation between the feature vector of the sample object and the adjusted feature vectors of the sample object corresponding to each second object.
[0032] As an optional embodiment, for each second object of the sample object, determining the temporal feature vector of the behavior occurrence time corresponding to the second object, the correlation between the temporal feature vectors of the behavior occurrence time corresponding to each second object, and adjusting the feature vector of the sample object corresponding to the second object according to the correlation to obtain the adjusted feature vector, includes:
[0033] The adjusted feature vector is obtained using the following formula:
[0034]
[0035] Where K′ is the adjusted feature vector of the sample object corresponding to each second object, and K is the feature vector of the sample object corresponding to each second object; The correlation between the temporal feature vector of the behavior occurrence time corresponding to each second object and the temporal feature vector of the behavior occurrence time corresponding to each second associated object.
[0036] As an optional embodiment, for each sample object, the temporal feature vector of the time of occurrence of the behavior corresponding to each second object of that sample object is determined in the following way:
[0037] For each second object of the sample object, at least one of the first feature vector, second feature vector, third feature vector or fourth feature vector of the behavior occurrence time corresponding to the second object is determined, and the time feature vector of the behavior occurrence time corresponding to the second object is obtained according to the at least one feature vector.
[0038] The first feature vector, the second feature vector, the third feature vector, and the fourth feature vector are obtained through the following methods:
[0039] The time of the action is encoded using absolute time encoding to obtain a first feature vector of the time of the action.
[0040] Encode the time difference between the time when the behavior occurs and the time when the object type of the sample object is determined to obtain a second feature vector of the time when the behavior occurs.
[0041] The occurrence time of the behavior is standardized using at least one preset period, and the standardized occurrence time of the behavior is encoded to obtain a third feature vector;
[0042] According to a preset time set, the time of the behavior occurrence is binarized and encoded to obtain a fourth feature vector of the behavior occurrence time. The preset time set includes multiple preset time periods. For each preset time period, if the behavior occurrence time belongs to the preset time period, the feature value corresponding to the preset time period in the fourth feature vector is a first value. If the behavior occurrence time does not belong to the preset time period, the feature value corresponding to the preset time period in the fourth feature vector is a second value.
[0043] As an optional embodiment, for each second object of each sample object, the temporal feature vector of the time when the behavior of the second object occurs is determined in the following way:
[0044] At least two of the first, second, third, or fourth feature vectors of the time when the behavior corresponding to the second object occurs are concatenated to obtain the time feature vector.
[0045] As an optional embodiment, the neural network model includes a first feature extraction network, a second feature extraction network, a classifier, and weight parameters to be trained; the first feature extraction network is used to extract features from the attribute information and first transaction information of the sample object in the training sample to obtain a first feature representation of the sample object; the second feature extraction network is used to extract features from the attribute information and second transaction information of the sample object in the training sample to obtain a second feature representation of the sample object; the classifier is used to predict the target feature representation to obtain a type prediction result of the sample object; the weight parameters include a first weight corresponding to the first feature representation of the sample object and a second weight corresponding to the second feature representation of the sample object;
[0046] The step of fusing the first feature representation and the second feature representation to obtain the target feature representation of the sample object includes:
[0047] Based on the first weight and the second weight, the first feature representation and the second feature representation are weighted and fused to obtain the target feature representation of the sample object;
[0048] The step of adjusting the model parameters of the neural network model based on the training loss includes:
[0049] The training loss is used to adjust the weight parameters of the first feature extraction network, the second feature extraction network, the classifier, and the network to be trained.
[0050] According to a third aspect of the embodiments of this application, an object classification apparatus is provided, the apparatus comprising:
[0051] The data acquisition module is used to acquire object-related data of the target object. The object-related data includes attribute information of the target object, first transaction information, and second transaction information. The first transaction information includes attribute information of a first object that has a resource transfer relationship with the target object, and resource transfer-related data of the resource transfer relationship. The second transaction information includes attribute information of a second object that has a resource transfer relationship with the target object, the occurrence time of the resource transfer relationship, and resource transfer-related data. Specifically, for the resource transfer relationship between the target object and the first object, the target object is either the resource spender or the recipient; for the resource transfer relationship between the target object and the second object, the target object is only the resource spender.
[0052] The type prediction module is used to classify the target object based on the object-related data using a trained object classification model, and obtain the type prediction result of the target object. The type prediction result characterizes the resource expenditure capacity of the target object.
[0053] The type prediction module includes:
[0054] The data processing submodule is used to extract features from the attribute information and first transaction information of the target object to obtain a first feature representation of the target object; and to extract features from the attribute information and second transaction information of the target object to obtain a second feature representation of the target object.
[0055] The feature fusion submodule is used to fuse the first feature representation of the target object with the second feature representation of the target object to obtain the target feature representation of the target object, and to make a prediction based on the target feature representation of the target object to obtain the type prediction result.
[0056] According to a fourth aspect of the embodiments of this application, a model training apparatus is provided, the apparatus comprising:
[0057] The sample acquisition module is used to acquire multiple labeled training samples. Each training sample includes attribute information of a sample object, first transaction information, and second transaction information. The first transaction information includes attribute information of a first object that has a resource transfer behavior with the sample object, and resource transfer-related data of the resource transfer behavior. The second transaction information includes attribute information of a second object that has a resource transfer behavior with the sample object, the occurrence time of the resource transfer behavior, and resource transfer-related data. The label of each training sample represents the resource expenditure capacity of the sample object corresponding to the training sample.
[0058] The model training module is used to continuously perform training operations on the neural network model based on the multiple training samples until the preset training termination condition is met, so as to obtain a trained object classification model.
[0059] The model training module includes:
[0060] The feature extraction submodule is used to extract features from the attribute information and first transaction information of the sample object in each training sample to obtain a first feature representation of the sample object; extract features from the attribute information and second transaction information of the sample object in the training sample to obtain a second feature representation of the sample object; fuse the first feature representation and the second feature representation to obtain a target feature representation of the sample object; and make a prediction based on the target feature representation to obtain a type prediction result of the sample object.
[0061] The parameter adjustment submodule is used to determine the training loss based on the label and type prediction results corresponding to each training sample, and to adjust the model parameters of the neural network model according to the training loss.
[0062] According to a fifth aspect of the embodiments of this application, an electronic device is provided, the electronic device including a memory, a processor and a computer program stored in the memory, wherein the processor executes the program to implement the steps of the methods provided in the first and second aspects.
[0063] According to a sixth aspect of the embodiments of this application, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps of the methods provided in the first and second aspects.
[0064] According to a seventh aspect of the present application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium, wherein when a processor of a computer device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, causing the computer device to perform steps implementing the methods provided as in the first and second aspects.
[0065] The beneficial effects of the technical solutions provided in this application are:
[0066] In this embodiment, considering that the resource transfer behavior between the target object and each first object describes the static interaction relationship of the target object, and the resource transfer behavior between the target object and each second object describes the dynamic interaction relationship of the target object, when acquiring object-related data of the target object, the resource transfer-related data corresponding to the resource transfer behavior between the target object and each first object is acquired without acquiring the corresponding time information, in order to prevent the noise influence of time information on the static interaction data. When acquiring the resource transfer-related data corresponding to the resource transfer behavior between the target object and each second object, the corresponding time information is acquired, in order to obtain the correlation between resource transfer data and time, and enhance the utilization of time-series information. Based on the trained object classification model, the first feature representation corresponding to the static interaction relationship of the target object and the second feature representation corresponding to the dynamic interaction relationship are fused to obtain the target user type prediction result. This prediction process utilizes the static interaction relationship of the target object and improves the accuracy of determining the sample object type. Attached Figure Description
[0067] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0068] Figure 1 A schematic diagram of the implementation environment to which the embodiments of this application are applicable;
[0069] Figure 2 A flowchart illustrating an object classification method provided in an embodiment of this application;
[0070] Figure 3 A flowchart illustrating a classification operation provided in an embodiment of this application;
[0071] Figure 4 A schematic diagram of an interactive dynamic graph provided in an embodiment of this application;
[0072] Figure 5a This is a schematic diagram of the structure of an encoder and a first feature extraction network provided in an embodiment of this application;
[0073] Figure 5b This is a schematic diagram of another encoder and a first feature extraction network provided in an embodiment of this application;
[0074] Figure 6 This application provides a schematic diagram of the structure of a reweighting unit and a classifier.
[0075] Figure 7 A dynamic diagram provided for an embodiment of this application;
[0076] Figure 8 This is a schematic diagram of the structure of a multi-view time encoder provided in an embodiment of this application;
[0077] Figure 9 A schematic diagram illustrating a process for obtaining a second feature vector, provided in an embodiment of this application;
[0078] Figure 10 This is a schematic diagram of the structure of an object classification model provided in an embodiment of this application;
[0079] Figure 11 A schematic flowchart illustrating a model training method provided in an embodiment of this application;
[0080] Figure 12 A flowchart illustrating a training operation provided in an embodiment of this application;
[0081] Figure 13 A flowchart illustrating a neural network model provided in an embodiment of this application;
[0082] Figure 14 A flowchart illustrating an object classification method provided in an embodiment of this application;
[0083] Figure 15 A schematic flowchart illustrating a model training method provided in an embodiment of this application;
[0084] Figure 16 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0085] Figure 17This is a schematic diagram of the structure of an object classification device provided in an embodiment of this application;
[0086] Figure 18 This is a schematic diagram of the structure of a model training device provided in an embodiment of this application;
[0087] Figure 19 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0088] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.
[0089] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” can be implemented as “A,” or as “B,” or as “A and B.”
[0090] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0091] It should be noted that, in the optional embodiments of this application, the data related to object information (such as basic user information) requires the permission or consent of the object when the embodiments of this application are applied to specific products or technologies. Furthermore, the collection, use, and processing of this data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. In other words, if the embodiments of this application involve data related to the object, it must be obtained with the object's authorization and consent, the authorization and consent of relevant departments, and in accordance with the relevant laws, regulations, and standards of the country and region. If the embodiments involve personal information, the acquisition of all personal information requires the individual's consent. If sensitive information is involved, the separate consent of the information subject is required. The embodiments also need to be implemented with the object's authorization and consent.
[0092] Before providing a further detailed description of the embodiments of the present invention, the nouns and terms involved in the embodiments of the present invention will be explained, and the nouns and terms involved in the embodiments of the present invention shall be interpreted as follows.
[0093] Graph Neural Networks (GNNs) are a type of neural network that operates directly on graph structures, primarily processing data with non-Euclidean spatial structures (graph structures). They ignore the input order of nodes; during computation, the representation of a node is influenced by its neighboring nodes, while the graph's connections remain unchanged; the graph structure allows for graph-based reasoning. Typically, a GNN consists of two modules: a propagation module and an output module. The propagation module transmits information and updates the state between nodes in the graph, while the output module provides vector representations of the nodes and edges, defining the objective function according to the specific task. Examples of GNNs include Graph Convolutional Networks (GCNs), Gated Graph Neural Networks (GGNNs), Graph Attention Networks (GATs) based on attention mechanisms, and Graph Sample and Aggregation (GraphSAGE).
[0094] A node is the basic unit of a graph, representing an entity or object within the graph. In a Generative Neural Network (GNN), each node can have its own feature vector.
[0095] An edge is a line that connects two nodes, representing the relationship or interaction between the nodes.
[0096] Node features are feature vectors associated with each node, used to describe the node's attributes or content. They are part of the GNN input.
[0097] An edge feature is a feature vector associated with each edge, used to describe the attributes or weights of the edge.
[0098] Embedding is the process of mapping the features of a node or edge to a low-dimensional vector space for subsequent machine learning tasks, such as classification or prediction.
[0099] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0100] The model training method, object classification method, device, electronic device, computer-readable storage medium, and computer program product provided in this application aim to solve the problem that the prior art does not fully consider the correlation between time information and data in different dimensions, resulting in low accuracy of prediction results.
[0101] The technical solutions of this application and their effects are described below through several exemplary embodiments. It should be noted that the following embodiments can be referenced, borrowed from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.
[0102] The model training method and object classification method provided in this application embodiment are applicable to Figure 1 The implementation environment shown includes a first server 10, a second server 20, a terminal 30, and a database 40. The terminal 30 is an electronic device with object classification display functionality. This electronic device can be a smartphone, tablet, laptop, desktop computer, wearable electronic device (e.g., smartwatch), in-vehicle terminal, smart home appliance (e.g., smart TV), AR / VR device, etc., but is not limited to these. The terminal 30 can be a user-side terminal, which can provide resource application functionality by running various applications (resource application or payment application). After receiving a user's request, the terminal sends an object classification request to the second server 20, displaying the application result (whether the resource application is approved) returned by the second server 20. The terminal 30 can also be a resource management platform-side terminal. With object permission, this terminal can preset candidate objects, send an object classification request to the second server 20 upon receiving the return, determine the object type of each candidate object to find objects that can apply for resources, and recommend information for resource applications to those eligible objects.
[0103] The second server 20 is a backend server providing object classification, and it deploys an object classification model. When it receives an object classification request from the terminal 30, it can obtain the object-related data of the target object based on the object representation in the object classification request and the database 40. This second server can be a server on the resource management platform side. With the permission of the target object, the resource management platform can obtain transaction data of various resource transfers based on the resource management platform, as well as information of both parties involved in the resource transfer. Based on the deployed object classification model, it performs classification operations on the object-related data of the target object, obtains the type prediction result of the target object, and sends it to the terminal 30 for display.
[0104] The first server 10 is used to train the object classification model. Based on the object-related data in the database 40, the neural network model can be trained on a large number of training samples to obtain the object classification model. By performing multiple rounds of iterative training on the training samples, the model parameters of the neural network model are continuously adjusted, and the final neural network model with adjusted parameters is used as the object classification model and deployed to the second server 20.
[0105] Optionally, the first server 10 can adopt an offline learning training method, that is, use a large amount of data to train the model at once, or use a large amount of data in batches to train the model; or it can adopt an online learning training method, that is, the terminal 30 can continuously determine the actual object type of each object, use real-time information to iteratively optimize the model parameters in real time, and thus obtain an optimized object classification model.
[0106] The aforementioned servers (first server 10 and second server 20) can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Communication between the first server 10 and the second server 20, and between the second server 20 and the terminal 30, can be achieved via wired or wireless networks.
[0107] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can be any network, including but not limited to any combination of local area networks (LANs), metropolitan area networks (MANs), wide area networks (WANs), mobile, wired or wireless networks, private networks, or virtual private networks.
[0108] The technical solutions of this application and their effects are described below through several embodiments. It should be noted that the following embodiments can be referenced, borrowed from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.
[0109] This application provides an object classification method, which can be executed by any electronic device, for example, by... Figure 1 The second server 20 in the process is executed. For example... Figure 2 As shown, the method includes steps S201-S202. Figure 3 As shown, Figure 3 This is a flowchart illustrating a classification operation provided in an embodiment of this application. Step S202 includes steps S301-S303.
[0110] S201. Obtain object-related data of the target object.
[0111] The target object's object-related data includes the target object's attribute information, first transaction information, and second transaction information. The first transaction information includes the attribute information of the first object that has a resource transfer relationship with the target object, as well as resource transfer-related data for the resource transfer relationship. The second transaction information includes the attribute information of the second object that has a resource transfer relationship with the target object, the time of occurrence of the resource transfer relationship, and resource transfer-related data. Specifically, for the resource transfer relationship between the target object and the first object, the target object is either the resource spender or the recipient. For the resource transfer relationship between the target object and the second object, the target object is only the resource spender.
[0112] In this embodiment of the application, the object-related information of the target object includes the target object's attribute information, first transaction information, and second transaction information. The target object's attribute information may include the target object's basic information and statistical information. The basic information may include the object's age, gender, and occupation, while the statistical information may include the types of goods and services obtained by the target object through resource transfer.
[0113] The first transaction information includes the attribute information of the first object with which the resource transfer activity occurs, as well as the resource transfer-related data. In the resource transfer activity between the target object and the first object, the target object can be either a resource spender or a resource receiver. When the target object is a resource spender, the first object is a resource receiver; when the target object is a resource receiver, the first object is a resource spender. The attribute information of the first object can be the same as that of the target object. The resource transfer-related data for the resource transfer activity between the target object and the first object can include the spender, the receiver, and the quantity of the transferred resources.
[0114] The second transaction information includes the attribute information of the second object that has a resource transfer relationship with the target object, the time of the resource transfer, and related data. In the resource transfer between the target object and the second object, the target object may be solely the resource provider, and the second object may be solely the resource recipient. After receiving the resources, the second object provides the target object with corresponding goods or services. The number of second objects belonging to the target object can be a first preset quantity.
[0115] The attribute information of the second object may include basic information and statistical information of the second object. The basic information may include the object identifier and geographical location of the second object, and the statistical information may include the type of goods or services provided by the second object. The resource transfer-related data of the resource transfer behavior between the target object and the second object may include the quantity of resources transferred and the name of the corresponding goods or services.
[0116] The time of resource transfer can be the time when the target object transfers resources, the time when the target object and the second object agree to transfer resources, the time when the second object provides goods or services, or the time when the target object completes the resource transfer and the second object also completes the provision of goods or services.
[0117] One application scenario of the object method provided in this application embodiment is that the method can be applied to the resource application service of a resource management platform. The target object can store its own resources in the resource management platform and can transfer its own resources to a first object or a second object. The target object, the first object, and the second object have all been registered in the resource management platform. Therefore, the resource management platform has the right to obtain the object-related data of the target object.
[0118] The resource management platform can store data related to each object through interactive dynamic graphs and various data tables.
[0119] like Figure 4 As shown, Figure 4This is a schematic diagram of an interactive dynamic graph provided in an embodiment of this application. Nodes in the interactive dynamic graph represent a fourth object and a fifth object. Resource transfer can occur between the fourth objects and between the fourth and fifth objects. The nodes corresponding to the two objects performing the resource transfer are connected by a line. Each node can record the object identifier of the corresponding object. The line connecting the nodes of the fourth and fifth objects performing the resource transfer can also include a timestamp, which indicates the time when the resource transfer occurred. Optionally, the edges connecting the fourth objects can also include timestamps to record the time when the resource transfer occurred between the fourth objects.
[0120] Therefore, through this interactive dynamic diagram, we can clearly identify the objects that have resource transfer behavior, as well as the time when the resource transfer behavior between the fourth and fifth objects occurs.
[0121] The data table can be divided into a first data table, a second data table, and a third data table. The first data table records the correspondence between the object identifier and attribute information of each object. The second data table records the correspondence between the object identifiers of the two fourth objects exhibiting resource transfer behavior and the related data. The third data table records the correspondence between the object identifiers of the fourth and fifth objects exhibiting resource transfer behavior, the time of the behavior, and the related data.
[0122] The target object is one of several fourth objects in the database. The target object can initiate a resource request through the client corresponding to the resource management platform. The second server of the resource management platform retrieves the target object's object-related data from the database. The target object's attribute information can be determined from the first data table based on its object identifier. Based on the target object's object identifier and the first object's identifier, the first and second objects with resource transfer behavior with the target object are determined from the interaction graph. Based on the target object's identifier and the first object's identifier, the target object's attribute information, along with the resource transfer-related data, are retrieved from the first and second data tables. The second object's attribute information and resource transfer-related data can also be retrieved from the first and third data tables based on the target object's object identifier, the second object's object identifier, and the timestamp on the connection.
[0123] S202. Based on the object-related data of the target object, the trained object classification model is used to classify the target object to obtain the type prediction result of the target object. The type prediction result characterizes the resource expenditure capacity of the target object.
[0124] In this embodiment, the object classification model is obtained by multiple rounds of iterative training using training samples. The object classification model is used to perform classification operations on the object-related data of the target object to obtain the type prediction result of the target object. The output of the object classification model can be the object type of the target object or a prediction probability. The prediction probability can be compared with a preset threshold to determine the type prediction result of the target object.
[0125] The target object type prediction result represents the target object's resource expenditure capacity. The target object type can be determined based on the target object type prediction result. The target object type can be a target type or a non-target type. The target type means that if the target object's resource application is approved, the target object will return the resources on time. The non-target type means that if the target object's resource application is approved, the target object will not return the resources on time.
[0126] In this embodiment of the application, the above classification operation includes steps S301 and S302:
[0127] S301. Extract features from the attribute information and first transaction information of the target object to obtain the first feature representation of the target object; extract features from the attribute information and second transaction information of the target object to obtain the second feature representation of the target object.
[0128] In the embodiments of this application, the resource transfer behavior of the target object includes the resource transfer behavior between the target object and the first object, and the resource transfer behavior between the target object and the second object. The resource transfer behavior between the target object and the first object occurs randomly and has no regularity in time, while the resource transfer behavior between the target object and the second object is regular in time.
[0129] Therefore, the occurrence time of the corresponding resource transfer behavior was not obtained in the first transaction information to prevent the introduction of time noise and reduce the accuracy of the prediction; the occurrence time of the corresponding resource transfer behavior was obtained in the second transaction information to improve the accuracy of the prediction based on the temporal pattern of resource transfer related data.
[0130] In this embodiment, the object classification model may include a first feature extraction network and a second feature extraction network. The first feature extraction network can extract features from the target object's attribute information and first transaction information to obtain an extracted feature vector, which serves as the first feature representation of the target object. This first feature representation reflects the static interaction relationships of the sample objects. The second feature extraction network can extract features from the target object's attribute information and second transaction information to obtain an extracted feature vector, which serves as the second feature representation of the target object. This second feature representation reflects the dynamic interaction relationships of the sample objects.
[0131] The first and second feature extraction networks can be convolutional neural networks (CNN), recurrent neural networks (RNN), Transformer networks, residual networks, or ResNet.
[0132] As an optional embodiment, the first feature extraction network can be a graph neural network. It can construct a graph structure from the attribute information of the target object and the first transaction information, and input this graph structure into the first feature extraction network. Nodes in the graph structure represent the target object or the first object, and edges represent resource transfer behavior between the target object and the first object. The object classification model can include an encoder, which may or may not belong to the first feature extraction network. The encoder encodes the attribute information of the target object and the first object to obtain corresponding node features, and obtains edge features based on resource transfer-related data of the target object's resource transfer behavior. To learn the edge feature information in this graph structure, the first feature extraction network can employ a graph neural network capable of processing edge features, such as the Graph Attention Network (GAT) and the Graph Sampling Aggregation Algorithm (GraphSAGE). The adjacency matrix, node feature matrix, and edge matrix corresponding to this graph structure can be obtained as input to the graph neural network. By aggregating node features and edge features through the graph neural network, feature extraction of the target object's attribute information and the first transaction information can be achieved.
[0133] like Figure 5a and Figure 5b As shown, Figure 5a This is a schematic diagram of the structure of an encoder and a first feature extraction network provided in an embodiment of this application. Figure 5b This is a schematic diagram of another encoder and a first feature extraction network provided in an embodiment of this application. Figure 5a In this model, the encoder can operate independently of the first feature extraction network. The first transaction information includes attribute information and resource transfer-related data of multiple second objects. The encoder is used to obtain the adjacency matrix between the target object and the second objects based on the graph structure corresponding to the target object and the first object. Each attribute information and resource transfer-related data is encoded to obtain the node features and edge features of the corresponding nodes of the target object. This allows the graph neural network to process the data based on the adjacency matrix, node features, and edge features to obtain the first feature representation of the target object. Figure 5b In addition, the encoder can also be deployed in the first feature extraction network. The encoder encodes the attribute information and resource transfer related data input into the first feature extraction network to obtain the node matrix and edge matrix corresponding to the graph structure.
[0134] S302. The first feature representation of the target object is fused with the second feature representation of the target object to obtain the target feature representation of the target object. Based on the target feature representation of the target object, a prediction is made to obtain the type prediction result.
[0135] In the embodiments of this application, the first feature representation and the second feature representation can be added and fused, or different weights can be assigned to the first feature representation and the second feature representation, and a weighted fusion can be performed on the first feature representation and the second feature representation. It should be noted that for any two vectors or matrices that need to be operated on in this application, if the two dimensions cannot be operated on, the two vectors are aligned in a dimension alignment manner so that the two vectors can be operated on accordingly. The dimension alignment method can be zero-padding alignment, truncation alignment, interpolation alignment, or average alignment.
[0136] As an optional embodiment of this application, the first feature representation and the second feature representation are fused to obtain the target feature representation of the target object, including:
[0137] Obtain the first weight corresponding to the first feature representation and the second weight corresponding to the second feature representation; wherein, the first weight and the second weight are obtained through training;
[0138] Based on the first weight and the second weight, the first feature representation and the second feature representation are weighted and fused to obtain the target feature representation of the target object.
[0139] In this embodiment of the application, the object classification model includes trained weight parameters, which include a first weight for weighting the first feature representation and a second weight for weighting the second feature representation.
[0140] As an optional embodiment, the weighting parameter further includes a first bias and a second bias. The weight of the first feature representation can be obtained based on the first weight and the first bias, and the weight of the second feature representation can be obtained based on the second weight and the second bias. The first feature representation is weighted according to the weight of the first feature representation, and the second feature representation is weighted according to the weight of the second feature representation. The weighted first feature representation and the weighted feature representation are added together to obtain the target feature representation.
[0141] Specifically, as shown in the figure, Figure 6This is a schematic diagram of a reweighted unit and classifier provided in an embodiment of this application. Here, W represents the corresponding weight parameters, including weights and biases. After obtaining the weights of the first feature representation and the second feature representation, the weights can be normalized using the sigmoid function. The first weight, the first bias, and the sigmoid activation function can be used as one reweighted unit in the object classification model, and the second weight, the second bias, and the sigmoid activation function can be used as another reweighted unit in the object classification model. Taking the weighted first feature representation as an example, the weighted first feature representation is as follows:
[0142]
[0143] in, W is the first feature representation of the target object u. g It is the first weight, b g It is the first bias, σ(·) represents the element-wise sigmoid function, and ⊙ represents the element-wise product.
[0144] The target features of the target object are represented as follows:
[0145]
[0146] in, Let be the first feature representation of the target object u. This is the weighted representation of the second feature. Type prediction is then performed based on the classifier to obtain the type prediction result.
[0147] In this embodiment, a weighted fusion of the first feature representation and the second feature representation is performed. The first feature representation represents the static features of the target object, while the second feature vector represents the dynamic features. By combining the static and dynamic features and using the static features to constrain the dynamic features, the classifier can more comprehensively capture the intrinsic characteristics of the target object. This weighted fusion method not only fully utilizes the stability of static features but also effectively constrains the uncertainty of dynamic features, thereby significantly improving the robustness and accuracy of the type prediction results.
[0148] In this embodiment, the object classification model further includes a classifier used to make predictions based on the target feature representation to obtain a type prediction result. The classifier can be a multilayer perceptron (MLP). The type prediction result can be the probability that the object type of the target object is the target type. Based on a preset threshold and this probability, it can be determined whether the target object is the target type or not. The type prediction result can also directly indicate the target type or not.
[0149] In this embodiment, considering that the resource transfer behavior between the target object and each first object describes the static interaction relationship of the target object, and the resource transfer behavior between the target object and each second object describes the dynamic interaction relationship of the target object, when acquiring object-related data of the target object, the resource transfer-related data corresponding to the resource transfer behavior between the target object and each first object is acquired without acquiring the corresponding time information, in order to prevent the noise influence of time information on the static interaction data. When acquiring the resource transfer-related data corresponding to the resource transfer behavior between the target object and each second object, the corresponding time information is acquired, in order to obtain the correlation between resource transfer data and time, and enhance the utilization of time series information. Based on the trained object classification model, the first feature representation corresponding to the static interaction relationship of the target object and the second feature representation corresponding to the dynamic interaction relationship are fused to obtain the target user type prediction result. This prediction process utilizes the static interaction relationship of the target object and improves the accuracy of determining the sample object type.
[0150] As an optional embodiment of this application, the number of the second objects is a first preset number. Feature extraction is performed on the attribute information and second transaction information of the target objects to obtain a second feature representation of the target objects, including:
[0151] The attribute information of the target object is used to extract features to obtain the feature vector of the target object;
[0152] For each second object of the target object, feature extraction is performed on the second transaction information corresponding to the second object to obtain the feature vector of the target object corresponding to the second object.
[0153] Based on the correlation between the feature vector of the target object and the feature vectors of each second object corresponding to the target object, the weight of each second object with respect to the target object is determined.
[0154] Based on the weights of each second object relative to the target object, the feature vectors of the target object corresponding to the second object are weighted and fused to obtain the second feature representation of the target object.
[0155] In this embodiment, a second graph structure can be constructed using the interaction graph, the first database, and the third database mentioned above, representing the attribute information of the target object and the second transaction information. Nodes in this second graph structure represent third objects, which are the target object and a fifth object with a resource transfer relationship with the target object. The edges between the target object and the third object represent the timestamps of the corresponding resource transfer actions. The attribute information of the object, the time of the action, and the resource transfer-related data can be determined based on the first and third databases. The encoder in the object classification model encodes the attribute information of the target object and the second object to obtain node features, and encodes the resource transfer-related data between the target object and the second object to obtain edge features.
[0156] like Figure 7 As shown, Figure 7 This is a schematic diagram of a dynamic image provided for an embodiment of this application. Figure 7 As can be seen, with the increase of time, the number of nodes and edges at different times increases, and the graph changes with time. Furthermore, the graph corresponding to a certain time includes information from the graphs of previous times. In this embodiment, a time period can be selected to obtain the corresponding interactive dynamic graph. This involves removing resource transfer behaviors before and after the time period, and obtaining object-related data of the target object based on the interactive dynamic graph of that time period. This time period can be from a first time to a base time, and the interval between the first time and the base time is a preset interval, which can be one year or one month.
[0157] A second graph structure is constructed based on the object-related data of the acquired target object. This second graph structure can be represented as a temporal interaction sequence, for example... Where 0≤t′1≤t′2≤…t′ i ≤…t′ n , For the target object, Represents the second object, t′ i The system represents the time when an action occurs. Node indices can be constructed based on the node features corresponding to the target object and each second object. These node indices can then be used to obtain the corresponding node features based on the object identifier. Similarly, edge indices can be constructed based on the edge features and action occurrence times of the target object and each second object. The corresponding edge features and action occurrence times can then be obtained from these edge indices based on the target object identifier, second object identifier, and action occurrence time. The second feature extraction network aggregates the temporal interaction sequence, node indices, and edge indices to obtain the feature vector of the target object and the feature vectors of the target object corresponding to the second objects.
[0158] In this embodiment, a sampler can sample the second graph structure to determine a first preset number of second objects corresponding to the target object. It should be noted that the sampler can be independent of the object classification model or belong to it. When the sampler is independent of the object classification model, it samples the fifth object to obtain the first preset number of second objects corresponding to the target object. The object classification model can include a sampler; specifically, the sampler can be included in the second feature extraction network. When the object classification model includes a sampler, the input to the object classification model can be a third object, i.e., the second transaction information of the target object includes the attribute information of the third object that has resource transfer behavior with the target object, the occurrence time of the resource transfer behavior, and resource transfer-related data. The sampler in the object classification model samples the third object to obtain the first preset number of third objects, which are then used as the second objects.
[0159] As an optional embodiment, the attribute information of the target object and the second transaction information can also be represented in the form of multi-dimensional data. Taking the target object corresponding to two second objects as an example, the input data of the second feature extraction network is [A, (B1, B2, B3)(C1, C2, C3)], where A is the attribute information of the target object A, X1 is the attribute information of the second object X, X2 is the resource transfer related data of the resource transfer behavior between the target object and the second object, X3 is the corresponding behavior occurrence time, and X is B or C. The second feature extraction network can be CNN, RNN, Transformer network or ResNet.
[0160] In this embodiment, the node features corresponding to the target object can be used as the feature vector of the target object, that is, the attribute information of the target object is encoded and used as the feature vector of the target object. The node features, edge features, and behavior occurrence time corresponding to the second object can be used as the feature vector of the target object corresponding to the second object.
[0161] In this embodiment, the second feature extraction network may include an attention network to obtain the feature vector of the target object. After obtaining the feature vector of the second transaction information corresponding to each second object, the attention network generates a query matrix Q based on the feature vector of the target object, and generates a key matrix K and a value matrix V based on the feature vector of the target object corresponding to each second object. The weighted value matrix is obtained based on the following formula:
[0162]
[0163] in, d represents the correlation between the feature vector of the target object and the feature vectors of each second object. k This represents the dimension of the value matrix V. This represents the weight of each second object relative to the target object.
[0164] In this embodiment of the application, after obtaining the weights of each second object with respect to the target object according to the attention network, the feature extraction vector of the target object corresponding to the second object is weighted based on the weights to obtain a weighted feature vector. The weighted feature vector can be fused to obtain a second feature representation.
[0165] In this embodiment, by determining the correlation between the feature vector of the target object and the feature vectors of each second object, the degree of influence of each second object on the target object is obtained. Based on this degree of influence, a weight is assigned to the feature vector corresponding to each second object, and the weighted feature vectors corresponding to each second object are fused to obtain the second feature representation of the target object, so that the second feature representation of the target object can better reflect the interaction relationship between the target object and each second object.
[0166] As an optional embodiment of this application, feature extraction is performed on the attribute information and second transaction information of the target object to obtain a second feature representation of the target object, which further includes:
[0167] For each second object of the target object, the time of occurrence of the resource transfer behavior corresponding to the second object is extracted to obtain the time feature vector of the time of occurrence of the behavior corresponding to the second object.
[0168] Based on the correlation between the feature vector of the target object and the feature vectors of the target object corresponding to each second object, the weights of each second object with respect to the target object are determined, including:
[0169] For each second object of the target object, determine the time feature vector of the behavior occurrence time corresponding to the second object, and the correlation between the time feature vector of the behavior occurrence time corresponding to each second object. Based on the correlation, adjust the feature vector of the target object corresponding to the second object to obtain the adjusted feature vector.
[0170] The weights of each second object relative to the target object are determined based on the correlation between the feature vector of the target object and the adjusted feature vectors of each second object corresponding to the target object.
[0171] In this embodiment, the second feature extraction network may further include a time encoder, which can extract features from the occurrence time of the resource transfer behavior of each second object to obtain a time feature vector of the occurrence time of the behavior corresponding to each second object.
[0172] For each second object, the feature vector corresponding to the target object may include node features corresponding to the attribute information of the second object, edge features corresponding to the resource transfer information between the target object and the second object, and time feature vectors of the behavior occurrence time.
[0173] In this embodiment, the attention network in the second feature extraction network can be a temporal attention network. It can obtain a time matrix T based on the temporal feature vectors of the behavior occurrence times corresponding to each second object. The key matrix K is then adjusted based on the time matrix T to obtain the adjusted feature vectors corresponding to each second object for the target object. The weights of each second object relative to the target object are determined based on the query matrix Q and the adjusted key matrix K′.
[0174] In this embodiment, attention weights are adjusted by time features, and time information is incorporated into the attention mechanism, which can more effectively process time series data and improve the model's ability to capture key information and its prediction accuracy.
[0175] As an optional embodiment of this application, the temporal feature vector of the time of occurrence of the behavior corresponding to each second object of the target object is determined in the following way:
[0176] For each second object of the target object, determine at least one of the first feature vector, second feature vector, third feature vector or fourth feature vector of the behavior occurrence time corresponding to the second object, and obtain the time feature vector of the behavior occurrence time corresponding to the second object based on the at least one feature vector.
[0177] The first, second, third, and fourth eigenvectors were obtained through the following methods:
[0178] Encode the time difference between the time of the behavior occurrence and the reference time to obtain the first feature vector of the time of the behavior occurrence.
[0179] The time of the behavior is encoded using absolute time encoding to obtain the second feature vector of the time of the behavior.
[0180] The occurrence time of the behavior is standardized using at least one preset period, and the standardized occurrence time is encoded to obtain a third feature vector;
[0181] Based on a preset time set, the time of occurrence of the behavior is binarized and encoded to obtain a fourth feature vector of the time of occurrence of the behavior. The preset time set includes multiple preset time periods. For each preset time period, if the time of occurrence of the behavior belongs to the preset time period, the feature value corresponding to the preset time period in the fourth feature vector is the first value; if the time of occurrence of the behavior does not belong to the preset time period, the feature value corresponding to the preset time period in the fourth feature vector is the second value.
[0182] In this embodiment of the application, the object-related data of the target object also includes a reference time. The reference time can be the time when the target object is predicted or the time when the target object applies for resources. The encoder in the second feature extraction network can be a multi-view time encoder, which encodes the time of the behavior from multiple perspectives of the time of the behavior, making full use of time information.
[0183] Based on the assumption that relative time spans reveal more key time information, the time of occurrence of a behavior is encoded, including relative time encoding of the time of occurrence of a behavior, which is the time difference between the time of occurrence of the behavior and the reference time.
[0184] like Figure 8 As shown, Figure 8 This is a schematic diagram of a multi-view time encoder provided in an embodiment of this application. The multi-view time encoder may include a relative time encoder, an absolute time encoder, and a time semantic encoder.
[0185] For each behavior occurrence time corresponding to the target object, the following formula can be used, based on a relative time encoder, to encode the time difference between the behavior occurrence time and the reference time, and obtain the first feature vector of the behavior occurrence time:
[0186]
[0187] Where ω1,…, These are the parameters in the trained multi-view temporal encoder, where t is the baseline time and t′ is the time when the action occurs. It is the preset dimension of relative time encoding. Taking an equal value of 2 as an example, the above formula is:
[0188]
[0189] The first feature vector is used to represent the proximity between the behavior occurrence time and the reference time. To obtain specific time information of the behavior occurrence time, the behavior occurrence time can be absolutely time encoded to obtain the second feature vector.
[0190] For each behavior occurrence time corresponding to the target object, the following formula can be used to implement absolute time encoding of the behavior occurrence time based on an absolute time encoder, thus obtaining the second feature vector of the behavior occurrence time:
[0191]
[0192] Where ω′1,..., These are the parameters trained in the multi-view temporal encoder. This is a pre-defined dimension for absolute time encoding, where t′ represents the time the action occurred. Taking an equal value of 2 as an example, the above formula is:
[0193]
[0194] By encoding the time of the behavior in absolute time, a second feature vector is obtained, which can provide semantic information about the time of the behavior and reveal the temporal pattern of resource transfer by the target object.
[0195] In order to explicitly utilize the semantic information of the behavior occurrence time and better represent the periodicity of the time, the behavior occurrence time can be standardized based on at least one preset period, and the standardized behavior occurrence time can be encoded to obtain a third feature vector.
[0196] For each behavior occurrence time and each preset period corresponding to the target object, the vector representation of the behavior occurrence time corresponding to the preset period can be obtained based on the following formula:
[0197]
[0198] Where T is the preset period, which can be an hour, day, week, month, or year, or a preset time period, such as 15 days or 30 days. This is used to represent the standardization of the time of occurrence of an action so that the period of the sine and cosine functions is T, and to explicitly obtain the semantic information of the time of occurrence of the action within the preset period T.
[0199] The vector representations of the behavior occurrence time corresponding to each preset period can be concatenated to form the third feature vector corresponding to that behavior occurrence time.
[0200] Considering that the return process after requesting resources can be periodic, by encoding the periodic information of the occurrence time of each behavior of the target object into a third feature vector, we can better predict whether the target object can return resources on time after requesting them.
[0201] To make a deeper use of the semantic information of the time of occurrence of a behavior, we can determine whether the time of occurrence of the behavior is within a specific time period. We can also perform binary encoding on the time of occurrence of the behavior based on a preset time set to obtain the fourth feature vector of the time of occurrence of the behavior.
[0202] This preset time set includes multiple preset time periods, which can be specific time ranges of particular interest in data analysis. Within these time periods, the target object may exhibit different resource transfer behaviors due to factors such as special events, holidays, and the distinction between working days and non-working days.
[0203] In this embodiment, the preset time period can be a weekend, holiday, or a product promotion period. For each preset time period, the behavior occurrence time can correspond to a feature value. For example, if the preset time period includes 5 time periods, then the fourth feature vector of the behavior occurrence time includes 5 feature values, each of which is either a first value or a second value. Alternatively, for all preset time periods, the behavior occurrence time corresponds to one feature value. For example, if the behavior occurrence time of the target object corresponds to one of the preset time periods, then the fourth feature vector of the behavior occurrence time is the first value; if the behavior occurrence time of the target object does not correspond to any of the preset time periods, then the fourth feature vector of the behavior occurrence time is the second value.
[0204] Any feature vector of the time when the behavior occurs corresponding to the target object can be used as the time feature vector of the time when the behavior occurs.
[0205] This application provides four methods for encoding the time of behavior occurrence, effectively extracting the temporal semantic information when the target object performs resource transfer behavior.
[0206] As an optional embodiment of this application, for each second object of the target object, the temporal feature vector of the time when the behavior occurs corresponding to the second object is determined in the following way:
[0207] At least two of the first, second, third, or fourth feature vectors of the time when the behavior corresponding to the second object occurs are concatenated to obtain the time feature vector.
[0208] Vector concatenation is used to join two or more vectors together to form a new vector. In this embodiment, at least two items of the feature vectors corresponding to the time of the behavior can be concatenated to obtain a time feature vector.
[0209] As an optional embodiment, the third and fourth feature vectors of the behavior occurrence time can be concatenated to obtain an initial feature vector of the behavior occurrence time. Then, the initial feature vector is weighted to obtain a semantic feature vector. Finally, the first feature vector, the second feature vector, and the semantic feature vector are concatenated to obtain a time feature vector based on the concatenated features.
[0210] Among them, such as Figure 8 As shown, the semantic feature vector obtained based on the temporal semantic encoder can be:
[0211]
[0212] in, It is a semantic feature vector obtained by concatenating the third and fourth feature vectors, d se Let be the dimension of the initial feature vector. It is a weight matrix. is the dimension of the semantic feature vector.
[0213] Concatenating the first feature vector, the second feature vector, and the semantic feature vector yields the time feature vector, which can be represented as:
[0214]
[0215] Where || represents the concatenation operation. This represents the feature obtained by concatenating the first feature vector, the second feature vector, and the semantic feature vector. These are the trained weights of the multi-view temporal encoder, d t This is the dimension of the time feature vector.
[0216] In this embodiment, at least two items of the feature vector corresponding to the time of the behavior are concatenated to combine multiple features into a new feature vector, so that the model can better capture the relationship between time features.
[0217] As an optional embodiment of this application, for each second object of the target object, the temporal feature vector of the behavior occurrence time corresponding to the second object is determined, and the correlation between the temporal feature vectors of the behavior occurrence time corresponding to each second object is determined. The feature vector of the target object corresponding to the second object is adjusted according to the correlation to obtain the adjusted feature vector, including:
[0218] The adjusted feature vector is obtained using the following formula:
[0219]
[0220] Where K′ is the adjusted feature vector of the target object corresponding to each second object, and K is the feature vector of the target object corresponding to each second object; The correlation between the temporal feature vector of the behavior occurrence time corresponding to each second object and the temporal feature vector of the behavior occurrence time corresponding to each second associated object.
[0221] In this embodiment, for a target object q, the target object q is used as the query node, and the time when the target is fulfilled and the resource application is performed is used as the base time t. q The second object corresponding to the target object k i ∈V D As a neighboring node of the query node, the edge between the query node and its neighboring nodes Used to represent the query node and neighbor nodes at t′ i There is a transfer of resources, indicating a connection.
[0222] In this embodiment of the application, time attention is defined as:
[0223]
[0224] Wherein, Q, K, V, T are obtained through linear mapping:
[0225] Q = W Q X Q K = W K X K ,
[0226] V = W V X V T = W T X T
[0227] W Q W K W V W T It is a weight matrix, query feature X Q The feature vector used to represent the target object, key feature X K The characteristic X of the sum value V The time feature X is used to represent the feature vector of the target object corresponding to each second object. T This is a temporal feature vector representing the time when the behavior of each second object occurs, corresponding to the target object. Specifically:
[0228]
[0229] Where |N k | represents the number of key neighbors, x u Represents the node features of object u (u can be q, k)i ), The edge features of edge (u,v,t′) are represented by v, which can be k. i t′ can take t′ i ), z t,t′ This represents the temporal feature representation obtained by the multi-view temporal encoder (t can take the value t). q t′ can take the value t q ,t′ i ).
[0230] It should be noted that, Reference time t q The time feature vector. The correlation between the temporal feature vector of the behavior occurrence time corresponding to each second object and the temporal feature vector of the behavior occurrence time corresponding to each second associated object. This is used to represent the adjusted feature vector corresponding to the target feature for each second object.
[0231] in, The autocorrelation matrix of the time matrix explicitly models the correlation of time codes at different timestamps. When timestamp t... i With t j In time, if the correlation is high (large inner product), the corresponding attention weight will be enhanced; conversely, if the temporal correlation is weak, the corresponding attention weight will be reduced.
[0232] like Figure 9 As shown, Figure 9 This is a flowchart illustrating a process for obtaining a second feature vector in an embodiment of this application. By inputting the reference time and the occurrence time of each behavior into a multi-view temporal encoder, temporal feature vectors of each behavior occurrence time corresponding to the target object are obtained. The temporal feature vectors of each behavior occurrence time, the feature vector of the target object, and the second feature vectors of the target object corresponding to each second object are input into a temporal attention mechanism. The temporal attention mechanism obtains the corresponding temporal matrix, query matrix, key matrix, and value matrix. By calculating the attention weights, the weighted feature vectors of the target object corresponding to the second objects are obtained. Based on the aggregation network, the second feature vector is obtained.
[0233] The aggregation network can be a network that includes an attention mechanism, such as a graph attention neural network (GAT) based on an attention mechanism. The output of the temporal attention mechanism in this embodiment is used as the result of the attention mechanism in the network. Then, based on the network architecture, the various features are aggregated to obtain the second feature vector.
[0234] In this embodiment, the attention weights are constrained by the time variable by calculating the autocorrelation of the occurrence times of each behavior. Explicitly encoding temporal correlation as a priori for attention weight calculation allows the model to strengthen the association between temporally adjacent or periodic patterns while focusing on content similarity.
[0235] like Figure 10 As shown, Figure 10 This is a schematic diagram of the structure of an object classification model provided in an embodiment of this application. The object classification model includes an encoder, a sampler, a first feature extraction network, a second feature extraction network, a reweighting unit, and a classifier. The first feature extraction network includes a graph neural network, and the second feature extraction network includes a multi-view temporal encoder, a temporal attention mechanism, and an aggregation network. The input to the object classification model is object-related data of the target object, which can be obtained from a database. The database stores the relationship between the fourth and fifth objects in the form of a dynamic interaction graph and a data table. The object-related data is input into the object classification model. Based on the encoder in the object classifier, the attribute information and resource transfer-related data of each object are encoded to obtain node features and edge features, constructing a dynamic graph and a static graph respectively. The dynamic graph is the second graph structure mentioned above, represented by a temporal interaction sequence, node index, and edge index. The static graph is represented by an adjacency matrix, a node feature matrix, and an edge feature matrix. Features are extracted from the static graph based on the graph neural network in the first feature extraction network to obtain the first feature representation of the target object. The sampler samples the dynamic graph to obtain a second preset number of second objects.
[0236] The node features of the target object, the node features of the second object, the edge features between the target object and the second object, the behavior occurrence time, and the baseline time are input into the second feature extraction network. Based on the second feature extraction network and a multi-view temporal encoder, the baseline time and the behavior occurrence time are encoded to obtain the temporal feature vectors of the baseline time and the behavior occurrence time. Using a temporal attention mechanism, the node features of the target object are concatenated with the temporal feature representation of the baseline time to obtain the feature vector of the target object. For each second object, the node features of the second object, the edge features between the target object and the second object, and the temporal feature representation of the corresponding behavior occurrence time are concatenated to obtain the feature vector corresponding to each second object. Based on the temporal feature vectors of each behavior occurrence time of the target object, the feature vectors corresponding to each second object of the target object are adjusted to obtain the adjusted feature vectors corresponding to each second object of the target object. Based on the feature vectors of the target object and the adjusted feature vectors corresponding to each second object of the target object, the weights of each second object with respect to the target object are obtained. Based on these weights, the feature vectors of the target object with respect to each second object are weighted to obtain the weighted feature vectors of the target object with respect to each second object.
[0237] Based on the aggregation network, the weighted feature vectors of the target object with respect to each second object are fused to obtain the target feature representation. Furthermore, the aggregation network can also perform feature fusion based on the weighted feature vectors of the target object with respect to each second object, the temporal feature vectors of each behavior occurrence time, the node features of the target object, the node features of each second object, and the edge features between the target object and each second object to obtain the second feature representation.
[0238] The first and second feature representations of the target object are weighted using a reweighting unit to obtain weighted first and second feature representations. These two representations are then added together to obtain the target feature representation of the target object. Based on a classifier, this target feature representation is processed to obtain the target object's type prediction result.
[0239] As an optional embodiment of this application, the object classification model is trained in the following manner:
[0240] Obtain multiple labeled training samples. Each training sample includes attribute information of a sample object, first transaction information of the sample object, and second transaction information of the sample object. The label of each training sample represents the object type of the corresponding sample object.
[0241] Based on these multiple training samples, the neural network model is continuously trained until the preset training termination condition is met, thus obtaining the object classification model; the training operation includes:
[0242] For each training sample, feature extraction is performed on the attribute information and first transaction information of the sample object in the training sample to obtain the first feature representation of the sample object; feature extraction is performed on the attribute information and second transaction information of the sample object in the training sample to obtain the second feature representation of the sample object; the first feature representation and the second feature representation are fused to obtain the target feature representation of the sample object; prediction is performed based on the target feature representation to obtain the type prediction result of the sample object;
[0243] Based on the prediction results of the labels and types corresponding to each training sample, the training loss is determined, and the model parameters of the neural network model are adjusted according to the training loss.
[0244] In this embodiment of the application, the object classification model is obtained by training a neural network model based on labeled training samples. The training process will be described in detail in the corresponding description of the model training method below.
[0245] This application provides an object classification method, which can be executed by any electronic device, for example, by... Figure 1 The first server 10 in the process is executed. For example... Figure 11 As shown, the method includes:
[0246] S401. Obtain multiple training samples with labels.
[0247] Each training sample includes attribute information of a sample object, first transaction information, and second transaction information. The first transaction information includes attribute information of a first object that has a resource transfer behavior with the sample object, and resource transfer-related data of the resource transfer behavior. The second transaction information includes attribute information of a second object that has a resource transfer behavior with the sample object, the occurrence time of the resource transfer behavior, and resource transfer-related data. The label of each training sample represents the resource expenditure capacity of the sample object corresponding to the training sample.
[0248] In this embodiment, the sample object is an object of a known object type. The attribute information, first transaction information, and second transaction information of the sample object are obtained and used as training samples. The object type of the sample object is used as the training label for the training sample. The object type indicates whether the sample object returns resources on time after requesting them, and can be used to represent the sample object's resource expenditure capacity.
[0249] In this embodiment, training samples can be obtained from the database of the resource management platform. The resource management platform can store data related to each object through interactive dynamic graphs and multiple data tables. Please refer to the explanations above for details regarding these interactive dynamic graphs and multiple data tables.
[0250] The resource management platform can determine the object type of the fourth object that applied for resources based on whether the resources were returned on time after the application. The platform can then use the fourth object with the determined object type as the sample object, the fourth object that has resource transfer behavior with the sample object as the first object, and the fifth object that has resource transfer behavior with the sample object as the second object.
[0251] After identifying the sample object, the first object, and the second object, training samples with multiple labels can be obtained based on the interactive dynamic graph, the first data table, the second data table, and the third data table. Each training sample includes the attribute information of the sample object, the first transaction information, and the second transaction information. For corresponding data descriptions, please refer to the description of the object-related data of the target object in the previous text.
[0252] S402. Based on multiple training samples, continuously perform training operations on the neural network model until the preset training termination condition is met, and obtain a trained object classification model.
[0253] In this embodiment of the application, the preset training termination condition may include at least one of the following:
[0254] The number of training epochs has reached the preset value; the loss value is less than the preset value; the loss value tends to stabilize.
[0255] like Figure 12 As shown, the training operation includes steps S501 and S502.
[0256] S501. For each training sample, feature extraction is performed on the attribute information and first transaction information of the sample object in the training sample to obtain the first feature representation of the sample object; feature extraction is performed on the attribute information and second transaction information of the sample object in the training sample to obtain the second feature representation of the sample object; the first feature representation and the second feature representation are fused to obtain the target feature representation of the sample object; prediction is performed based on the target feature representation to obtain the type prediction result of the sample object.
[0257] In the embodiments of this application, the process of obtaining the type prediction result of the sample object can refer to the process of obtaining the type prediction result of the target object described above.
[0258] S502. Based on the prediction results of the labels and types corresponding to each training sample, determine the training loss, and adjust the model parameters of the neural network model according to the training loss.
[0259] The training loss can be determined based on the binary cross-entropy loss (BCELoss):
[0260]
[0261] Among them, y u The label for sample object u. Let N be the type prediction result for sample object y, N be the number of sample objects, and U be the set of sample objects.
[0262] The model training method provided in this application acquires the attribute information, first transaction information, and second transaction information of the sample users when obtaining training samples. The first transaction information includes the attribute information of associated users who have made payments with the sample users and payment-related data of the payments. The second transaction information includes the attribute information of associated merchants who have made transactions with the sample users and the time of occurrence of the transactions and payment-related data of the transactions. The attribute information and first transaction information of the sample users are not time-related and are static data related to the sample users. The attribute information and second transaction information of the sample users are time-related and are dynamic data related to the sample users. Therefore, in this application embodiment, when training the neural network model, both dynamic and static data of the sample users are used to improve model performance and the accuracy of object recommendations.
[0263] In this embodiment, considering that the resource transfer behavior between a sample object and each first object describes the static interaction relationship of the sample object, and the resource transfer behavior between a sample object and each second object describes the dynamic interaction relationship of the sample object, the resource transfer related data corresponding to the resource transfer behavior between the sample object and each first object is obtained without obtaining the corresponding time information. This is to prevent the noise influence of time information on the static interaction data. When obtaining the resource transfer related data corresponding to the resource transfer behavior between the sample object and each second object, the corresponding time information is obtained to obtain the correlation between the resource transfer data and time, thereby enhancing the utilization of time-series information. Based on the trained object classification model, the first feature representation corresponding to the static interaction relationship of the sample object and the second feature representation corresponding to the dynamic interaction relationship are fused to obtain the type prediction result of the sample object. The process of training the model utilizes the static interaction relationship of the sample object, thereby improving the accuracy of the trained model in predicting the object type.
[0264] As an optional embodiment, for each training sample, the time when the object type of the sample object is determined is also included, the number of second objects of the sample object is a first preset number, and the time when the behavior corresponding to each second object occurs is before the time when the object type of the sample object is determined;
[0265] For each training sample, the attribute information and second transaction information of the sample object in the training sample are used to extract features, resulting in a second feature representation of the sample object, including:
[0266] The attribute information of the sample object is used to extract features, resulting in the feature vector of the sample object;
[0267] For each second object of the sample object, feature extraction is performed on the second transaction information corresponding to the second object to obtain the feature vector of the sample object corresponding to the second object.
[0268] Based on the correlation between the feature vector of the sample object and the feature vectors of each corresponding second object, the weight of each second object with respect to the sample object is determined.
[0269] Based on the weights of each second object relative to the sample object, the feature vectors of the sample object corresponding to the second object are weighted and fused to obtain the second feature representation of the sample object.
[0270] In this embodiment of the application, the time when the object type of the sample object is determined can be the time when the sample object applies for resources. It should be understood that there is a time period between the sample object applying for resources and the return of resources. The time of applying for resources is the starting observation time for determining whether the target object returns resources on time after applying for resources. This time corresponds to the baseline time on the model application side. Therefore, this time is used as the time when the object type of the sample object is determined, so that the time when the behavior of the sample object occurs can be encoded according to the time when it is determined.
[0271] In this embodiment, the second transaction information of each sample object includes the attribute information of the third object to which the sample object has a resource transfer behavior, the occurrence time of the resource transfer behavior, and the data related to the resource transfer behavior. The number of third objects is greater than the first preset number. The first preset number of third objects can be obtained by sampling the third objects and used as the second objects.
[0272] For each sample object, the first preset number of second objects corresponding to that sample object are determined in the following way:
[0273] A first graph structure is constructed, which includes multiple first nodes and multiple second nodes. Each first node represents a sample object, and each second node represents a third object that has a resource transfer behavior with at least one sample object. For the resource transfer behavior between a sample object and a third object, the sample object is only the resource provider. There are edges between the nodes corresponding to the sample object and the third object that have a resource transfer behavior. Each first node and each edge in the first graph structure has its own timestamp. The timestamp of the first node indicates the time when the object type of the corresponding sample object is determined, and the timestamp of the edge indicates the time when the behavior of the two nodes connected by the edge occurs.
[0274] For each sample object, based on the timestamp of the first node corresponding to the sample object in the first graph structure and the timestamp of each edge connecting the first node, the second nodes connected by each edge are sampled to obtain the first preset number of second nodes connected by each edge whose timestamp is earlier than the timestamp of the first node connected by the edge. The third objects corresponding to each sampled second node are determined as the second objects of the sample object.
[0275] Similar to the second graph structure, when training a neural network model, a first graph structure can be constructed, and sampling can be performed based on the first graph structure to obtain a first preset number of second objects. In this first graph structure, the first node represents a sample object, the second node represents a third object, which is a fifth object that has resource transfer behavior with the sample object. The edges between the corresponding nodes of the first and second nodes have corresponding timestamps to indicate the time when the resource transfer behavior between the two nodes occurs.
[0276] A sampler can sample the first graph structure to determine a first preset number of second objects from the second graph structure whose behavior occurred earlier than the determined time corresponding to the sample object. This sampler can be independent of the neural network model or be part of it, and its relationship with the object classification model can be consistent. When the sampler is independent of the neural network model, it samples the third object to obtain the second objects. The object classification model can include a sampler; specifically, it can be included in the second feature extraction network. When the object classification model includes a sampler, the third object, which can be the target object, can be input into the neural network model. The sampler in the object classification model samples the third object to obtain a second preset number of second objects.
[0277] In this embodiment, by constructing a first graph structure, a fifth object that has resource transfer behavior with the sample object at a determined time can be obtained from the first graph structure. This fifth object with resource transfer behavior at the determined time is designated as the third object, and a first preset number of third objects are designated as the second objects. Based on the object identifier of the second objects, the second transaction information of the target object is determined. This ensures that the neighbors corresponding to each sample object in the second transaction information are the same, preventing a large number of neighbors from causing high computational load and low training efficiency. By sampling a fixed number of neighbors, computational complexity can be significantly reduced, enabling the model to process data efficiently.
[0278] It should be noted that since the resource transfer behavior between the sample object and the first object is static data of the sample object, this data has little correlation with the time of the behavior. Therefore, in this embodiment, the time of the behavior between the sample object and the first object can occur before or after the time of the determination of the sample object. As an optional embodiment, to improve the efficiency of acquiring training data, the first object can be a fourth object whose behavior occurs before the time of the determination of the sample object. This allows the corresponding first and second objects to be determined simultaneously based on the time of the determination of the sample object, and, based on the fact that the behavior between the target object and the first object must be before the reference time, the relevant data of the object before the time of the determination of the sample object can be determined, thus ensuring the consistency between the training data and the application data.
[0279] As an optional embodiment, for each training sample, the method further includes extracting features from the attribute information and second transaction information of the sample object in the training sample to obtain a second feature representation of the sample object:
[0280] For each second object of the sample object, the time of occurrence of the resource transfer behavior corresponding to the second object is extracted to obtain the time feature vector of the time of occurrence of the behavior corresponding to the second object.
[0281] The weights of each second object relative to the sample object are determined based on the correlation between the feature vector of the sample object and the feature vectors of each corresponding second object, including:
[0282] For each second object of the sample object, determine the time feature vector of the behavior occurrence time corresponding to the second object, and the correlation between the time feature vector of the behavior occurrence time corresponding to each second object. Based on the correlation, adjust the feature vector of the sample object corresponding to the second object to obtain the adjusted feature vector.
[0283] The weights of each second object relative to the sample object are determined based on the correlation between the feature vector of the sample object and the adjusted feature vectors of the sample object corresponding to each second object.
[0284] In this embodiment of the application, for each sample object, the process of determining the weight of each second object relative to the sample object can refer to the process of determining the weight of each second object relative to the target object described above, and will not be repeated here.
[0285] As an optional embodiment, for each sample object, the temporal feature vector of the time of occurrence of the behavior corresponding to each second object of that sample object is determined in the following way:
[0286] For each second object of the sample object, at least one of the first feature vector, second feature vector, third feature vector or fourth feature vector of the behavior occurrence time corresponding to the second object is determined, and the time feature vector of the behavior occurrence time corresponding to the second object is obtained based on the at least one feature vector.
[0287] The first, second, third, and fourth eigenvectors were obtained in the following ways:
[0288] The time of the action is encoded using absolute time encoding to obtain the first feature vector of the time of the action.
[0289] Encode the time difference between the time when the behavior occurs and the time when the object type of the sample object is determined to obtain the second feature vector of the time when the behavior occurs.
[0290] The occurrence time of the behavior is standardized using at least one preset period, and the standardized occurrence time is encoded to obtain a third feature vector;
[0291] Based on a preset time set, the time of the behavior is binarized and encoded to obtain a fourth feature vector of the behavior occurrence time. The preset time set includes multiple preset time periods. For each preset time period, if the behavior occurrence time belongs to the preset time period, the feature value corresponding to the preset time period in the fourth feature vector is the first value; if the behavior occurrence time does not belong to the preset time period, the feature value corresponding to the preset time period in the fourth feature vector is the second value.
[0292] As an optional embodiment, for each second object of each sample object, the temporal feature vector of the time when the behavior of the second object occurs is determined in the following way:
[0293] At least two of the first, second, third, or fourth feature vectors of the time when the behavior corresponding to the second object occurs are concatenated to obtain the time feature vector.
[0294] In this embodiment of the application, for each sample object, the process of determining the time feature vector of each behavior of the sample object corresponding to the time of occurrence of the second object can refer to the process of determining the time feature vector of the target object corresponding to the time of occurrence of each behavior of the second object in the previous text, wherein the time of determination of the sample object corresponds to the reference time of the target object.
[0295] As an optional embodiment, for each second object of the sample object, the temporal feature vector of the behavior occurrence time corresponding to the second object is determined, and the correlation between the temporal feature vectors of the behavior occurrence time corresponding to each second object is determined. Based on this correlation, the feature vector of the sample object corresponding to the second object is adjusted to obtain the adjusted feature vector, including:
[0296] The adjusted feature vector is obtained using the following formula:
[0297]
[0298] Where K′ is the adjusted feature vector of the sample object corresponding to each second object, and K is the feature vector of the sample object corresponding to each second object; The correlation between the temporal feature vector of the behavior occurrence time corresponding to each second object and the temporal feature vector of the behavior occurrence time corresponding to each second associated object.
[0299] In this embodiment of the application, for each sample object, the process of obtaining the adjusted feature vector corresponding to each second object can refer to the process of obtaining the adjusted feature vector corresponding to each second object for the target object as described above. The determination time of the sample object corresponds to the base time of the target object. The specific process of obtaining the adjusted feature vector will not be described here.
[0300] As an optional embodiment, the neural network model includes a first feature extraction network, a second feature extraction network, a classifier, and weight parameters to be trained. The first feature extraction network is used to extract features from the attribute information and first transaction information of the sample object in the training samples to obtain a first feature representation of the sample object. The second feature extraction network is used to extract features from the attribute information and second transaction information of the sample object in the training samples to obtain a second feature representation of the sample object. The classifier is used to predict the target feature representation to obtain a type prediction result of the sample object. The weight parameters include a first weight corresponding to the first feature representation of the sample object and a second weight corresponding to the second feature representation of the sample object.
[0301] The first feature representation and the second feature representation are fused to obtain the target feature representation of the sample object, including:
[0302] Based on the first weight and the second weight, the first feature representation and the second feature representation are weighted and fused to obtain the target feature representation of the sample object;
[0303] The model parameters of the neural network model should be adjusted based on the training loss, including:
[0304] The training loss is used to adjust the weight parameters of the first feature extraction network, the second feature extraction network, the classifier, and the network to be trained.
[0305] In this embodiment, the object classification model is obtained by training a neural network model. Therefore, the neural network model and the object classification model have the same structure, only the model parameters in the structure are different.
[0306] Specifically, the structure of the model parameters that need to be trained in the neural network model includes a first feature extraction network, a second feature extraction network, and weight parameters. As explained earlier, the weight parameters include weights and biases, which are used to represent the reweighted units in the neural network model.
[0307] The first feature extraction network can be a graph network, which is able to obtain edge features.
[0308] The second feature extraction network may include a multi-view temporal encoder, a temporal attention mechanism, and an aggregation unit. The multi-view temporal encoder, temporal attention mechanism, and aggregation unit include model parameters that need to be trained. Furthermore, the neural network model may also include a sampler and an encoder. The sampler samples a second object of the sample object, ensuring that the number of neighbors for each sample object is a first preset number. The encoder encodes attribute information and resource transfer behavior data. The sampler and encoder may not include the model parameters that need to be trained; they can be independent of the neural network model or integrated within it.
[0309] The object classification model described above can be trained using the model training method corresponding to any embodiment of this application. Using this model training method to process the dynamic interaction data and static interaction data of the object separately results in better model training. For the specific model training process, please refer to the relevant content of the above object classification model, which will not be repeated here.
[0310] like Figure 13 As shown, Figure 13 This is a flowchart illustrating a neural network model provided in an embodiment of this application. The structure of this neural network model is the same as that of the object classification model described earlier, but the model parameters are different. The input to this neural network model is multiple labeled training samples, each corresponding to a sample object. The neural network model obtains the type prediction result of the sample object by predicting its type. For the specific prediction process, please refer to the process of predicting the target object in the object classification model described earlier. Based on the type prediction results of each sample object, the training loss of the model is obtained. The model parameters are adjusted according to the training loss, and the next round of training is performed.
[0311] like Figure 14 As shown, Figure 14 This is a flowchart illustrating an object classification method provided in an embodiment of this application, including steps S501-S511.
[0312] S501. Based on the interaction diagram, the first data table, the second data table, and the third data table, obtain the object-related data of the target object;
[0313] S502. Input the object-related data into the object classification model, and encode the attribute information and resource transfer-related data in the object-related data based on the encoder to obtain node features and edge features. Construct the second graph structure and static graph based on the node features and edge features.
[0314] S503. Based on the graph neural network in the first feature network, feature extraction is performed on the static graph to obtain the first feature representation of the target object;
[0315] S504. Based on the sampler, the second graph structure is sampled to obtain a first preset number of second objects corresponding to the target object;
[0316] S505. Based on the reference time, the time of occurrence of the behavior of the target object and each second object, encode the time of occurrence of each behavior to obtain the time feature representation of the time of occurrence of each behavior of the target object and the time feature representation of the reference time.
[0317] S506. Based on the node index in the second graph structure, obtain the node features corresponding to the target object. Concatenate the node features corresponding to the target object with the time feature representation of the reference time to obtain the feature vector of the target object.
[0318] S507. Based on the node index and edge index in the second graph structure, obtain the node features corresponding to the second object and the edge features between the target object and the second object. Concatenate the node features corresponding to the second object, the edge features between the target object and the second object, and the time feature representation of the behavior occurrence time to obtain the feature representation of the target object corresponding to the second object.
[0319] S508. For each second object of the target object, determine the time feature vector of the behavior occurrence time corresponding to the second object and the correlation between the time feature vector of the behavior occurrence time corresponding to each second object. Adjust the feature vector of the target object corresponding to the second object according to the correlation to obtain the adjusted feature vector.
[0320] S509. Determine the weight of each second object relative to the target object based on the correlation between the feature vector of the target object and the adjusted feature vector of the target object corresponding to each second object.
[0321] S510. Based on the weight of each second object to the target object, the feature vector of the target object corresponding to the second object is weighted to obtain the weighted feature vector of each second object.
[0322] S511. Aggregate the weighted feature vectors of each second object to obtain the second feature representation of the target object;
[0323] S512, the first feature representation is weighted based on the reweighting unit to obtain the weighted first feature representation, and the second feature representation is weighted based on the reweighting unit to obtain the weighted second feature representation;
[0324] S513. Add and fuse the weighted first feature representation and the weighted second feature representation to obtain the target feature representation of the target object;
[0325] S514. Based on the classifier, predict the target feature representation of the target object to obtain the type prediction result of the target object.
[0326] like Figure 15 As shown, Figure 15 The flowchart of a model training method provided in this application embodiment includes steps S601-S602, wherein S602 includes steps S701-S714.
[0327] S601. Based on the interaction diagram, the first data table, the second data table, and the third data table, obtain multiple training samples with labels;
[0328] S602. The neural network model is continuously trained based on multiple training samples until the preset training termination condition is met, resulting in a trained object classification model; this training operation includes:
[0329] S701. Encode the attribute information and resource transfer related data in the training samples based on the encoder to obtain node features and edge features, and construct the first graph structure and static graph based on the node features and edge features.
[0330] S702. Based on the graph neural network in the first feature network, feature extraction is performed on the static graph to obtain the first feature representation of each sample object;
[0331] S703. Based on the sampler, the first graph structure is sampled to obtain a first preset number of second objects corresponding to each sample object;
[0332] S704. Based on the determined time, the time of occurrence of the actions of the sample object and each second object, encode the time of occurrence of each action to obtain the time feature representation of the time of occurrence of each action of the sample object and the time feature representation of the determined time.
[0333] S705. Based on the node index in the first diagram structure, obtain the node features corresponding to the sample object. Concatenate the node features corresponding to the sample object with the time feature representation of the determined time to obtain the feature vector of the sample object.
[0334] S706. Based on the node index and edge index in the first graph structure, obtain the node features corresponding to the second object and the edge features between the sample object and the second object. Concatenate the node features corresponding to the second object, the edge features between the sample object and the second object, and the time feature representation of the behavior occurrence time to obtain the feature representation of the sample object corresponding to the second object.
[0335] S707. For each second object of each sample object, determine the time feature vector of the behavior occurrence time corresponding to the second object and the correlation with the time feature vector of the behavior occurrence time corresponding to each second object. Adjust the feature vector of the sample object corresponding to the second object according to the correlation to obtain the adjusted feature vector.
[0336] S708. For each sample object, determine the weight of each second object to the sample object based on the correlation between the feature vector of the sample object and the adjusted feature vector of the sample object corresponding to each second object.
[0337] S709. For each sample object, according to the weight of each second object to the sample object, the feature vector of the sample object corresponding to the second object is weighted to obtain the weighted feature vector of each second object.
[0338] S710. For each sample object, aggregate the weighted feature vectors of each second object to obtain the second feature representation of the sample object.
[0339] S711, For each sample object, the first feature representation of the sample object is weighted based on the reweighting unit to obtain the weighted first feature representation, and the second feature representation of the sample object is weighted based on the reweighting unit to obtain the weighted second feature representation;
[0340] S712. For each sample object, the weighted first feature representation and the weighted second feature representation of the sample object are added and fused to obtain the target feature representation of the sample object.
[0341] S713. For each sample object, predict the target feature representation of each sample object based on the classifier to obtain the type prediction result of the sample object.
[0342] S714. Based on the prediction results of the labels and types corresponding to each training sample, determine the training loss, and adjust the model parameters of the neural network model according to the training loss.
[0343] like Figure 16 As shown, Figure 16This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. In this embodiment, the fourth object can be a user, the fifth object can be a merchant, the resource can be funds, the resource transfer between users can be a payment transaction, and the resource transfer between a user and a merchant can be a transaction, i.e., the user obtains corresponding goods or services by providing funds to the merchant. The third object of the target object is the merchant with whom the target user has a transaction, and the second object of the target object is a first preset number of merchants with whom the target user has a transaction. The resource management platform can be a financial platform, which provides users with a platform for making payments and transactions, as well as a platform for applying for funds.
[0344] Specifically, in this application scenario, it may include terminals corresponding to multiple users, terminals corresponding to multiple merchants, an interaction platform for interaction between users, between users and merchants, and between merchants, a resource application platform for users to apply for resources, a data association platform and corresponding database for obtaining interaction data, a type prediction platform for predicting user types, and a model training server for training models.
[0345] When user A applies for funds on a resource application platform, the platform sends a type prediction request to a type prediction platform. This request asks the type prediction platform to predict user A's type. The type prediction platform uses an object classification model trained on a model training server. Based on user A's relevant data, the platform uses this model to predict user A's type, which can be categorized into two types: those who apply for funds and repay on time, and those who apply for funds but do not repay on time. The type prediction platform then returns user A's type to the resource application platform. If user A's type is "apply for funds and repay on time," the platform approves the application and distributes the corresponding funds. If user A's type is "apply for funds and do not repay on time," the platform disapproves the application.
[0346] The model training server obtains relevant data of users who have applied for funds through the data management platform, and divides users into two categories based on whether they have repaid on time. The user type is used as a label, and the relevant user data is used as training samples. The neural network model is trained based on the labels and training samples to obtain the object classification model.
[0347] The relevant data for each user may include the user's attribute information, the attribute information of users who have made payments to that user, payment-related data for those payments, the attribute information of merchants who have transacted with that user, transaction-related data for those transactions, and the transaction time. User attribute information may include the user's age, gender, and occupation; merchant attribute information may include the type of goods or services offered by the merchant, their geographical location, and the merchant's name; payment-related data includes the payment amount or received amount; and transaction-related data includes the payment amount, the name and type of the corresponding item or service.
[0348] The baseline time can be the application time of the user applying for funds, the determination time of the user with the determined type, and the corresponding application time. The model is trained based on the data of the sample users before the application time and the corresponding type, so that the target user can be predicted based on the data of the target user before the application time, and the type of the target user can be accurately predicted.
[0349] This application provides an object classification device, such as... Figure 17 As shown, the object classification device may include: a data acquisition module 501 and a type prediction module 502, wherein,
[0350] The data acquisition module 501 is used to acquire object-related data of the target object. The object-related data includes the target object's attribute information, first transaction information, and second transaction information. The first transaction information includes the attribute information of a first object that has a resource transfer behavior with the target object, and resource transfer-related data of the resource transfer behavior. The second transaction information includes the attribute information of a second object that has a resource transfer behavior with the target object, the occurrence time of the resource transfer behavior, and resource transfer-related data. In the case of resource transfer behavior between the target object and the first object, the target object is either the resource spender or the recipient. In the case of resource transfer behavior between the target object and the second object, the target object is only the resource spender.
[0351] The type prediction module 502 is used to classify the target object based on the object-related data using a trained object classification model, and obtain the type prediction result of the target object. The type prediction result characterizes the resource expenditure capacity of the target object.
[0352] This type of prediction module 502 includes a data processing submodule 601 and a feature fusion submodule 602.
[0353] The data processing submodule 601 is used to extract features from the attribute information and first transaction information of the target object to obtain a first feature representation of the target object; and to extract features from the attribute information and second transaction information of the target object to obtain a second feature representation of the target object.
[0354] The feature fusion submodule 602 is used to fuse the first feature representation of the target object with the second feature representation of the target object to obtain the target feature representation of the target object, and to make a prediction based on the target feature representation of the target object to obtain the prediction result of this type.
[0355] As an optional embodiment of this application, the number of the second object is a first preset number. The data processing submodule extracts features from the attribute information and second transaction information of the target object to obtain a second feature representation of the target object, specifically for:
[0356] The attribute information of the target object is used to extract features, resulting in the feature vector of the target object;
[0357] For each second object of the target object, feature extraction is performed on the second transaction information corresponding to the second object to obtain the feature vector of the target object corresponding to the second object.
[0358] The weight of each second object relative to the target object is determined based on the correlation between the feature vector of the target object and the feature vectors of each second object corresponding to the target object.
[0359] Based on the weights of each second object relative to the target object, the feature vectors of the target object corresponding to the second objects are weighted and fused to obtain the second feature representation of the target object.
[0360] As an optional embodiment of this application, the data processing submodule, when performing weighted fusion on the feature vector of the target object corresponding to the second object to obtain the second feature representation of the target object, is specifically used for:
[0361] For each second object of the target object, the time of occurrence of the resource transfer behavior corresponding to the second object is extracted to obtain the time feature vector of the time of occurrence of the behavior corresponding to the second object.
[0362] The data processing submodule, when determining the weight of each second object relative to the target object based on the correlation between the feature vector of the target object and the feature vectors of each corresponding second object, specifically performs the following:
[0363] For each second object of the target object, determine the time feature vector of the behavior occurrence time corresponding to the second object, the correlation between the time feature vector of the behavior occurrence time corresponding to each second object, and adjust the feature vector of the target object corresponding to the second object according to the correlation to obtain the adjusted feature vector;
[0364] The weights of each second object relative to the target object are determined based on the correlation between the feature vector of the target object and the adjusted feature vectors of each second object corresponding to the target object.
[0365] As an optional embodiment of this application, the data processing submodule, when determining the time feature vector of the behavior occurrence time corresponding to each second object of the target object, the correlation between the time feature vector of the behavior occurrence time corresponding to each second object, and adjusting the feature vector of the target object corresponding to the second object according to the correlation to obtain the adjusted feature vector, specifically uses the following:
[0366] The adjusted feature vector is obtained using the following formula:
[0367]
[0368] Where K′ is the adjusted feature vector of the target object corresponding to each second object, and K is the feature vector of the target object corresponding to each second object; The correlation between the temporal feature vector of the behavior occurrence time corresponding to each second object and the temporal feature vector of the behavior occurrence time corresponding to each second associated object.
[0369] As an optional embodiment of this application, the time feature vector of the behavior occurrence time corresponding to each second object of the target object is determined by the data processing submodule in the following manner:
[0370] For each second object of the target object, at least one of the first feature vector, second feature vector, third feature vector or fourth feature vector of the behavior occurrence time corresponding to the second object is determined, and the time feature vector of the behavior occurrence time corresponding to the second object is obtained based on the at least one feature vector.
[0371] The object-related data of the target object includes a baseline time. The first feature vector, second feature vector, third feature vector, and fourth feature vector are obtained through the following methods:
[0372] Encode the time difference between the time of the behavior occurrence and the reference time to obtain the first feature vector of the time of the behavior occurrence.
[0373] The time of the behavior is encoded using absolute time encoding to obtain the second feature vector of the time of the behavior.
[0374] The occurrence time of the behavior is standardized using at least one preset period, and the standardized occurrence time is encoded to obtain a third feature vector;
[0375] Based on a preset time set, the time of the behavior is binarized and encoded to obtain a fourth feature vector of the behavior occurrence time. The preset time set includes multiple preset time periods. For each preset time period, if the behavior occurrence time belongs to the preset time period, the feature value corresponding to the preset time period in the fourth feature vector is the first value; if the behavior occurrence time does not belong to the preset time period, the feature value corresponding to the preset time period in the fourth feature vector is the second value.
[0376] As an optional embodiment of this application, for each second object of the target object, the time feature vector of the time when the behavior occurs corresponding to the second object is determined by the data processing submodule in the following way:
[0377] At least two of the first, second, third, or fourth feature vectors of the time when the behavior corresponding to the second object occurs are concatenated to obtain the time feature vector.
[0378] As an optional embodiment of this application, the object classification model is trained in the following manner:
[0379] Obtain multiple labeled training samples. Each training sample includes attribute information of a sample object, first transaction information of the sample object, and second transaction information of the sample object. The label of each training sample represents the object type of the corresponding sample object.
[0380] Based on these multiple training samples, the neural network model is continuously trained until the preset training termination condition is met, thus obtaining the object classification model; the training operation includes:
[0381] For each training sample, feature extraction is performed on the attribute information and first transaction information of the sample object in the training sample to obtain the first feature representation of the sample object; feature extraction is performed on the attribute information and second transaction information of the sample object in the training sample to obtain the second feature representation of the sample object; the first feature representation and the second feature representation are fused to obtain the target feature representation of the sample object; prediction is performed based on the target feature representation to obtain the type prediction result of the sample object;
[0382] Based on the prediction results of the labels and types corresponding to each training sample, the training loss is determined, and the model parameters of the neural network model are adjusted according to the training loss.
[0383] This application provides a model training device, such as... Figure 6 As shown, the object classification device may include: a sample acquisition module 701 and a model training module 702, wherein,
[0384] The sample acquisition module 701 is used to acquire multiple labeled training samples. Each training sample includes attribute information of a sample object, first transaction information, and second transaction information. The first transaction information includes attribute information of a first object that has a resource transfer behavior with the sample object, and resource transfer-related data of the resource transfer behavior. The second transaction information includes attribute information of a second object that has a resource transfer behavior with the sample object, the occurrence time of the resource transfer behavior, and resource transfer-related data. The label of each training sample represents the resource expenditure capacity of the sample object corresponding to the training sample.
[0385] The model training module 702 is used to continuously perform training operations on the neural network model based on the multiple training samples until the preset training termination condition is met, so as to obtain a trained object classification model.
[0386] The model training module 702 includes a feature extraction submodule 801 and a parameter tuning submodule 802.
[0387] The feature extraction submodule 801 is used to extract features from the attribute information and first transaction information of the sample object in each training sample to obtain a first feature representation of the sample object; extract features from the attribute information and second transaction information of the sample object in the training sample to obtain a second feature representation of the sample object; fuse the first feature representation and the second feature representation to obtain a target feature representation of the sample object; and make a prediction based on the target feature representation to obtain a type prediction result of the sample object.
[0388] The parameter adjustment submodule 802 is used to determine the training loss based on the prediction results of the label and type corresponding to each training sample, and to adjust the model parameters of the neural network model based on the training loss.
[0389] As an optional embodiment, for each training sample, the time when the object type of the sample object is determined is also included, the number of second objects of the sample object is a first preset number, and the time when the behavior corresponding to each second object occurs is before the time when the object type of the sample object is determined;
[0390] For each training sample, the feature extraction submodule, when extracting features from the attribute information and second transaction information of the sample object in the training sample to obtain the second feature representation of the sample object, is specifically used for:
[0391] The attribute information of the sample object is used to extract features, resulting in the feature vector of the sample object;
[0392] For each second object of the sample object, feature extraction is performed on the second transaction information corresponding to the second object to obtain the feature vector of the sample object corresponding to the second object.
[0393] Based on the correlation between the feature vector of the sample object and the feature vectors of each corresponding second object, the weight of each second object with respect to the sample object is determined.
[0394] Based on the weights of each second object relative to the sample object, the feature vectors of the sample object corresponding to the second object are weighted and fused to obtain the second feature representation of the sample object.
[0395] As an optional embodiment, for each sample object, the first preset number of second objects corresponding to that sample object are determined by the feature extraction submodule in the following manner:
[0396] A first graph structure is constructed, which includes multiple first nodes and multiple second nodes. Each first node represents a sample object, and each second node represents a third object that has a resource transfer behavior with at least one sample object. For the resource transfer behavior between a sample object and a third object, the sample object is only the resource provider. There are edges between the nodes corresponding to the sample object and the third object that have a resource transfer behavior. Each first node and each edge in the first graph structure has its own timestamp. The timestamp of the first node indicates the time when the object type of the corresponding sample object is determined, and the timestamp of the edge indicates the time when the behavior of the two nodes connected by the edge occurs.
[0397] For each sample object, based on the timestamp of the first node corresponding to the sample object in the first graph structure and the timestamp of each edge connecting the first node, the second nodes connected by each edge are sampled to obtain the first preset number of second nodes connected by each edge whose timestamp is earlier than the timestamp of the first node connected by the edge. The third objects corresponding to each sampled second node are determined as the second objects of the sample object.
[0398] As an optional embodiment, for each training sample, the feature extraction submodule, when extracting features from the attribute information and second transaction information of the sample object in the training sample to obtain the second feature representation of the sample object, is further used for:
[0399] For each second object of the sample object, the time of occurrence of the resource transfer behavior corresponding to the second object is extracted to obtain the time feature vector of the time of occurrence of the behavior corresponding to the second object.
[0400] The weights of each second object relative to the sample object are determined based on the correlation between the feature vector of the sample object and the feature vectors of each corresponding second object, including:
[0401] For each second object of the sample object, determine the time feature vector of the behavior occurrence time corresponding to the second object, and the correlation between the time feature vector of the behavior occurrence time corresponding to each second object. Based on the correlation, adjust the feature vector of the sample object corresponding to the second object to obtain the adjusted feature vector.
[0402] The weights of each second object relative to the sample object are determined based on the correlation between the feature vector of the sample object and the adjusted feature vectors of the sample object corresponding to each second object.
[0403] As an optional embodiment, for each second object of the sample object, the feature extraction submodule, when determining the temporal feature vector of the behavior occurrence time corresponding to the second object and its correlation with the temporal feature vector of the behavior occurrence time corresponding to each second object, and adjusting the feature vector of the sample object corresponding to the second object based on the correlation to obtain the adjusted feature vector, specifically uses the following:
[0404] The adjusted feature vector is obtained using the following formula:
[0405]
[0406] Where K′ is the adjusted feature vector of the sample object corresponding to each second object, and K is the feature vector of the sample object corresponding to each second object; The correlation between the temporal feature vector of the behavior occurrence time corresponding to each second object and the temporal feature vector of the behavior occurrence time corresponding to each second associated object.
[0407] As an optional embodiment, for each sample object, the temporal feature vector of the time of occurrence of the behavior corresponding to each second object of that sample object is determined by the feature extraction submodule in the following way:
[0408] For each second object of the sample object, at least one of the first feature vector, second feature vector, third feature vector or fourth feature vector of the behavior occurrence time corresponding to the second object is determined, and the time feature vector of the behavior occurrence time corresponding to the second object is obtained based on the at least one feature vector.
[0409] The first, second, third, and fourth eigenvectors were obtained in the following ways:
[0410] The time of the action is encoded using absolute time encoding to obtain the first feature vector of the time of the action.
[0411] Encode the time difference between the time when the behavior occurs and the time when the object type of the sample object is determined to obtain the second feature vector of the time when the behavior occurs.
[0412] The occurrence time of the behavior is standardized using at least one preset period, and the standardized occurrence time is encoded to obtain a third feature vector;
[0413] Based on a preset time set, the time of the behavior is binarized and encoded to obtain a fourth feature vector of the behavior occurrence time. The preset time set includes multiple preset time periods. For each preset time period, if the behavior occurrence time belongs to the preset time period, the feature value corresponding to the preset time period in the fourth feature vector is the first value; if the behavior occurrence time does not belong to the preset time period, the feature value corresponding to the preset time period in the fourth feature vector is the second value.
[0414] As an optional embodiment, for each second object of each sample object, the temporal feature vector of the time when the behavior occurs corresponding to the second object is determined by the feature extraction submodule in the following way:
[0415] At least two of the first, second, third, or fourth feature vectors of the time when the behavior corresponding to the second object occurs are concatenated to obtain the time feature vector.
[0416] As an optional embodiment, the neural network model includes a first feature extraction network, a second feature extraction network, a classifier, and weight parameters to be trained. The first feature extraction network is used to extract features from the attribute information and first transaction information of the sample object in the training samples to obtain a first feature representation of the sample object. The second feature extraction network is used to extract features from the attribute information and second transaction information of the sample object in the training samples to obtain a second feature representation of the sample object. The classifier is used to predict the target feature representation to obtain a type prediction result of the sample object. The weight parameters include a first weight corresponding to the first feature representation of the sample object and a second weight corresponding to the second feature representation of the sample object.
[0417] When the feature extraction submodule fuses the first feature representation with the second feature representation to obtain the target feature representation of the sample object, it is specifically used for:
[0418] Based on the first weight and the second weight, the first feature representation and the second feature representation are weighted and fused to obtain the target feature representation of the sample object;
[0419] The model parameters of the neural network model should be adjusted based on the training loss, including:
[0420] The training loss is used to adjust the weight parameters of the first feature extraction network, the second feature extraction network, the classifier, and the network to be trained.
[0421] The apparatus in this application embodiment can execute the method provided in this application embodiment, and the implementation principle is similar. The actions performed by each module in the apparatus of each embodiment of this application correspond to the steps in the method of each embodiment of this application. For detailed functional descriptions of each module of the apparatus, please refer to the descriptions in the corresponding methods shown above, which will not be repeated here.
[0422] This application provides an electronic device, including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of an object classification method and a model training method. Compared with related technologies, it can achieve the following: when acquiring object-related data of a target object, it acquires resource transfer-related data corresponding to the resource transfer behavior of the target object and each first object without acquiring the corresponding time information, in order to prevent the noise influence of time information on static interaction data; when acquiring resource transfer-related data corresponding to the resource transfer behavior of the target object and each second object, it acquires the corresponding time information, in order to obtain the correlation between resource transfer data and time, and enhance the utilization of time-series information; based on the trained object classification model, it fuses the first feature representation corresponding to the static interaction relationship of the target object and the second feature representation corresponding to the dynamic interaction relationship to obtain the target user type prediction result. This prediction process utilizes the static interaction relationship of the target object and improves the accuracy of determining the sample object type.
[0423] In one alternative embodiment, an electronic device is provided, such as Figure 19 As shown, Figure 19 The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of this application.
[0424] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0425] Bus 4002 may include a pathway for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 19 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0426] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.
[0427] The memory 4003 stores computer programs that execute embodiments of this application, and its execution is controlled by the processor 4001. The processor 4001 executes the computer programs stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.
[0428] Among them, electronic devices may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 19 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0429] This application provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program can implement the steps and corresponding content of the aforementioned method embodiments. Compared with the prior art, it can achieve the following: when acquiring object-related data of a target object, resource transfer-related data corresponding to the resource transfer behavior of the target object and each first object is acquired without acquiring the corresponding time information, in order to prevent the noise influence of time information on the static interaction data; when acquiring resource transfer-related data corresponding to the resource transfer behavior of the target object and each second object, the corresponding time information is acquired to obtain the correlation between resource transfer data and time, thereby enhancing the utilization of time-series information; based on the trained object classification model, the first feature representation corresponding to the static interaction relationship of the target object and the second feature representation corresponding to the dynamic interaction relationship are fused to obtain the target user type prediction result. This prediction process utilizes the static interaction relationship of the target object, improving the accuracy of determining the sample object type.
[0430] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium, a computer-readable medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0431] This application also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments. Compared with the prior art, it can achieve the following: when acquiring object-related data of a target object, acquiring resource transfer-related data corresponding to the resource transfer behavior of the target object and each first object without acquiring the corresponding time information, to prevent the noise influence of time information on static interaction data; when acquiring resource transfer-related data corresponding to the resource transfer behavior of the target object and each second object, acquiring the corresponding time information, to obtain the correlation between resource transfer data and time, and enhancing the utilization of time-series information; based on the trained object classification model, fusing the first feature representation corresponding to the static interaction relationship of the target object and the second feature representation corresponding to the dynamic interaction relationship, to obtain the target user type prediction result. This prediction process utilizes the static interaction relationship of the target object, improving the accuracy of determining the sample object type.
[0432] The terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the figures or text.
[0433] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.
[0434] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.
Claims
1. An object classification method, characterized in that, The method includes: Acquire object-related data of the target object, including attribute information, first transaction information, and second transaction information of the target object. The first transaction information includes attribute information of a first object that has a resource transfer relationship with the target object, and resource transfer-related data of the resource transfer relationship. The second transaction information includes attribute information of a second object that has a resource transfer relationship with the target object, the occurrence time of the resource transfer relationship, and resource transfer-related data. Specifically, for the resource transfer relationship between the target object and the first object, the target object is either the resource spender or the recipient; for the resource transfer relationship between the target object and the second object, the target object is only the resource spender. Based on the object-related data, a trained object classification model is used to classify the target object, resulting in a type prediction result. This type prediction result characterizes the resource expenditure capacity of the target object. The classification operation includes: Feature extraction is performed on the attribute information and first transaction information of the target object to obtain a first feature representation of the target object; feature extraction is performed on the attribute information and second transaction information of the target object to obtain a second feature representation of the target object. The first feature representation of the target object is fused with the second feature representation of the target object to obtain the target feature representation of the target object. Based on the target feature representation of the target object, a prediction is made to obtain the type prediction result.
2. The method according to claim 1, characterized in that, The number of the second objects is a first preset number. The step of extracting features from the attribute information and second transaction information of the target objects to obtain a second feature representation of the target objects includes: The attribute information of the target object is used to extract features to obtain the feature vector of the target object; For each second object of the target object, feature extraction is performed on the second transaction information corresponding to the second object to obtain the feature vector of the target object corresponding to the second object. Based on the correlation between the feature vector of the target object and the feature vectors of each second object corresponding to the target object, the weight of each second object with respect to the target object is determined. Based on the weights of each second object relative to the target object, the feature vectors of the target object corresponding to the second object are weighted and fused to obtain the second feature representation of the target object.
3. The method according to claim 2, characterized in that, The step of extracting features from the attribute information and second transaction information of the target object to obtain the second feature representation of the target object further includes: For each second object of the target object, the time of occurrence of the resource transfer behavior corresponding to the second object is extracted to obtain the time feature vector of the time of occurrence of the behavior corresponding to the second object. The step of determining the weight of each second object relative to the target object based on the correlation between the feature vector of the target object and the feature vectors of each second object corresponding to the target object includes: For each second object of the target object, determine the time feature vector of the behavior occurrence time corresponding to the second object, and the correlation between the time feature vector of the behavior occurrence time corresponding to each second object, and adjust the feature vector of the target object corresponding to the second object according to the correlation to obtain the adjusted feature vector; The weights of each second object relative to the target object are determined based on the correlation between the feature vector of the target object and the adjusted feature vectors of each second object corresponding to the target object.
4. The method according to claim 3, characterized in that, For each second object of the target object, the time feature vector of the behavior occurrence time corresponding to the second object is determined, and the correlation between the time feature vector of the behavior occurrence time corresponding to each second object is determined. The feature vector of the target object corresponding to the second object is adjusted according to the correlation to obtain the adjusted feature vector, including: The adjusted feature vector is obtained using the following formula: Among them, K ′ K is the adjusted feature vector of the target object corresponding to each second object; The correlation between the temporal feature vector of the behavior occurrence time corresponding to each second object and the temporal feature vector of the behavior occurrence time corresponding to each second associated object.
5. The method according to claim 3, characterized in that, The temporal feature vector of the behavior occurrence time corresponding to each second object of the target object is determined in the following way: For each second object of the target object, at least one of the first feature vector, second feature vector, third feature vector or fourth feature vector of the behavior occurrence time corresponding to the second object is determined, and the time feature vector of the behavior occurrence time corresponding to the second object is obtained according to the at least one feature vector. The object-related data of the target object includes a baseline time. The first feature vector, second feature vector, third feature vector, and fourth feature vector are obtained through the following methods: Encode the time difference between the time of the behavior occurrence and the reference time to obtain a first feature vector of the time of the behavior occurrence. The time of the behavior is encoded using absolute time encoding to obtain a second feature vector of the time of the behavior. The occurrence time of the behavior is standardized using at least one preset period, and the standardized occurrence time of the behavior is encoded to obtain a third feature vector; According to a preset time set, the time of the behavior occurrence is binarized and encoded to obtain a fourth feature vector of the behavior occurrence time. The preset time set includes multiple preset time periods. For each preset time period, if the behavior occurrence time belongs to the preset time period, the feature value corresponding to the preset time period in the fourth feature vector is a first value. If the behavior occurrence time does not belong to the preset time period, the feature value corresponding to the preset time period in the fourth feature vector is a second value.
6. The method according to claim 5, characterized in that, For each second object of the target object, the temporal feature vector of the time when the behavior of the corresponding second object occurs is determined in the following way: At least two of the first, second, third, or fourth feature vectors of the time when the behavior corresponding to the second object occurs are concatenated to obtain the time feature vector.
7. The method according to claim 1, characterized in that, The object classification model was trained in the following way: Obtain multiple training samples with labels, each training sample including attribute information of a sample object, first transaction information of the sample object, and second transaction information of the sample object; the label of each training sample represents the object type of the corresponding sample object; The neural network model is continuously trained based on the multiple training samples until the preset training termination condition is met, thereby obtaining the object classification model. The training operations include: For each training sample, feature extraction is performed on the attribute information and first transaction information of the sample object in the training sample to obtain the first feature representation of the sample object; Feature extraction is performed on the attribute information and second transaction information of the sample objects in the training sample to obtain the second feature representation of the sample objects. The first feature representation and the second feature representation are fused to obtain the target feature representation of the sample objects. Based on the target feature representation, a prediction is made to obtain the type prediction result of the sample objects. Based on the label and type prediction results corresponding to each training sample, the training loss is determined, and the model parameters of the neural network model are adjusted according to the training loss.
8. A model training method, characterized in that, include: Multiple labeled training samples are obtained. Each training sample includes attribute information of a sample object, first transaction information, and second transaction information. The first transaction information includes attribute information of a first object that has a resource transfer behavior with the sample object, and resource transfer-related data of the resource transfer behavior. The second transaction information includes attribute information of a second object that has a resource transfer behavior with the sample object, the occurrence time of the resource transfer behavior, and resource transfer-related data. The label of each training sample represents the resource expenditure capacity of the sample object corresponding to the training sample. The neural network model is continuously trained based on the multiple training samples until the preset training termination condition is met, and a well-trained object classification model is obtained. The training operations include: For each training sample, feature extraction is performed on the attribute information and first transaction information of the sample object in the training sample to obtain the first feature representation of the sample object; Feature extraction is performed on the attribute information and second transaction information of the sample objects in the training sample to obtain the second feature representation of the sample objects; the first feature representation and the second feature representation are fused to obtain the target feature representation of the sample objects; and prediction is performed based on the target feature representation to obtain the type prediction result of the sample objects. Based on the label and type prediction results corresponding to each training sample, the training loss is determined, and the model parameters of the neural network model are adjusted according to the training loss.
9. The method according to claim 8, characterized in that, For each training sample, the time when the object type of the sample object is determined is also included, the number of second objects of the sample object is a first preset number, and the time when the behavior corresponding to each second object occurs is before the time when the object type of the sample object is determined. For each of the sample objects, the first preset number of second objects corresponding to that sample object are determined in the following manner: Construct a first graph structure, which includes multiple first nodes and multiple second nodes. Each first node represents a sample object, and each second node represents a third object that has a resource transfer behavior with at least one sample object. For the resource transfer behavior between the sample object and the third object, the sample object is only the resource spender. There are connecting edges between the sample object with resource transfer behavior and the node corresponding to the third object. Each first node and each connecting edge in the first graph structure has its own timestamp. The timestamp of the first node indicates the time when the object type of the corresponding sample object is determined, and the timestamp of the connecting edge indicates the time when the behavior of the two nodes connected by the connecting edge occurs. For each sample object, based on the timestamp of the first node corresponding to the sample object in the first graph structure and the timestamp of each edge connecting the first node, the second nodes connected by each edge are sampled to obtain the first preset number of second nodes connected by each edge whose timestamp is earlier than the timestamp of the first node connected by the edge. The third object corresponding to each sampled second node is determined as the second object of the sample object.
10. The method according to claim 8, characterized in that, The neural network model includes a first feature extraction network, a second feature extraction network, a classifier, and weight parameters to be trained. The first feature extraction network is used to extract features from the attribute information and first transaction information of the sample object in the training sample to obtain a first feature representation of the sample object. The second feature extraction network is used to extract features from the attribute information and second transaction information of the sample object in the training sample to obtain a second feature representation of the sample object. The classifier is used to predict the target feature representation to obtain a type prediction result of the sample object. The weight parameters include a first weight corresponding to the first feature representation of the sample object and a second weight corresponding to the second feature representation of the sample object. The step of fusing the first feature representation and the second feature representation to obtain the target feature representation of the sample object includes: Based on the first weight and the second weight, the first feature representation and the second feature representation are weighted and fused to obtain the target feature representation of the sample object; The step of adjusting the model parameters of the neural network model based on the training loss includes: The training loss is used to adjust the weight parameters of the first feature extraction network, the second feature extraction network, the classifier, and the network to be trained.
11. An object classification device, characterized in that, include: The data acquisition module is used to acquire object-related data of the target object. The object-related data includes attribute information of the target object, first transaction information, and second transaction information. The first transaction information includes attribute information of a first object that has a resource transfer relationship with the target object, and resource transfer-related data of the resource transfer relationship. The second transaction information includes attribute information of a second object that has a resource transfer relationship with the target object, the occurrence time of the resource transfer relationship, and resource transfer-related data. Specifically, for the resource transfer relationship between the target object and the first object, the target object is either the resource spender or the recipient; for the resource transfer relationship between the target object and the second object, the target object is only the resource spender. The type prediction module is used to classify the target object based on the object-related data using a trained object classification model, and obtain the type prediction result of the target object. The type prediction result characterizes the resource expenditure capacity of the target object. The type prediction module includes: The data processing submodule is used to extract features from the attribute information and first transaction information of the target object to obtain a first feature representation of the target object; and to extract features from the attribute information and second transaction information of the target object to obtain a second feature representation of the target object. The feature fusion submodule is used to fuse the first feature representation of the target object with the second feature representation of the target object to obtain the target feature representation of the target object, and to make a prediction based on the target feature representation of the target object to obtain the type prediction result.
12. A model training device, characterized in that, include: The sample acquisition module is used to acquire multiple labeled training samples. Each training sample includes attribute information of a sample object, first transaction information, and second transaction information. The first transaction information includes attribute information of a first object that has a resource transfer behavior with the sample object, and resource transfer-related data of the resource transfer behavior. The second transaction information includes attribute information of a second object that has a resource transfer behavior with the sample object, the occurrence time of the resource transfer behavior, and resource transfer-related data. The label of each training sample represents the resource expenditure capacity of the sample object corresponding to the training sample. The model training module is used to continuously perform training operations on the neural network model based on the multiple training samples until the preset training termination condition is met, so as to obtain a trained object classification model. The model training module includes: The feature extraction submodule is used to extract features from the attribute information and first transaction information of the sample object in each training sample to obtain a first feature representation of the sample object; extract features from the attribute information and second transaction information of the sample object in the training sample to obtain a second feature representation of the sample object; fuse the first feature representation and the second feature representation to obtain a target feature representation of the sample object; and make a prediction based on the target feature representation to obtain a type prediction result of the sample object. The parameter adjustment submodule is used to determine the training loss based on the label and type prediction results corresponding to each training sample, and to adjust the model parameters of the neural network model according to the training loss.
13. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1-10.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-10.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-10.