Label generation method and device for multi-source personnel data

CN122986507APending Publication Date: 2026-10-27GUANGZHOU HUISI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611149049.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0003]然而,大多数传统多标签分类模型倾向于将各标签预测视为相互独立的任务,未充分考虑现实场景中标签之间存在的强弱关联和共现规律

Benefits of technology

[0018]本发明通过融合基于数据统计得到的先验标签关联矩阵与基于分类权重生成的模型隐含标签关联矩阵,能够同时利用静态共现先验和训练过程中形成的动态关联信息,更准确地刻画各画像标签之间的依赖关系。在模型训练阶段,将倒数第二层梯度投影至中间层梯度的正交补空间,生成用于表征高阶特征更新方向的阶梯式梯度,从而缓解多标签联合训练过程中不同标签梯度方向冲突的问题,减少标签特征提取过程中的相互干扰。进一步地,基于融合后的时变关联矩阵构建上下文感知目标梯度,并结合由初始预测概率确定的调制因子,对阶梯式梯度与上下文感知目标梯度之间的偏差进行加权约束,形成梯度正则化项,以精细化引导网络参数的更新方向和更新幅度。由此,本发明能够充分挖掘跨标签上下文信息,实现对不同画像标签的差异化协同优化,提升人员画像标签生成结果的准确性、连贯性和可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122986507A_ABST
    Figure CN122986507A_ABST
Patent Text Reader

Abstract

The application provides a label generation method and device for multi-source personnel data, comprising obtaining a training set with user characteristics and labels, building a four-layer neural network, and constructing a prior label correlation matrix representing label conditional probability based on label co-occurrence relationship; inputting user characteristics to obtain initial prediction probability of labels, and total loss containing basic classification loss and gradient regularization term: first projecting label gradient to orthogonal complement space to obtain step gradient, obtaining time-varying correlation matrix by fusing model implicit label matrix and prior matrix, and obtaining context-aware target gradient by weighted aggregation; combining prediction probability modulation factor, weighted summing label-by-label deviation between the step gradient and the context-aware target gradient to obtain the gradient regularization term; updating network parameters according to the total loss, periodically updating the time-varying correlation matrix, and outputting personnel portrait labels after training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of personnel data, and in particular relates to a method and apparatus for generating labels for multi-source personnel data. Background Technology

[0002] With the rapid development of the big data era and the mobile internet, massive amounts of data have provided rich opportunities for value mining across various industries. Among these, user profiling, as a crucial technology for understanding user needs and characterizing user traits, plays a vital role in applications such as personalized recommendations, precision marketing, intelligent risk control, and content distribution. User profiling typically involves analyzing multi-dimensional user feature data to assign users a series of tags that summarize their natural attributes, social attributes, behavioral habits, and interests. Since the same user often possesses multiple dimensions of features in real-world scenarios, user profiling tag generation is a typical multi-label classification task in machine learning and artificial intelligence. In recent years, relying on their strong non-linear fitting and feature extraction capabilities, deep neural networks have been widely applied in the user profiling process, achieving improvements in the accuracy and stability of generating tags from massive amounts of user data.

[0003] However, most traditional multi-label classification models tend to treat label prediction as an independent task, failing to fully consider the strong and weak correlations and co-occurrence patterns between labels in real-world scenarios. For example, there is often an inherent logical correlation between a user's "specific occupational attribute" and "a certain type of consumption preference." Ignoring such cross-label relationships can easily lead to a lack of coherence and rationality in the label combinations generated by the model. While some methods attempt to construct prior associations using statistical data to assist label judgment, these associations are usually static and fixed, making it difficult for them to dynamically evolve as the model's understanding of the implicit features of the data deepens during training. Furthermore, in the backpropagation stage of multi-layer neural networks jointly optimizing multiple labels, the gradient update directions generated by different labels may conflict or interfere with each other, easily causing instability in the model training process and weakening the model's ability to perceive contextual structural features and its generalization ability, leading the model to get stuck in local optima. Therefore, how to integrate dynamic and static label associations and collaboratively optimize network parameters through gradient normalization mechanisms to improve the accuracy and reliability of personnel profile label generation is a pressing technical problem that needs to be solved in this field. Summary of the Invention

[0004] According to one aspect of the present invention, a method for generating labels for multi-source personnel data is proposed to address the problem of how to integrate the correlation between dynamic and static labels and to collaboratively optimize network parameters through a gradient normalization mechanism, thereby improving the accuracy and reliability of personnel profile label generation. The method includes the following steps: Obtain a training set containing user features and corresponding labels, construct a neural network containing an input layer, an intermediate layer, a penultimate layer and an output layer. The output layer outputs the label prediction probability. Calculate a prior label association matrix based on the label co-occurrence relationship of the training set. The elements of the prior label association matrix represent the conditional probability of the target label appearing under a given source label. The user features are input into the neural network for forward propagation to obtain the initial prediction probability of each label. The total loss, including the basic classification loss and the gradient regularization term, is calculated. The gradient regularization term is determined by calculating the gradient of the classification loss of each label with respect to the activation values ​​of the penultimate layer and the intermediate layer, respectively. The penultimate layer gradient of each label is projected onto the orthogonal complement space of the gradient of the corresponding intermediate layer to obtain the step gradient. The model latent label association matrix is ​​periodically calculated based on the classification weight vector corresponding to each label in the output layer. The model latent label association matrix and the prior label association matrix are fused to generate a time-varying association matrix. The step gradient is weighted and aggregated according to the time-varying association matrix to obtain the context-aware target gradient. The modulation factor is calculated based on the initial prediction probability of each label. The gradient regularization term is obtained by weighted summation of the deviation between the step gradient and the context-aware target gradient. The parameters of the neural network are updated by backpropagation based on the total loss, and the time-varying correlation matrix is ​​updated periodically. Personnel profile labels are generated using the trained neural network.

[0005] Optionally, the step of obtaining a training set containing user features and corresponding labels, and constructing a neural network containing an input layer, an intermediate layer, a penultimate layer, and an output layer, wherein the output layer outputs the label prediction probability, includes: The receiving nodes of the input layer are configured according to the dimensionality of the user feature data. Hidden layer features are extracted through at least one fully connected layer as the intermediate layer. The penultimate layer is set as the higher-order feature extraction layer. The output layer uses a non-linear mapping function to convert the features into label prediction probabilities.

[0006] Optionally, the calculation of the prior label association matrix based on the label co-occurrence relationship of the training set, wherein the elements of the prior label association matrix represent the conditional probability of the target label appearing given a source label, includes: The total number of times each label appears independently in the training set and the number of times any two labels co-occur together are counted. The co-occurrence count of the two labels is divided by the number of times the source label appears independently to obtain the conditional probability of the target label appearing under a given source label. Based on this, the prior label association matrix is ​​constructed.

[0007] Optionally, the step of calculating the gradient of the classification loss of each label with respect to the activation values ​​of the penultimate layer and the intermediate layer, and projecting the penultimate layer gradient of each label onto the orthogonal complement space of the corresponding intermediate layer gradient to obtain the step gradient includes: For each label, the dimension alignment matrix is ​​multiplied by the intermediate layer gradient of the label to obtain the aligned intermediate layer gradient. Calculate the inner product of the penultimate gradient of the label and the aligned intermediate gradient, and divide the inner product by the square of the L2 norm of the aligned intermediate gradient to obtain the projection coefficient; The projection coefficients are multiplied by the aligned intermediate layer gradient to obtain the projection components; Subtract the projection component from the penultimate gradient of the label to obtain the step gradient of the label.

[0008] Optionally, the periodicity involves calculating the model's latent label association matrix based on the classification weight vectors corresponding to each label in the output layer, and fusing the model's latent label association matrix with the prior label association matrix to generate a time-varying association matrix, including: Obtain a preset decay coefficient greater than 0, and calculate the negative exponential function value of the product of the preset decay coefficient and the current training step number as the decay weight; The first matrix component is obtained by multiplying the attenuation weights by the prior label association matrix, and the second matrix component is obtained by multiplying the attenuation weights by the model latent label association matrix. The time-varying correlation matrix is ​​obtained by adding the first matrix component to the model's implicit label correlation matrix and then subtracting the second matrix component.

[0009] Optionally, obtaining the context-aware target gradient by weighted aggregation of the step gradient based on the time-varying correlation matrix includes: For any target label, obtain the conditional association weights of each label in the time-varying association matrix other than the target label to the target label; The conditional association weights of the remaining labels are multiplied by the step gradients of the corresponding remaining labels to obtain the weighted gradients. Summing all the weighted gradients yields the context-aware target gradient of the target label.

[0010] Optionally, the step of calculating the modulation factor based on the initial prediction probabilities of each label, and obtaining the gradient regularization term by weighted summation of the deviations between the step gradient and the context-aware target gradient, includes: For each label, calculate the difference vector between the step gradient of the label and the gradient of the context-aware target, and calculate the square of the L2 norm of the difference vector; The regularization component of the label is obtained by multiplying the square of the L2 norm of the difference vector with the prediction confidence modulation factor of the label. The gradient regularization term is obtained by summing the regularization components of all labels. The gradient regularization term is the cross-label relationship gradient regularization term.

[0011] According to another aspect of the present invention, a tag generation apparatus for multi-source personnel data is provided, comprising the following modules: The module is used to acquire a training set containing user features and corresponding labels, construct a neural network containing an input layer, an intermediate layer, a penultimate layer and an output layer. The output layer outputs the label prediction probability. Based on the label co-occurrence relationship of the training set, a prior label association matrix is ​​calculated. The elements of the prior label association matrix represent the conditional probability of the target label appearing under a given source label. The calculation module is used to input the user features into the neural network for forward propagation to obtain the initial prediction probability of each label, calculate the total loss including the basic classification loss and the gradient regularization term, wherein the gradient regularization term is determined by calculating the gradient of the classification loss of each label with respect to the activation values ​​of the penultimate layer and the intermediate layer respectively, projecting the penultimate layer gradient of each label onto the orthogonal complement space of the gradient of the corresponding intermediate layer to obtain the step gradient, periodically calculating the model latent label association matrix based on the classification weight vector corresponding to each label in the output layer, fusing the model latent label association matrix with the prior label association matrix to generate a time-varying association matrix, weighting and aggregating the step gradient according to the time-varying association matrix to obtain the context-aware target gradient, calculating the modulation factor based on the initial prediction probability of each label, and weighted summing the deviation between the step gradient and the context-aware target gradient to obtain the gradient regularization term; The generation module is used to update the parameters of the neural network based on the total loss through backpropagation, and periodically update the time-varying correlation matrix, and generate personnel profile labels using the trained neural network.

[0012] Preferably, the step of obtaining a training set containing user features and corresponding labels, constructing a neural network containing an input layer, an intermediate layer, a penultimate layer, and an output layer, wherein the output layer outputs the label prediction probability, includes: The receiving nodes of the input layer are configured according to the dimensionality of the user feature data. Hidden layer features are extracted through at least one fully connected layer as the intermediate layer. The penultimate layer is set as the higher-order feature extraction layer. The output layer uses a non-linear mapping function to convert the features into label prediction probabilities.

[0013] Preferably, the calculation of the prior label association matrix based on the label co-occurrence relationship of the training set, wherein the elements of the prior label association matrix represent the conditional probability of the target label appearing given a source label, includes: The total number of times each label appears independently in the training set and the number of times any two labels co-occur together are counted. The co-occurrence count of the two labels is divided by the number of times the source label appears independently to obtain the conditional probability of the target label appearing under a given source label. Based on this, the prior label association matrix is ​​constructed.

[0014] Preferably, the step of calculating the gradient of the classification loss of each label with respect to the activation values ​​of the penultimate layer and the intermediate layer, and projecting the penultimate layer gradient of each label onto the orthogonal complement space of the corresponding intermediate layer gradient to obtain a step gradient includes: For each label, the dimension alignment matrix is ​​multiplied by the intermediate layer gradient of the label to obtain the aligned intermediate layer gradient. Calculate the inner product of the penultimate gradient of the label and the aligned intermediate gradient, and divide the inner product by the square of the L2 norm of the aligned intermediate gradient to obtain the projection coefficient; The projection coefficients are multiplied by the aligned intermediate layer gradient to obtain the projection components; Subtract the projection component from the penultimate gradient of the label to obtain the step gradient of the label.

[0015] Preferably, the periodic calculation of the model latent label association matrix based on the classification weight vectors corresponding to each label in the output layer, and the fusion of the model latent label association matrix with the prior label association matrix to generate a time-varying association matrix, includes: Obtain a preset decay coefficient greater than 0, and calculate the negative exponential function value of the product of the preset decay coefficient and the current training step number as the decay weight; The first matrix component is obtained by multiplying the attenuation weights by the prior label association matrix, and the second matrix component is obtained by multiplying the attenuation weights by the model latent label association matrix. The time-varying correlation matrix is ​​obtained by adding the first matrix component to the model's implicit label correlation matrix and then subtracting the second matrix component.

[0016] Preferably, the step of obtaining the context-aware target gradient by weighted aggregation of the step gradient based on the time-varying correlation matrix includes: For any target label, obtain the conditional association weights of each label in the time-varying association matrix other than the target label to the target label; The conditional association weights of the remaining labels are multiplied by the step gradients of the corresponding remaining labels to obtain the weighted gradients. Summing all the weighted gradients yields the context-aware target gradient of the target label.

[0017] Preferably, the step of calculating the modulation factor based on the initial prediction probability of each label, and obtaining the gradient regularization term by weighted summation of the deviations between the step gradient and the context-aware target gradient, includes: For each label, calculate the difference vector between the step gradient of the label and the gradient of the context-aware target, and calculate the square of the L2 norm of the difference vector; The regularization component of the label is obtained by multiplying the square of the L2 norm of the difference vector with the prediction confidence modulation factor of the label. The gradient regularization term is obtained by summing the regularization components of all labels. The gradient regularization term is the cross-label relationship gradient regularization term.

[0018] This invention, by fusing a prior label association matrix obtained from data statistics with a model latent label association matrix generated from classification weights, can simultaneously utilize static co-occurrence priors and dynamic association information formed during training to more accurately characterize the dependencies between various profile labels. During model training, the penultimate layer gradient is projected onto the orthogonal complement space of the intermediate layer gradients to generate a step gradient representing the direction of higher-order feature updates. This alleviates the problem of conflicting gradient directions between different labels during multi-label joint training and reduces mutual interference during label feature extraction. Furthermore, a context-aware target gradient is constructed based on the fused time-varying association matrix. Combined with a modulation factor determined by the initial prediction probability, the deviation between the step gradient and the context-aware target gradient is weighted and constrained to form a gradient regularization term, which refines the direction and magnitude of network parameter updates. Therefore, this invention can fully exploit cross-label contextual information, achieve differentiated collaborative optimization of different profile labels, and improve the accuracy, consistency, and reliability of personnel profile label generation results. Attached Figure Description

[0019] Figure 1 A flowchart of the first embodiment; Figure 2 This is a schematic diagram of the decay weight change curve under the number of training iterations. Detailed Implementation

[0020] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0021] In the first embodiment, the present invention proposes a method for generating labels for multi-source personnel data, such as... Figure 1 It includes the following steps: S1. Obtain a training set containing user features and corresponding labels, construct a neural network containing an input layer, an intermediate layer, a penultimate layer, and an output layer. The output layer outputs the label prediction probability. Calculate a prior label association matrix based on the label co-occurrence relationship of the training set. The elements of the prior label association matrix represent the conditional probability of the target label appearing under a given source label.

[0022] The dataset is obtained by reading a tabular file containing user features and labels, and then divided into training and testing sets. A multi-layer neural network model is constructed using the `torch.nn.Module` class of the PyTorch framework. The input layer is configured as a Linear layer receiving user feature vectors; the intermediate layers are configured as cascaded Linear layers, BatchNorm1d batch normalization layers, and ReLU activation functions; the penultimate layer is configured as a Linear layer outputting higher-order feature representations; and the output layer is configured as a Linear layer to output the unactivated linear values ​​(logits) corresponding to each label. These unactivated linear values ​​are then transformed using the Sigmoid function and used as the predicted probabilities for each label. The unactivated linear values ​​are used when calculating the basic classification loss during training, and the label prediction probabilities transformed by the Sigmoid function are used during inference or probability output. Initialize the label co-occurrence matrix, traverse the label vectors in the training set, accumulate the number of samples where each pair of labels is 1 to obtain the co-occurrence matrix, count the total number of occurrences of each source label, divide the element of each row of the co-occurrence matrix by the total number of occurrences of the corresponding source label, calculate the conditional probability of the target label appearing under a given source label, and generate the prior label association matrix.

[0023] In an optional embodiment, the step of obtaining a training set containing user features and corresponding labels, constructing a neural network containing an input layer, an intermediate layer, a penultimate layer, and an output layer, wherein the output layer outputs the label prediction probability, includes: The receiving nodes of the input layer are configured according to the dimensionality of the user feature data. Hidden layer features are extracted through at least one fully connected layer as the intermediate layer. The penultimate layer is set as the higher-order feature extraction layer. The output layer uses a non-linear mapping function to convert the features into label prediction probabilities.

[0024] The neural network structure, comprising an input layer, intermediate layer, penultimate layer, and output layer, is a multilayer perceptron or a similar feedforward neural network. The input to this neural network is a dense vector of user features, concatenated after multimodal encoding. The output is the predicted probability value of each user profile label to be predicted. When constructing a multilayer perceptron or similar feedforward neural network, the specific dimensionality of the user features must be clearly defined. For example, assuming the input user profile features include age, income, browsing preferences, etc., which are multimodally encoded and concatenated into a 512-dimensional dense vector, the input layer is configured with 512 receiving nodes. At least one fully connected layer is connected after the input layer to perform shallow hidden layer feature extraction to construct the intermediate layer. For example, a fully connected layer with 256 nodes can be used, along with a ReLU activation function and a Dropout layer with a dropout rate of 0.3, to complete the initial nonlinear feature transformation. A cascaded network structure is then constructed, with the penultimate layer serving as a high-order feature extraction layer. This layer identifies high-order nonlinear interaction patterns between user profile labels. For example, a fully connected layer configured with 128 nodes will output a 128-dimensional feature layer, serving as the key source of activation values ​​for subsequent gradient calculations. The output layer is constructed as a fully connected layer with K nodes, where K represents the total number of image labels to be predicted, for example, K equals 50. This fully connected layer first outputs K-dimensional inactive linear values ​​logits, and then uses non-linear mapping functions such as Sigmoid to independently map these inactive linear values ​​to prediction probability values ​​in the range of 0 to 1, completing the end-to-end structure from user's original features to multi-label prediction probabilities.

[0025] In an optional embodiment, the calculation of a prior label association matrix based on the label co-occurrence relationship of the training set, wherein the elements of the prior label association matrix represent the conditional probability of the target label appearing given a source label, includes: The total number of times each label appears independently in the training set and the number of times any two labels co-occur together are counted. The co-occurrence count of the two labels is divided by the number of times the source label appears independently to obtain the conditional probability of the target label appearing under a given source label. Based on this, the prior label association matrix is ​​constructed.

[0026] To identify potential prior knowledge in the training data, it is necessary to traverse the training set containing tens of thousands or even millions of samples, using a global hash table or sparse matrix to count the total number of independent labels for each profile tag, such as high-net-worth individuals or maternal and infant preferences, and to count the co-occurrence frequency of any two tags being labeled simultaneously in the same sample. Assuming there are K tags in the training set (e.g., K = 50), the independent occurrence counts are represented by a one-dimensional array of length 50, and the co-occurrence counts are represented by a 50×50 symmetric matrix. After completing the frequency statistics, the conditional probability of target tag j appearing given source tag i is calculated by traversing the rows; that is, the ratio of co-occurrence frequency to independent occurrence frequency of the source tag is calculated. For example, if high-net-worth individuals appear independently 10,000 times, and high-net-worth individuals and luxury car owners co-occur 6,000 times, the conditional probability is calculated to be 0.6, meaning that the probability that a user is a high-net-worth individual and also a luxury car owner is 60%. All the calculated conditional probability values ​​form a 50×50 asymmetric matrix, namely the prior label association matrix, where the element in the i-th row and j-th column represents the conditional association weight from source label i to target label j. This direction definition remains consistent throughout the subsequent gradient aggregation process.

[0027] S2, input the user features into the neural network for forward propagation to obtain the initial prediction probability of each label, calculate the total loss including the basic classification loss and the gradient regularization term, the gradient regularization term is determined by calculating the gradient of the classification loss of each label with respect to the activation values ​​of the penultimate layer and the intermediate layer respectively, projecting the penultimate layer gradient of each label to the orthogonal complement space of the corresponding intermediate layer gradient to obtain the step gradient, periodically calculating the model latent label association matrix based on the classification weight vector corresponding to each label in the output layer, fusing the model latent label association matrix with the prior label association matrix to generate a time-varying association matrix, weighting and aggregating the step gradient according to the time-varying association matrix to obtain the context-aware target gradient, calculating the modulation factor based on the initial prediction probability of each label, and weighted summing the deviation between the step gradient and the context-aware target gradient to obtain the gradient regularization term.

[0028] The user feature tensor is sequentially input into each network layer of the neural network to obtain the unactivated linear values ​​(logits) of each label generated by the output layer. These logits are then transformed using the Sigmoid function to obtain the initial predicted probabilities of each label. When calling the binary_cross_entropy_with_logits function of the PyTorch framework, the unactivated linear values ​​(logits) and the true labels are used as input, and reduction='none' is set to obtain the binary cross-entropy loss matrix corresponding to the batch dimension and the label dimension. The basic classification loss is obtained by summing or averaging the binary cross-entropy loss matrix. For any label, the loss column corresponding to that label in the current batch is extracted, and the loss column is averaged or summed to form a scalarized label-by-label classification loss. Then, using the scalarized label-by-label classification loss as the derivative, its partial derivatives with respect to the penultimate layer activation value tensor and the intermediate layer activation value tensor are calculated to obtain the corresponding penultimate layer gradient tensor and intermediate layer gradient tensor. A computational graph differentiation method supporting high-order automatic differentiation is employed, and the gradient computation graph used for subsequent backpropagation is retained, allowing the gradient regularization term further constructed from the gradients to participate in the backpropagation update of the neural network parameters based on the total loss. The penultimate layer gradient tensor and the intermediate layer gradient tensor are averaged or summed along the batch dimension to obtain the penultimate layer gradient vector and the intermediate layer gradient vector corresponding to each label. Subsequently, the intermediate layer gradient vector is mapped to the same feature dimension as the penultimate layer gradient vector using a dimension alignment matrix. The projection component of the penultimate layer gradient vector in the aligned intermediate layer gradient vector direction is calculated, and the projection component is subtracted from the penultimate layer gradient vector to obtain the step gradient projected onto the orthogonal complement space.

[0029] The classification weight matrix is ​​extracted from the output Linear layer. The product of the classification weight matrix and its transpose is calculated, and the resulting product matrix is ​​subjected to Softmax normalization row by row to generate a model latent label association matrix with non-negative elements located in the interval between 0 and 1. Weight coefficients that decay with the number of training iterations are set, and the prior label association matrix and the model latent label association matrix are weighted and fused according to the weight coefficients to generate a time-varying association matrix. This time-varying association matrix is ​​the product of the weight coefficients and the prior label association matrix, plus 1 minus the weight coefficients, multiplied by the model latent label association matrix. This ensures that training initially relies primarily on the prior label association matrix, gradually shifting to the model latent label association matrix in later stages. Before using the time-varying correlation matrix for context-aware target gradient aggregation, magnitude normalization is performed on the off-diagonal correlation weights participating in the aggregation. For any target label, the sum of the correlation weights of the remaining source labels pointing to that target label is calculated. When the sum of the correlation weights is greater than a preset normalization threshold, which is a small constant greater than 0, the correlation weights corresponding to each source label are divided by the sum of the correlation weights and then participate in gradient weighted aggregation. When the sum of the correlation weights is not greater than the preset normalization threshold, the original correlation weights are retained to participate in gradient weighted aggregation to avoid weak correlation labels being abnormally amplified.

[0030] When performing gradient aggregation, the direction from the source label to the target label in the time-varying correlation matrix is ​​used as the weight direction. If matrix multiplication is used, the time-varying correlation matrix is ​​transposed or equivalently aligned in terms of index direction, so that the context-aware target gradient corresponding to target label j is generated by the step gradients of the remaining source labels i according to... Alternatively, it can be obtained by weighted summation of the corresponding time-varying correlation weights. During the aggregation process, the step gradient of the target label itself is not used, or the diagonal elements of the time-varying correlation matrix are set to zero before aggregation to avoid the gradient being counted repeatedly.

[0031] The prediction confidence modulation factor is calculated based on the initial predicted probabilities of each label and the true label. For any label, if the true label is 1, the modulation factor is expressed as a power of 1 minus the initial predicted probability of that label; if the true label is 0, the modulation factor is expressed as a power of the initial predicted probability of that label. This is equivalent to representing a preset power of the absolute difference between the true label and the predicted probability. In this way, both true positive and true negative labels satisfy a monotonic relationship: the more accurate the prediction, the smaller the modulation factor; the greater the prediction deviation, the larger the modulation factor. This avoids the logical reversal where a more accurate prediction results in a greater penalty in the true negative label scenario.

[0032] When calculating the deviation between the stepped gradient and the context-aware target gradient, instead of using the default global scalar `mse_loss` result as the subsequent weighting object, the L2 norm squared of the difference vector between the two is calculated for each label to obtain a label-by-label deviation scalar; alternatively, when calling the `mse_loss` function, `reduction='none'` is set and reduction is performed according to the label dimension to form a label-by-label deviation corresponding to the modulation factor of each label. The label-by-label deviation is multiplied by the corresponding prediction confidence modulation factor, and the weighted deviations of all labels are summed to obtain the gradient regularization term. The gradient regularization term is multiplied by a preset penalty strength coefficient and then added to the basic classification loss to obtain the total loss.

[0033] In an optional embodiment, the step of calculating the gradient of the classification loss of each label with respect to the activation values ​​of the penultimate layer and the intermediate layer, and projecting the penultimate layer gradient of each label onto the orthogonal complement space of the corresponding intermediate layer gradient to obtain the step gradient includes: For each label, the dimension alignment matrix is ​​multiplied by the intermediate layer gradient of the label to obtain the aligned intermediate layer gradient. Calculate the inner product of the penultimate gradient of the label and the aligned intermediate gradient, and divide the inner product by the square of the L2 norm of the aligned intermediate gradient to obtain the projection coefficient; The projection coefficients are multiplied by the aligned intermediate layer gradient to obtain the projection components; Subtract the projection component from the penultimate gradient of the label to obtain the step gradient of the label.

[0034] During backpropagation to calculate the loss gradient, a computational graph differentiation mechanism is used to extract the gradient tensors of the classification loss of each label under the current batch of data with respect to the penultimate layer activation values ​​and the intermediate layer activation values. After averaging these gradient tensors along the batch dimension, a penultimate layer gradient vector (e.g., 128-dimensional) and an intermediate layer gradient vector (e.g., 256-dimensional) are obtained. To reduce redundant information in shallow and deep feature gradients and highlight higher-order gradient components, a 128×256 dimension alignment matrix W is input. A linear transformation operation maps the 256-dimensional intermediate layer gradients to the same 128-dimensional vector space as the penultimate layer. The initial value of this matrix W can be randomly initialized using a normal distribution with a mean of 0 and a standard deviation of 0.01, and is used as a learnable parameter in backpropagation to learn the alignment relationship. Calculate the projection component of the penultimate layer gradient onto the aligned intermediate layer gradient direction. Specifically, this involves solving the inner product of the two vectors and dividing by the squared L2 norm of the projected vector. To prevent overflow caused by a zero denominator during calculation, add a factor to the denominator term. The minimum bias constant is obtained by subtracting the aforementioned projected redundant common components from the original high-order feature gradient, thus obtaining the step gradient projected onto the orthogonal complement space. This operation removes the general background noise transmitted by shallow networks, allowing the gradient vector to better represent the high-level discriminative features required for specific labels, and reducing mutual interference caused by feature mixing during cross-label optimization.

[0035] In an optional embodiment, the periodic calculation of the model latent label association matrix based on the classification weight vectors corresponding to each label in the output layer, and the fusion of the model latent label association matrix with the prior label association matrix to generate a time-varying association matrix, includes: Obtain a preset decay coefficient greater than 0, and calculate the negative exponential function value of the product of the preset decay coefficient and the current training step number as the decay weight; The first matrix component is obtained by multiplying the attenuation weights by the prior label association matrix, and the second matrix component is obtained by multiplying the attenuation weights by the model latent label association matrix. The time-varying correlation matrix is ​​obtained by adding the first matrix component to the model's implicit label correlation matrix and then subtracting the second matrix component.

[0036] To achieve a training strategy that relies on prior statistical knowledge in the early stages of training and then smoothly transitions to a training strategy that relies on the model's self-learning of latent data features in the later stages, a time-varying correlation matrix update mechanism based on exponential decay is utilized. During actual model training, the current global optimization iteration number t is obtained in real time. Assuming a scenario with 10 epochs and each epoch containing 1000 batches, the value of t is an integer monotonically increasing from 0 to 10000. A fixed decay coefficient γ is pre-configured, preferably limited to a range of values ​​within a certain range. to Between, for example, set to 5× Based on the above variables, the current scalar decay weight α is calculated. As training progresses, this weight value will decay exponentially and smoothly, approaching 0. Within each specified training cycle, such as every 100 training steps, the weight vector parameter matrix of the classifier corresponding to each label in the output layer is extracted. By calculating the inner product between row vectors and performing Softmax normalization, the model's latent label association matrix representing its current understanding is obtained. The time-varying association matrix is ​​fused by multiplying α by the prior label association matrix and then adding 1-α multiplied by the model's latent label association matrix. This algebraic transformation allows the model to be guided by fixed prior associations in the initial stage, while in the later stages of training where feature extraction capabilities are mature, the associations discovered by the model itself dominate the optimization, achieving a synergistic evolution of prior hard constraints and self-driven feature expression capabilities. The decay weight change curve under training iteration steps is illustrated below. Figure 2 As shown.

[0037] In an optional embodiment, obtaining the context-aware target gradient by weighted aggregation of the step gradient based on the time-varying correlation matrix includes: For any target label, obtain the conditional association weights of each label in the time-varying association matrix other than the target label to the target label; The conditional association weights of the remaining labels are multiplied by the step gradients of the corresponding remaining labels to obtain the weighted gradients. Summing all the weighted gradients yields the context-aware target gradient of the target label.

[0038] For each core profile label to be optimized, the system automatically aggregates all other coexisting labels that may provide beneficial feature guidance to that core profile label. It then simulates and visualizes the collaborative optimization tendency between label networks by calculating the context-aware target gradient. During a single forward propagation to the gradient backpropagation node, the optimizer framework retrieves the set of step gradient vectors for all K-1 candidate labels with the same feature dimension as the current one (e.g., 128 dimensions) from the current graph cache. Simultaneously, it reads the element values ​​at specific positions in the recently calculated time-varying association matrix as conditional association weight scalars. If both the prior label association matrix and the time-varying association matrix use the i-th row and j-th column to represent the conditional association weight from source label i to target label j, then the context-aware target gradient of target label j is aggregated according to the elements in the j-th column of the time-varying association matrix excluding the j-th row. In the program implementation, this direction can be maintained by reading the corresponding column vector or transposing the association matrix in matrix multiplication. This weight value falls within the real number range of 0 to 1, indicating the importance of the neighboring labels in providing dependency information to the target label. By multiplying the step gradient vectors of these K-1 heterogeneous labels by their corresponding scalar weights to scale their amplitude, and then performing element-wise addition across the cross-channel feature dimensions on the scaled gradient matrix group, a context-aware target gradient vector that also maintains 128 dimensions is reconstructed and aggregated. This aggregation and transformation process embeds a fully connected directed computation graph with time-varying association probabilities as adjacency connectivity weights into the gradient update path. This ensures that if two labels have a high correlation, such as a weight of 0.85 between maternal and infant preferences and parenting stages, the latter can absorb the gradient update guidance of the former when updating its own weight parameters. For irrelevant labels, the near-zero weights can block them, continuously driving the network to converge towards a parameter space with global semantic consistency across labels.

[0039] In an optional embodiment, the step of calculating the modulation factor based on the initial prediction probabilities of each label, and obtaining the gradient regularization term by weighted summation of the deviations between the stepped gradient and the context-aware target gradient, includes: For each label, calculate the difference vector between the step gradient of the label and the gradient of the context-aware target, and calculate the square of the L2 norm of the difference vector; The regularization component of the label is obtained by multiplying the square of the L2 norm of the difference vector with the prediction confidence modulation factor of the label. The gradient regularization term is obtained by summing the regularization components of all labels. The gradient regularization term is the cross-label relationship gradient regularization term.

[0040] To ensure the stability and consistency of the convergence trajectory in multi-label concurrent joint training tasks by constraining the discrete distance of the gradient flow in the gradient flow geometry, the model is designed to represent the deviation between the inherent step feature gradient of each individual label and the context-aware target gradient assigned by global context aggregation corresponding to that inherent step feature gradient. During execution, for all label classification heads with a set total number of K, e.g., 50 business labels, the vector difference between the step gradient vector extracted specifically for that label classification head and the context-aware target gradient vector derived through the fusion graph is calculated. The L2 norm is used for squared processing to extract the non-negative squared Euclidean distance used to evaluate the degree of bidirectional deviation. To match the gradient regularization strength with the current label prediction deviation and to avoid reversing the penalty direction due to positive and negative labels using the same modulation form, a confidence modulation factor module is constructed using the predicted probabilities obtained from the forward propagation of the current training batch and the true labels.

[0041] In the preferred implementation scenario, the true label value of the k-th label is denoted as Let the initial prediction probability of the k-th label be denoted as Let the adjustment hyperparameter be denoted as η, then the prediction confidence modulation factor for this label is set to... For a positive label whose true label is 1, this factor equals For negative labels with a true label of 0, this factor equals Therefore, both positive and negative labels follow the rule that the more accurate the prediction, the smaller the modulation factor; and the greater the prediction deviation, the larger the modulation factor. For example, when the true label is 1 and the output probability is 0.7, and the adjustment hyperparameter is set to 2, the resulting confidence modulation factor is 0.3 squared, or 0.09; when the true label is 0 and the output probability is 0.1, and the adjustment hyperparameter is set to 2, the resulting confidence modulation factor is 0.1 squared, or 0.01.

[0042] When calculating the regularization components, the L2 norm squared of the difference vector between the step gradient and the context-aware target gradient is calculated for each label to obtain a bias scalar corresponding to each label. Then, the bias scalar is algebraically multiplied with the prediction confidence modulation factor of that label to scale the penalty intensity. The regularization components corresponding to K labels are summed and superimposed to obtain the global cross-label relationship gradient regularization term. This term is subsequently multiplied by a preset penalty intensity hyperparameter, such as 0.1, and incorporated into the binary cross-entropy loss main term to optimize the generation quality of heterogeneous profile information across the entire link.

[0043] S3, update the parameters of the neural network based on the total loss through backpropagation, and periodically update the time-varying correlation matrix, and use the trained neural network to generate personnel profile labels.

[0044] In each training iteration, the optimizer's `zero_grad` method is first called to clear historical gradients. Then, the `backward` function of the total loss tensor is called to calculate the gradient of the total loss with respect to all learnable parameters in the neural network. Subsequently, the `step` function of the `torch.optim.AdamW` optimizer is called to perform parameter update operations based on the calculated parameter gradients. Periodic update trigger conditions are set in the training loop. Whenever the number of training iterations reaches a preset step size, the latest classification weight matrix is ​​extracted, and the aforementioned operations of multiplying the classification weight matrices, Softmax normalization, and weighted fusion are repeatedly performed to update the time-varying correlation matrix. Forward propagation, loss calculation, backpropagation, and parameter updates are performed cyclically until the maximum number of training iterations is reached, completing the neural network training. In the inference phase, the user features to be labeled are converted into tensors and input into the trained neural network. The model's `forward` function is called to perform forward inference to obtain the inactive linear values ​​of the output layer. Then, the `Sigmoid` function is used to convert these inactive linear values ​​into an output probability vector. Elements greater than or equal to 0.5 in the output probability vector are set to integers 1, and elements less than 0.5 are set to integers 0. This binary vector is then output as the personnel profile label.

[0045] In a second embodiment, the present invention also proposes a tag generation device for multi-source personnel data, comprising the following modules: The module is used to acquire a training set containing user features and corresponding labels, construct a neural network containing an input layer, an intermediate layer, a penultimate layer and an output layer. The output layer outputs the label prediction probability. Based on the label co-occurrence relationship of the training set, a prior label association matrix is ​​calculated. The elements of the prior label association matrix represent the conditional probability of the target label appearing under a given source label. The calculation module is used to input the user features into the neural network for forward propagation to obtain the initial prediction probability of each label, calculate the total loss including the basic classification loss and the gradient regularization term, wherein the gradient regularization term is determined by calculating the gradient of the classification loss of each label with respect to the activation values ​​of the penultimate layer and the intermediate layer respectively, projecting the penultimate layer gradient of each label onto the orthogonal complement space of the gradient of the corresponding intermediate layer to obtain the step gradient, periodically calculating the model latent label association matrix based on the classification weight vector corresponding to each label in the output layer, fusing the model latent label association matrix with the prior label association matrix to generate a time-varying association matrix, weighting and aggregating the step gradient according to the time-varying association matrix to obtain the context-aware target gradient, calculating the modulation factor based on the initial prediction probability of each label, and weighted summing the deviation between the step gradient and the context-aware target gradient to obtain the gradient regularization term; The generation module is used to update the parameters of the neural network based on the total loss through backpropagation, and periodically update the time-varying correlation matrix, and generate personnel profile labels using the trained neural network.

[0046] It should be understood that the various processes shown above can be used, with steps rearranged, added, or deleted. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure is achieved, and no limitation is imposed herein. Furthermore, if this invention involves sensitive personal information, the consent of the relevant parties is required, and the data must be used within the scope permitted by laws and regulations.

[0047] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for generating labels for multi-source personnel data, characterized in that, Includes the following steps: Obtain a training set containing user features and corresponding labels, construct a neural network containing an input layer, an intermediate layer, a penultimate layer and an output layer. The output layer outputs the label prediction probability. Calculate a prior label association matrix based on the label co-occurrence relationship of the training set. The elements of the prior label association matrix represent the conditional probability of the target label appearing under a given source label. The user features are input into the neural network for forward propagation to obtain the initial prediction probability of each label. The total loss, including the basic classification loss and the gradient regularization term, is calculated. The gradient regularization term is determined by calculating the gradient of the classification loss of each label with respect to the activation values ​​of the penultimate layer and the intermediate layer, respectively. The penultimate layer gradient of each label is projected onto the orthogonal complement space of the gradient of the corresponding intermediate layer to obtain the step gradient. The model latent label association matrix is ​​periodically calculated based on the classification weight vector corresponding to each label in the output layer. The model latent label association matrix and the prior label association matrix are fused to generate a time-varying association matrix. The step gradient is weighted and aggregated according to the time-varying association matrix to obtain the context-aware target gradient. The modulation factor is calculated based on the initial prediction probability of each label. The gradient regularization term is obtained by weighted summation of the deviation between the step gradient and the context-aware target gradient. The parameters of the neural network are updated by backpropagation based on the total loss, and the time-varying correlation matrix is ​​updated periodically. Personnel profile labels are generated using the trained neural network.

2. The method according to claim 1, characterized in that, The process of obtaining a training set containing user features and corresponding labels, constructing a neural network with an input layer, an intermediate layer, a penultimate layer, and an output layer, wherein the output layer outputs the predicted label probability, includes: The receiving nodes of the input layer are configured according to the dimensionality of the user feature data. Hidden layer features are extracted through at least one fully connected layer as the intermediate layer. The penultimate layer is set as the higher-order feature extraction layer. The output layer uses a non-linear mapping function to convert the features into label prediction probabilities.

3. The method according to claim 2, characterized in that, The prior label association matrix is ​​calculated based on the label co-occurrence relationship of the training set. The elements of the prior label association matrix represent the conditional probability of a target label appearing given a source label, including: The total number of times each label appears independently in the training set and the number of times any two labels co-occur together are counted. The co-occurrence count of the two labels is divided by the number of times the source label appears independently to obtain the conditional probability of the target label appearing under a given source label. Based on this, the prior label association matrix is ​​constructed.

4. The method according to claim 1 or 2, characterized in that, The step of calculating the gradient of the classification loss for each label with respect to the activation values ​​of the penultimate layer and the intermediate layer, and projecting the penultimate layer gradient of each label onto the orthogonal complement space of the corresponding intermediate layer gradient to obtain the step gradient includes: For each label, the dimension alignment matrix is ​​multiplied by the intermediate layer gradient of the label to obtain the aligned intermediate layer gradient. Calculate the inner product of the penultimate gradient of the label and the aligned intermediate gradient, and divide the inner product by the square of the L2 norm of the aligned intermediate gradient to obtain the projection coefficient; The projection coefficients are multiplied by the aligned intermediate layer gradient to obtain the projection components; Subtract the projection component from the penultimate gradient of the label to obtain the step gradient of the label.

5. The method according to claim 1, characterized in that, The periodic calculation of the model's latent label association matrix based on the classification weight vectors corresponding to each label in the output layer, and the fusion of the model's latent label association matrix with the prior label association matrix to generate a time-varying association matrix, includes: Obtain a preset decay coefficient greater than 0, and calculate the negative exponential function value of the product of the preset decay coefficient and the current training step number as the decay weight; The first matrix component is obtained by multiplying the attenuation weights by the prior label association matrix, and the second matrix component is obtained by multiplying the attenuation weights by the model latent label association matrix. The time-varying correlation matrix is ​​obtained by adding the first matrix component to the model's implicit label correlation matrix and then subtracting the second matrix component.

6. The method according to claim 1, characterized in that, The step of obtaining the context-aware target gradient by weighted aggregation of the step gradient based on the time-varying correlation matrix includes: For any target label, obtain the conditional association weights of each label in the time-varying association matrix other than the target label to the target label; The conditional association weights of the remaining labels are multiplied by the step gradients of the corresponding remaining labels to obtain the weighted gradients. Summing all the weighted gradients yields the context-aware target gradient of the target label.

7. The method according to claim 1, characterized in that, The step of calculating the modulation factor based on the initial prediction probability of each label, and obtaining the gradient regularization term by weighted summation of the deviations between the step gradient and the context-aware target gradient, includes: For each label, calculate the difference vector between the step gradient of the label and the gradient of the context-aware target, and calculate the square of the L2 norm of the difference vector; The regularization component of the label is obtained by multiplying the square of the L2 norm of the difference vector with the prediction confidence modulation factor of the label. The gradient regularization term is obtained by summing the regularization components of all labels. The gradient regularization term is the cross-label relationship gradient regularization term.

8. A tag generation device for multi-source personnel data, characterized in that, Includes the following modules: The module is used to acquire a training set containing user features and corresponding labels, construct a neural network containing an input layer, an intermediate layer, a penultimate layer and an output layer. The output layer outputs the label prediction probability. Based on the label co-occurrence relationship of the training set, a prior label association matrix is ​​calculated. The elements of the prior label association matrix represent the conditional probability of the target label appearing under a given source label. The calculation module is used to input the user features into the neural network for forward propagation to obtain the initial prediction probability of each label, calculate the total loss including the basic classification loss and the gradient regularization term, wherein the gradient regularization term is determined by calculating the gradient of the classification loss of each label with respect to the activation values ​​of the penultimate layer and the intermediate layer respectively, projecting the penultimate layer gradient of each label onto the orthogonal complement space of the gradient of the corresponding intermediate layer to obtain the step gradient, periodically calculating the model latent label association matrix based on the classification weight vector corresponding to each label in the output layer, fusing the model latent label association matrix with the prior label association matrix to generate a time-varying association matrix, weighting and aggregating the step gradient according to the time-varying association matrix to obtain the context-aware target gradient, calculating the modulation factor based on the initial prediction probability of each label, and weighted summing the deviation between the step gradient and the context-aware target gradient to obtain the gradient regularization term; The generation module is used to update the parameters of the neural network based on the total loss through backpropagation, and periodically update the time-varying correlation matrix, and generate personnel profile labels using the trained neural network.

9. The apparatus according to claim 8, characterized in that, The process of obtaining a training set containing user features and corresponding labels, constructing a neural network with an input layer, an intermediate layer, a penultimate layer, and an output layer, wherein the output layer outputs the predicted label probability, includes: The receiving nodes of the input layer are configured according to the dimensionality of the user feature data. Hidden layer features are extracted through at least one fully connected layer as the intermediate layer. The penultimate layer is set as the higher-order feature extraction layer. The output layer uses a non-linear mapping function to convert the features into label prediction probabilities.

10. The apparatus according to claim 8, characterized in that, The prior label association matrix is ​​calculated based on the label co-occurrence relationship of the training set. The elements of the prior label association matrix represent the conditional probability of a target label appearing given a source label, including: The total number of times each label appears independently in the training set and the number of times any two labels co-occur together are counted. The co-occurrence count of the two labels is divided by the number of times the source label appears independently to obtain the conditional probability of the target label appearing under a given source label. Based on this, the prior label association matrix is ​​constructed.