A personal credit scoring method based on federated learning
By using the improved SCAFFOLD multidimensional control structure, the model deviation problem caused by inconsistent data distribution in federated learning is solved, achieving higher accuracy and stable credit scoring, which is suitable for financial risk assessment scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI MINGXIN DIGITAL TECHNOLOGY CO LTD
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-09
AI Technical Summary
Existing federated learning methods struggle to handle the problem of non-independent and identically distributed data in financial credit scoring scenarios, causing the model update direction to deviate from the global optimum and the scoring accuracy to decrease. In particular, the model convergence is unstable when the data distribution is inconsistent, and it cannot effectively adjust for differences in risk levels and heterogeneity of feature categories in credit scoring tasks.
An improved SCAFFOLD multidimensional control structure based on risk intervals, feature groups, and threshold sensitivity factors is constructed. Through hierarchical drift correction and gradient linear scaling, combined with sample number weighted aggregation, consistent training updates across institutions are achieved.
It improves the accuracy and boundary discrimination stability of credit scoring, enhances the model's stable convergence ability under non-independent and identically distributed conditions, strengthens the learning ability of key decision boundaries, and reduces communication costs and computational burden during training.
Smart Images

Figure CN122175679A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of federated learning and financial risk assessment, and in particular to a personal credit scoring method based on federated learning. Background Technology
[0002] As the digitalization of financial services continues to increase, various institutions have accumulated a large amount of structured and semi-structured customer credit data in their lending services. Machine learning-based credit scoring models are gradually becoming an important component of risk management systems. Traditional centralized modeling methods typically aggregate customer data from multiple institutions onto a unified server for training. However, in real-world business environments, financial institutions face challenges such as high data security requirements, significant privacy compliance pressures, and difficulties in centrally managing cross-institutional data, making centralized model training difficult to implement. To address the model training obstacles caused by the lack of data centralization, federated learning technology has been introduced into the field of credit assessment, enabling model construction through a distributed training mechanism without data leaving the data domain. However, existing federated learning frameworks still exhibit significant shortcomings when facing the substantial heterogeneity of financial data. Especially when data distribution is inconsistent, the model update direction is easily affected by local data biases, leading to unstable global model convergence and decreased scoring accuracy.
[0003] Existing federated learning methods based on parameter averaging struggle to address the prevalent issue of non-independent and identically distributed samples in financial scenarios. The credit behavior characteristics of different institutional customer groups vary significantly, and the default probability distribution also differs across institutions, causing a noticeable deviation between the local gradient update direction and the global optimum. While existing literature has proposed optimization algorithms such as SCAFFOLD that introduce control vectors to mitigate client drift, their single control vector structure only provides global correction for the overall gradient shift and cannot effectively adjust for finer-grained data distribution characteristics such as risk level differences and feature category heterogeneity in credit scoring tasks. Furthermore, customer credit behavior is often affected by threshold-sensitive intervals; for example, predicting samples close to the default threshold has a greater impact on model stability, and existing methods lack mechanisms to provide additional corrections for samples in the critical interval.
[0004] In real-world lending scenarios, the distribution of customer default characteristics varies significantly across different institutions. Indicators such as the proportion of high-risk customers and the duration of defaults are difficult to standardize, making it challenging to fully reflect the differences in risk ranges using average control measures. Furthermore, customer credit feature structures exhibit clear grouping characteristics, with significant differences in data scale and numerical distribution between discrete fields, continuous numerical fields, and behavioral sequence fields. Existing federated optimization algorithms cannot distinguish the sources of drift across different feature groups, resulting in insufficient accuracy in updating some key behavioral features. Moreover, existing methods typically fail to apply different adjustment strengths to gradient updates based on the deviation of predicted values from default score thresholds, leading to insufficient learning ability of the model near key decision boundaries and consequently affecting the stability and discriminative power of the final credit score.
[0005] Therefore, how to provide a personal credit scoring method based on federated learning is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] One objective of this invention is to propose a federated learning-based personal credit scoring method. This invention constructs an improved SCAFFOLD multidimensional control structure based on risk intervals, feature groups, and a threshold-sensitive factor. By performing hierarchical drift correction on the gradients of samples and feature groups in different risk intervals, and linearly scaling the gradients using the threshold-sensitive factor when approaching the default threshold, the model maintains stable convergence under non-independent and identically distributed conditions. Combining sample-weighted aggregation with structured control vector synchronization, consistent training and updates across institutions are achieved, ultimately resulting in a federated learning credit scoring model with higher accuracy and more stable boundary discrimination.
[0007] A personal credit scoring method based on federated learning according to an embodiment of the present invention includes the following steps:
[0008] S1. Obtain customer credit data on the participant side, perform cleaning processing, and initialize global model parameters and global control vector of the improved SCAFFOLD algorithm on the server side.
[0009] S2. On the participant side, risk ranges are set based on historical defaults. The cleaned customer credit data is divided into low-risk, medium-risk, and high-risk ranges, and the local risk range control vector is initialized.
[0010] S3. On the participant side, based on the field properties, the features are divided into discrete feature groups, continuous feature groups, and behavioral feature groups. Preprocessing is then performed and the local feature group control vector is initialized.
[0011] S4. Load global model parameters on the participant side to construct an improved SCAFFOLD local control structure that includes risk interval control vector, feature group control vector and threshold sensitivity factor;
[0012] S5. Calculate the gradient of the local model parameters on the participant side, perform partition drift correction and feature group drift correction using the local control structure, determine the threshold sensitive weight based on the difference between the predicted value and the default score threshold, and update the local model parameters and local control vector based on the corrected gradient.
[0013] S6. Receive the local model parameter update and control vector update uploaded by the participants on the server side, perform weighted aggregation based on the number of samples to update the global model parameters and global control vector, and send the update results to the participants;
[0014] S7. When the federated training meets the convergence condition, fix the global model parameters, use the local feature data of the participants to perform forward inference, and output the personal credit score results.
[0015] Optionally, S1 includes:
[0016] S11. On the participating party's side, customer credit data is extracted from the local business system. The customer credit data includes identity field, income field, asset field, liability field, historical repayment record field, and transaction behavior record field.
[0017] S12. Perform missing value filling processing on the customer credit data. Numeric fields are filled with the median of the same customer group, enumeration fields are filled with the highest frequency of occurrence of the field, and fields whose values cannot be determined are filled with preset placeholders.
[0018] S13. Perform outlier removal processing on numeric fields, replace values below the lower limit with the lower limit and values above the upper limit with the upper limit according to the preset normal range, and delete illegal character records that cannot be converted into numeric values.
[0019] S14. Perform format unification processing on the date field, amount field, category field, and Boolean field, converting the date field to a unified date format, the amount field to a unified currency and retaining a unified number of decimal places, the category field to a preset code, and the Boolean field to a unified binary code, forming structured clean data;
[0020] S15. On the server side, initialize the global model parameters based on the field dimensions and model structure of the structured cleaned data, set the weight parameters to random values that satisfy the preset distribution, set the bias parameters to zero, and initialize the global control vector of the improved SCAFFOLD algorithm, setting the control parameters in the control vector to zero.
[0021] Optionally, S2 includes:
[0022] S21. On the participant side, risk range boundaries are set based on the historical default information recorded in the cleaned customer credit data. Customer samples are divided into ranges according to the number of defaults and the duration of defaults, and customer samples are respectively classified into low-risk range, medium-risk range and high-risk range.
[0023] S22. On the participant side, based on the interval division results, a risk interval identifier is added to each customer sample, and the risk interval identifier and the structured feature data of the corresponding customer sample are stored together to form a training sample with interval identifier.
[0024] S23. On the participant's side, initialize local risk interval control vectors for low-risk intervals, medium-risk intervals, and high-risk intervals respectively. During initialization, set all components of the local risk interval control vectors to zero.
[0025] S24. On the participant side, establish an index relationship between the training samples with interval labels and the corresponding local risk interval control vector.
[0026] Optionally, S3 includes:
[0027] S31. On the participant side, based on the value type of the fields in the cleaned customer credit data, the features are divided into discrete feature groups, continuous feature groups, and behavioral feature groups. The discrete feature groups are categorical value fields, the continuous feature groups are numerical value fields, and the behavioral feature groups are fields that record the number of transactions, transaction frequency, or behavioral time series.
[0028] S32. On the participant side, perform encoding processing on the discrete feature group to convert the discrete values into discrete codes in the preset encoding dictionary;
[0029] S33. On the participant side, normalization processing is performed on the continuous feature group, and the continuous values are linearly scaled to a uniform numerical range according to a preset interval.
[0030] S34. On the participant side, perform time window statistical processing on the behavioral feature group. By setting the time window length, calculate the number of occurrences, occurrence frequency and sequence statistics of the behavioral field within the window to form a numerical representation of the behavioral features.
[0031] S35. On the participant side, initialize the local feature group control vectors for the discrete feature group, continuous feature group and behavioral feature group respectively. During initialization, set all components of the local feature group control vector to zero.
[0032] S36. On the participant side, the processed discrete features, continuous features and behavioral features are concatenated to form a local feature matrix, and an index relationship is established between the local feature matrix and the corresponding local feature group control vector.
[0033] Optionally, S4 includes:
[0034] S41. Receive global model parameters from the server side on the participant side, and store the global model parameters locally on the participant side as a local model parameter copy. The local model parameter copy is consistent with the global model parameters in terms of dimension and arrangement order.
[0035] S42. Read the initialized local risk interval control vector set on the participant side. The local risk interval control vector set includes control vectors established for low-risk intervals, medium-risk intervals and high-risk intervals respectively.
[0036] S43. Read the initialized local feature group control vector set on the participant side. The local feature group control vector set includes control vectors established for discrete feature groups, continuous feature groups and behavioral feature groups respectively.
[0037] S44. Set a default score threshold on the participant side, store the default score threshold in the local configuration, and reserve a storage location for a threshold sensitivity factor in the local control structure based on the default score threshold. The threshold sensitivity factor is a numerical field that represents the degree of difference between the predicted value and the default score threshold. The threshold sensitivity factor value is set to zero during initialization.
[0038] S45. On the participant side, according to the combination of risk interval dimension and feature group dimension, the local risk interval control vector set, the local feature group control vector set and the threshold sensitivity factor are indexed and arranged in the same data structure to form an improved SCAFFOLD local control structure containing risk interval control vector, feature group control vector and threshold sensitivity factor.
[0039] S46. On the participant side, establish a one-to-one correspondence between the improved SCAFFOLD local control structure and the local model parameter copy, and record the control vector index and threshold sensitivity factor storage location in the improved SCAFFOLD local control structure according to the parameter index of the local model parameter copy.
[0040] Optionally, S5 includes:
[0041] S51. On the participant side, training samples are selected in batches from the local feature matrix. The training samples are input into the local model parameter copy to perform forward calculation and obtain the corresponding predicted values.
[0042] S52. On the participant side, calculate the threshold sensitive weight based on the numerical difference between the predicted value and the default score threshold. The threshold sensitive weight is the product of the absolute difference and the preset weight coefficient. After calculation, store the threshold sensitive weight in the threshold sensitive factor storage location.
[0043] S53. On the participant side, the local risk interval control vector is retrieved based on the risk interval identifier corresponding to the training sample. The local risk interval control vector is aligned with the gradient record of the local model parameter copy according to the parameter index order. Partition drift correction is performed. The partition drift correction is calculated by subtracting the difference between the local gradient and the local risk interval control vector.
[0044] S54. On the participant side, the local feature group control vector is retrieved according to the feature group corresponding to the training sample. The local feature group control vector is aligned with the gradient record after partition drift correction according to the feature group arrangement order. Feature group drift correction is performed. The feature group drift correction is calculated by subtracting the difference between the current gradient and the local feature group control vector.
[0045] S55. On the participant side, the gradient after the feature group drift correction is weighted and adjusted according to the value of the threshold sensitivity factor. The weighting adjustment is to perform multiplication scaling calculation on the gradient record according to the value of the threshold sensitivity factor.
[0046] S56. On the participant side, the weighted gradient record is written into the local model parameter copy. The local model parameter copy is updated by subtraction according to the learning rate initialized on the server side. At the same time, the local risk interval control vector and the local feature group control vector are updated by addition according to the same gradient update method, forming the local model parameter update amount and the local control vector update amount.
[0047] Optionally, S6 includes:
[0048] S61. Receive the local model parameter update amount uploaded by the participants on the server side. The local model parameter update amount is calculated from the difference between the local model parameter copy and the global model parameter of the previous round.
[0049] S62. Receive the local control vector update amount uploaded by the participants on the server side. The local control vector update amount consists of the current round update records of the local risk interval control vector and the local feature group control vector.
[0050] S63. On the server side, assign corresponding weights to each local model parameter update based on the number of training samples uploaded by the participants, and perform weighted summation calculation on the local model parameter update according to the weights to generate the updated global model parameters.
[0051] S64. On the server side, according to the order of local control vector update amounts, perform addition aggregation on the local risk interval control vector update records uploaded by the participants and the local feature group control vector update records to generate the updated global control vector.
[0052] S65. On the server side, the updated global model parameters and the updated global control vector are packaged and sent to the participating party side according to the communication protocol.
[0053] Optionally, S7 includes:
[0054] S71. After the server side determines that the federated training has met the preset convergence conditions, it sends a convergence command to the participating side. After receiving the convergence command, the participating side stops the local model parameter update operation.
[0055] S72. Load the final global model parameters sent by the server on the participant side, and store the final global model parameters as a copy of the final model parameters on the participant side.
[0056] S73. On the participant side, extract the structured feature data of the customer to be evaluated from the business system, and arrange the structured feature data into an inference feature vector according to the feature grouping order;
[0057] S74. On the participant side, the inference feature vector is input into the final model parameter copy to perform forward calculation. The matrix multiplication calculation and nonlinear transformation are completed in sequence according to the parameter order of each layer of the model to obtain the customer's credit score output.
[0058] S75. On the participating party's side, the credit score value is recorded as the customer score result and written into the customer's credit file according to the field format of the business system.
[0059] The beneficial effects of this invention are:
[0060] This invention addresses the common problems in federated learning for credit scoring scenarios, such as non-independent and identically distributed data, inconsistent feature scales, and unstable predictions in critical intervals, by introducing an improved SCAFFOLD multidimensional control structure based on risk intervals, feature groups, and threshold sensitivity factors. It constructs a local training mechanism that coordinates three types of control variables: interval partitioning, feature grouping, and threshold sensitivity. In the data preprocessing stage, structured cleaning and feature grouping ensure the uniformity of feature dimensions across institutions. In the local training stage, partition drift correction and feature group drift correction are used to perform hierarchical correction of gradient shifts for samples in different risk intervals and for different types of features. When the predicted value approaches the default score threshold, additional weights are generated using threshold sensitivity factors, and linear scaling is applied to the gradient records of samples in key intervals to achieve refined updates to the model's discrimination boundary. In the cross-institutional synchronization stage, a weighted aggregation mechanism based on sample size maintains consistent institutional contribution ratios. Simultaneously, structured aggregation of multiple control vectors ensures stable iteration of global parameters and global control vectors, ultimately forming a federated credit scoring model that maintains convergence stability across different institutional environments. This model achieves higher scoring reliability and convergence accuracy in financial risk control scenarios with large differences in risk ranges, diverse feature sources, and strong sensitivity to default boundaries, and supports local inference to output consistent personal credit score results. Attached Figure Description
[0061] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0062] Figure 1 This is a schematic diagram of the overall process of a personal credit scoring method based on federated learning proposed in this invention;
[0063] Figure 2 This is a schematic diagram of the improved SCAFFOLD algorithm structure in this invention;
[0064] Figure 3 This is a schematic diagram of the server-side aggregation process in this invention. Detailed Implementation
[0065] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0066] refer to Figure 1-3 A personal credit scoring method based on federated learning includes the following steps:
[0067] S1. Obtain customer credit data on the participant side, perform cleaning processing, and initialize global model parameters and global control vector of the improved SCAFFOLD algorithm on the server side.
[0068] S2. On the participant side, risk ranges are set based on historical defaults. The cleaned customer credit data is divided into low-risk, medium-risk, and high-risk ranges, and the local risk range control vector is initialized.
[0069] S3. On the participant side, based on the field properties, the features are divided into discrete feature groups, continuous feature groups, and behavioral feature groups. Preprocessing is then performed and the local feature group control vector is initialized.
[0070] S4. Load global model parameters on the participant side to construct an improved SCAFFOLD local control structure that includes risk interval control vector, feature group control vector and threshold sensitivity factor;
[0071] S5. Calculate the gradient of the local model parameters on the participant side, perform partition drift correction and feature group drift correction using the local control structure, determine the threshold sensitive weight based on the difference between the predicted value and the default score threshold, and update the local model parameters and local control vector based on the corrected gradient.
[0072] S6. Receive the local model parameter update and control vector update uploaded by the participants on the server side, perform weighted aggregation based on the number of samples to update the global model parameters and global control vector, and send the update results to the participants;
[0073] S7. When the federated training meets the convergence condition, fix the global model parameters, use the local feature data of the participants to perform forward inference, and output the personal credit score results.
[0074] In this embodiment, S1 includes:
[0075] S11. On the participating party's side, customer credit data is extracted from the local business system. The customer credit data includes identity field, income field, asset field, liability field, historical repayment record field, and transaction behavior record field.
[0076] S12. Perform missing value filling processing on the customer credit data. Numeric fields are filled with the median of the same customer group, enumeration fields are filled with the highest frequency of occurrence of the field, and fields whose values cannot be determined are filled with preset placeholders.
[0077] S13. Perform outlier removal processing on numeric fields, replace values below the lower limit with the lower limit and values above the upper limit with the upper limit according to the preset normal range, and delete illegal character records that cannot be converted into numeric values.
[0078] S14. Perform format unification processing on the date field, amount field, category field, and Boolean field, converting the date field to a unified date format, the amount field to a unified currency and retaining a unified number of decimal places, the category field to a preset code, and the Boolean field to a unified binary code, forming structured clean data;
[0079] S15. On the server side, initialize the global model parameters based on the field dimensions and model structure of the structured cleaned data, set the weight parameters to random values that satisfy the preset distribution, set the bias parameters to zero, and initialize the global control vector of the improved SCAFFOLD algorithm, setting the control parameters in the control vector to zero.
[0080] In this embodiment, S2 includes:
[0081] S21. On the participant side, risk range boundaries are set based on the historical default information recorded in the cleaned customer credit data. Customer samples are divided into ranges according to the number of defaults and the duration of defaults, and customer samples are respectively classified into low-risk range, medium-risk range and high-risk range.
[0082] S22. On the participant side, based on the interval division results, a risk interval identifier is added to each customer sample, and the risk interval identifier and the structured feature data of the corresponding customer sample are stored together to form a training sample with interval identifier.
[0083] S23. On the participant's side, initialize local risk interval control vectors for low-risk intervals, medium-risk intervals, and high-risk intervals respectively. During initialization, set all components of the local risk interval control vectors to zero.
[0084] S24. On the participant side, establish an index relationship between the training samples with interval labels and the corresponding local risk interval control vector.
[0085] In credit risk data, customer default behavior exhibits significant interval differences in both quantitative and temporal characteristics. Simply using the mean or overall distribution as a modeling basis often fails to reflect the true offset characteristics of customers at different risk levels. By constructing risk interval boundaries based on the number of defaults and their duration before training, customer samples possess a clear risk hierarchy structure before entering the federated training phase, providing an interval-based index source for subsequent gradient updates. A separate local risk interval control vector is established for each risk interval, enabling the training process to record and decompose the updated offset along the interval dimension. This avoids control distortion caused by the mixing of different risk intervals in situations involving multiple institutions, providing the necessary interval-level control foundation for a multi-level drift correction mechanism.
[0086] In this embodiment, S3 includes:
[0087] S31. On the participant side, based on the value type of the fields in the cleaned customer credit data, the features are divided into discrete feature groups, continuous feature groups, and behavioral feature groups. The discrete feature groups are categorical value fields, the continuous feature groups are numerical value fields, and the behavioral feature groups are fields that record the number of transactions, transaction frequency, or behavioral time series.
[0088] S32. On the participant side, perform encoding processing on the discrete feature group to convert the discrete values into discrete codes in the preset encoding dictionary;
[0089] S33. On the participant side, normalization processing is performed on the continuous feature group, and the continuous values are linearly scaled to a uniform numerical range according to a preset interval.
[0090] S34. On the participant side, perform time window statistical processing on the behavioral feature group. By setting the time window length, calculate the number of occurrences, occurrence frequency and sequence statistics of the behavioral field within the window to form a numerical representation of the behavioral features.
[0091] S35. On the participant side, initialize the local feature group control vectors for the discrete feature group, continuous feature group and behavioral feature group respectively. During initialization, set all components of the local feature group control vector to zero.
[0092] S36. On the participant side, the processed discrete features, continuous features and behavioral features are concatenated to form a local feature matrix, and an index relationship is established between the local feature matrix and the corresponding local feature group control vector.
[0093] In situations where credit data from multiple institutions exhibits inconsistencies in category fields, different units of numerical fields, and varying time spans of behavioral records, this invention preprocesses discrete, continuous, and behavioral feature groups. This ensures that the input features from participating institutions maintain consistency in dimensional structure and statistical scale during subsequent federated training, preventing model update direction shifts due to data distribution differences. Furthermore, converting behavioral fields into time window statistics enhances the model's ability to express behavioral change patterns. This allows the improved SCAFFOLD algorithm to independently update the control vectors corresponding to the three feature groups based on the same feature scale when performing group drift correction, thus highlighting the adaptability and stability of this invention for non-independent and identically distributed data in credit scoring scenarios.
[0094] In this embodiment, S4 includes:
[0095] S41. Receive global model parameters from the server side on the participant side, and store the global model parameters locally on the participant side as a local model parameter copy. The local model parameter copy is consistent with the global model parameters in terms of dimension and arrangement order.
[0096] S42. Read the initialized local risk interval control vector set on the participant side. The local risk interval control vector set includes control vectors established for low-risk intervals, medium-risk intervals and high-risk intervals respectively.
[0097] S43. Read the initialized local feature group control vector set on the participant side. The local feature group control vector set includes control vectors established for discrete feature groups, continuous feature groups and behavioral feature groups respectively.
[0098] S44. Set a default score threshold on the participant side, store the default score threshold in the local configuration, and reserve a storage location for a threshold sensitivity factor in the local control structure based on the default score threshold. The threshold sensitivity factor is a numerical field that represents the degree of difference between the predicted value and the default score threshold. The threshold sensitivity factor value is set to zero during initialization.
[0099] S45. On the participant side, according to the combination of risk interval dimension and feature group dimension, the local risk interval control vector set, the local feature group control vector set and the threshold sensitivity factor are indexed and arranged in the same data structure to form an improved SCAFFOLD local control structure containing risk interval control vector, feature group control vector and threshold sensitivity factor.
[0100] S46. On the participant side, establish a one-to-one correspondence between the improved SCAFFOLD local control structure and the local model parameter copy, and record the control vector index and threshold sensitivity factor storage location in the improved SCAFFOLD local control structure according to the parameter index of the local model parameter copy.
[0101] In this invention, the improved SCAFFOLD local control structure organizes multiple control vectors using a dual-indexing approach of risk interval dimension and feature group dimension. This allows the control structure to express differences in customer risk and feature type within the same data framework, thus providing a structural foundation that can be directly used for partitioning and grouping gradient correction. After the default score threshold is written into the control structure as an independent field, corresponding sensitivity values can be generated for prediction results close to the threshold during local training and maintained with an indexed association with the control structure, ensuring that subsequent drift correction operations can obtain complete control quantities. This multi-dimensional combination of structures provides the necessary data organization for multi-level drift correction, representing a key structural innovation of this invention compared to the traditional single control vector architecture.
[0102] In this embodiment, S5 includes:
[0103] S51. On the participant side, training samples are selected in batches from the local feature matrix. The training samples are input into the local model parameter copy to perform forward calculation and obtain the corresponding predicted values.
[0104] S52. On the participant side, calculate the threshold sensitive weight based on the numerical difference between the predicted value and the default score threshold. The threshold sensitive weight is the product of the absolute difference and the preset weight coefficient. After calculation, store the threshold sensitive weight in the threshold sensitive factor storage location.
[0105] S53. On the participant side, the local risk interval control vector is retrieved based on the risk interval identifier corresponding to the training sample. The local risk interval control vector is aligned with the gradient record of the local model parameter copy according to the parameter index order. Partition drift correction is performed. The partition drift correction is calculated by subtracting the difference between the local gradient and the local risk interval control vector.
[0106] S54. On the participant side, the local feature group control vector is retrieved according to the feature group corresponding to the training sample. The local feature group control vector is aligned with the gradient record after partition drift correction according to the feature group arrangement order. Feature group drift correction is performed. The feature group drift correction is calculated by subtracting the difference between the current gradient and the local feature group control vector.
[0107] S55. On the participant side, the gradient after the feature group drift correction is weighted and adjusted according to the value of the threshold sensitivity factor. The weighting adjustment is to perform multiplication scaling calculation on the gradient record according to the value of the threshold sensitivity factor.
[0108] S56. On the participant side, the weighted gradient record is written into the local model parameter copy. The local model parameter copy is updated by subtraction according to the learning rate initialized on the server side. At the same time, the local risk interval control vector and the local feature group control vector are updated by addition according to the same gradient update method, forming the local model parameter update amount and the local control vector update amount.
[0109] Based on a three-dimensional control structure, this invention performs partitioning and grouping corrections on gradient records during local training. This allows samples from different risk ranges and different feature groups to undergo independent offset corrections based on their respective control vectors, ensuring that drift in each dimension is decomposed and eliminated linearly before updates. The threshold sensitivity factor maintains a real-time correlation with the predicted value, generating a higher sensitivity value when the predicted result approaches the default score threshold. This allows gradient scaling operations to assign higher weights to model parameters in critical ranges, resulting in differentiated training effects for customers at critical risk. This joint execution process of partitioning, grouping, and threshold sensitivity constitutes the multi-level gradient correction core of the improved SCAFFOLD algorithm, providing a key innovative structure for solving the highly non-independent and identically distributed problem in credit scoring scenarios.
[0110] In this embodiment, S6 includes:
[0111] S61. Receive the local model parameter update amount uploaded by the participants on the server side. The local model parameter update amount is calculated from the difference between the local model parameter copy and the global model parameter of the previous round.
[0112] S62. Receive the local control vector update amount uploaded by the participants on the server side. The local control vector update amount consists of the current round update records of the local risk interval control vector and the local feature group control vector.
[0113] S63. On the server side, assign corresponding weights to each local model parameter update based on the number of training samples uploaded by the participants, and perform weighted summation calculation on the local model parameter update according to the weights to generate the updated global model parameters.
[0114] S64. On the server side, according to the order of local control vector update amounts, perform addition aggregation on the local risk interval control vector update records uploaded by the participants and the local feature group control vector update records to generate the updated global control vector.
[0115] S65. On the server side, the updated global model parameters and the updated global control vector are packaged and sent to the participating party side according to the communication protocol.
[0116] In a federated training scenario involving multiple institutions, the differences in data scale and distribution among these institutions can lead to shifts in model update amounts during the aggregation phase. By assigning weights to local model parameter update amounts on the server side based on the number of training samples, consistency between update amounts and data scale can be maintained during aggregation, ensuring that global model parameters accurately reflect the contribution ratios of multiple institutions. Aggregating control vector updates on the server side with the same index order ensures that risk interval control vectors and feature group control vectors maintain structural alignment in a cross-institutional environment. This allows the improved SCAFFOLD algorithm to continue using the complete multi-dimensional control structure in the next training round. The above aggregation method constitutes the necessary synchronization mechanism for supporting multi-level drift correction in this invention, contributing to the stable iteration of the control structure in a federated environment.
[0117] In this embodiment, S7 includes:
[0118] S71. After the server side determines that the federated training has met the preset convergence conditions, it sends a convergence command to the participating side. After receiving the convergence command, the participating side stops the local model parameter update operation.
[0119] S72. Load the final global model parameters sent by the server on the participant side, and store the final global model parameters as a copy of the final model parameters on the participant side.
[0120] S73. On the participant side, extract the structured feature data of the customer to be evaluated from the business system, and arrange the structured feature data into an inference feature vector according to the feature grouping order;
[0121] S74. On the participant side, the inference feature vector is input into the final model parameter copy to perform forward calculation. The matrix multiplication calculation and nonlinear transformation are completed in sequence according to the parameter order of each layer of the model to obtain the customer's credit score output.
[0122] S75. On the participating party's side, the credit score value is recorded as the customer score result and written into the customer's credit file according to the field format of the business system.
[0123] To ensure the stability of the final score after federated training, this invention loads the same round of final global model parameters during the inference phase for each participating party. This ensures that multiple institutions maintain a consistent model structure and parameter source when performing customer credit assessments. The construction of inference feature vectors follows the feature grouping order established during the training phase, ensuring consistency in dimensional arrangement and numerical organization between inference and training inputs, thereby guaranteeing the continuity and reproducibility of forward computation. By performing forward computation within the local system, credit scores can be generated without uploading original customer data and directly interface with the business system's file structure, forming a complete application process from distributed training to local inference.
[0124] Example 1:
[0125] To verify the feasibility and effectiveness of this invention in a real-world business environment, it was applied to a joint credit granting scenario involving a national commercial bank and two regional banks. These three institutions exhibit significant differences in customer structure, regional economic environment, income levels, and default behavior distribution, making centralized data sharing impossible and hindering the establishment of a unified training set for traditional centralized credit scoring models. Against this backdrop, the bank consortium decided to adopt a federated learning model for joint modeling. However, in actual trials, it was found that existing federated learning methods struggled to handle the heterogeneity and risk distribution differences among the multi-institutional data, resulting in significant fluctuations in model performance. Particularly in regional banks with large differences in the proportion of high-risk customers, the gradient shift of the local model deviated severely from the direction of the global model, causing multiple oscillations in the global model during training and insufficient scoring stability.
[0126] In this embodiment, each participating institution first obtains structured credit data from its business system, including income level, liabilities and assets, historical overdue payments, transaction frequency, repayment records, etc. The data is then cleaned according to the cleaning process described in the claims to impute missing values, replace outliers, and standardize the format.
[0127] During the risk interval construction process, each institution sets its local risk interval boundaries based on the number of defaults and the duration of defaults. Due to significant differences in default rates among the three institutions, the sample distribution after risk interval division is not consistent. For example, regional bank B has a high-risk customer ratio of 12.6%, while national bank A has only 4.3%. This structural difference is precisely the main reason for the instability of convergence in traditional federated learning models. In this embodiment, each institution initializes three types of risk interval control vectors based on its own risk distribution, providing a local offset record basis for subsequent partition drift correction.
[0128] During the feature grouping phase, each institution divides its features into discrete, continuous, and behavioral groups based on field type, and initializes the feature group control vectors accordingly. For example, the discrete group contains 21 category fields, the continuous group contains 14 indicator fields, and the behavioral group contains 6 time-series statistical fields. Through grouping preprocessing, the features of each institution are consistent in dimensionality and arrangement order, enabling federated training to be conducted on a unified feature structure. Each institution performs forward computation on batch input samples, records predicted values, and calculates a threshold sensitivity factor based on the difference between the predicted value and the default score threshold. For customers close to the default threshold, such as samples with predicted values in the range of 0.42–0.48, the threshold sensitivity factor is significantly increased, which enhances the gradient update weights of the model in these critical regions, helping to improve the model's boundary discrimination ability. Subsequently, the model sequentially performs partition drift correction and feature group drift correction, independently deducting the offsets brought by different risk intervals and different feature groups, resulting in gradient updates that are closer to the global optimum.
[0129] To verify the beneficial effects of the present invention, the method of the present invention was compared with the traditional method and the FedAvg method. The experimental results are shown in Table 1:
[0130] Table 1. Performance Comparison of the Improved SCAFFOLD Federal Credit Scoring Model of this Invention
[0131] Comparison indicators Method of the present invention Traditional methods FedAvg AUC 0.853 0.804 0.762 KS value 0.411 0.354 0.312 Scoring stability (training fluctuation range) ±0.011 ±0.027 ±0.042 High-risk customer recall rate (%) 81.7 73.2 68.5 The global iteration rounds have converged. 53 87 124 Mean gradient offset in high-risk intervals 0.041 0.095 0.137
[0132] As shown in Table 1, the method of this invention exhibits significantly better overall performance than traditional methods and FedAvg in multi-institution credit scoring scenarios. By constructing a multi-dimensional control structure composed of risk interval control vectors, feature group control vectors, and threshold sensitivity factors, this invention effectively addresses the non-independent and identically distributed problem of cross-institution data. In terms of discriminative ability, the AUC is improved to 0.853 and the KS value is improved to 0.411, significantly better than traditional models; the recall rate of high-risk customers reaches 81.7%, an improvement of more than eight percentage points compared to traditional methods, significantly enhancing the ability to identify bad debts; the training process is stable, with the score fluctuation range reduced to ±0.011, effectively avoiding the oscillations and instability that occur in traditional methods. Relying on the partition drift correction and feature group drift correction mechanisms, the gradient shift in the high-risk interval of this invention is reduced to 0.041, the lowest among the three methods, fully demonstrating that this invention can effectively suppress the gradient shift caused by the difference in risk distribution among institutions. Global training only requires 53 rounds to converge, significantly reducing the communication cost and computational burden in the federated learning process. Overall, this invention has achieved comprehensive improvements in key indicators such as accuracy, stability, risk identification capability, and convergence efficiency, providing a practical solution for building highly reliable federal credit scoring models in financial scenarios.
[0133] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A personal credit scoring method based on federated learning, characterized in that, Includes the following steps: S1. Obtain customer credit data on the participant side, perform cleaning processing, and initialize global model parameters and global control vector of the improved SCAFFOLD algorithm on the server side. S2. On the participant side, risk ranges are set based on historical defaults. The cleaned customer credit data is divided into low-risk, medium-risk, and high-risk ranges, and the local risk range control vector is initialized. S3. On the participant side, based on the field properties, the features are divided into discrete feature groups, continuous feature groups, and behavioral feature groups. Preprocessing is then performed and the local feature group control vector is initialized. S4. Load the global model parameters on the participant side to construct an improved SCAFFOLD local control structure that includes a risk interval control vector, a feature group control vector, and a threshold sensitivity factor. S5. Calculate the gradient of the local model parameters on the participant side, perform partition drift correction and feature group drift correction using the improved SCAFFOLD local control structure, determine the threshold sensitive weight based on the difference between the predicted value and the default score threshold, and update the local model parameters and local control vector based on the corrected gradient. S6. Receive the local model parameter update and control vector update uploaded by the participants on the server side, perform weighted aggregation based on the number of samples to update the global model parameters and global control vector, and send the update results to the participants; S7. When the federated training meets the convergence condition, fix the global model parameters, use the local feature data of the participants to perform forward inference, and output the personal credit score results.
2. The personal credit scoring method based on federated learning according to claim 1, characterized in that, S1 includes: S11. On the participating party's side, customer credit data is extracted from the local business system. The customer credit data includes identity field, income field, asset field, liability field, historical repayment record field, and transaction behavior record field. S12. Perform missing value filling processing on the customer credit data. Numeric fields are filled with the median of the same customer group, enumeration fields are filled with the highest frequency of occurrence of the field, and fields whose values cannot be determined are filled with preset placeholders. S13. Perform outlier removal processing on numeric fields, replace values below the lower limit with the lower limit and values above the upper limit with the upper limit according to the preset normal range, and delete illegal character records that cannot be converted into numeric values. S14. Perform format unification processing on the date field, amount field, category field, and Boolean field, converting the date field to a unified date format, the amount field to a unified currency and retaining a unified number of decimal places, the category field to a preset code, and the Boolean field to a unified binary code, forming structured clean data; S15. On the server side, initialize the global model parameters based on the field dimensions and model structure of the structured cleaned data, set the weight parameters to random values that satisfy the preset distribution, set the bias parameters to zero, and initialize the global control vector of the improved SCAFFOLD algorithm, setting the control parameters in the control vector to zero.
3. The personal credit scoring method based on federated learning according to claim 1, characterized in that, S2 includes: S21. On the participant side, risk range boundaries are set based on the historical default information recorded in the cleaned customer credit data. Customer samples are divided into ranges according to the number of defaults and the duration of defaults, and customer samples are respectively classified into low-risk range, medium-risk range and high-risk range. S22. On the participant side, based on the interval division results, a risk interval identifier is added to each customer sample, and the risk interval identifier and the structured feature data of the corresponding customer sample are stored together to form a training sample with interval identifier. S23. On the participant's side, initialize local risk interval control vectors for low-risk intervals, medium-risk intervals, and high-risk intervals respectively. During initialization, set all components of the local risk interval control vectors to zero. S24. On the participant side, establish an index relationship between the training samples with interval labels and the corresponding local risk interval control vector.
4. The personal credit scoring method based on federated learning according to claim 1, characterized in that, S3 includes: S31. On the participant side, based on the value type of the fields in the cleaned customer credit data, the features are divided into discrete feature groups, continuous feature groups, and behavioral feature groups. The discrete feature groups are categorical value fields, the continuous feature groups are numerical value fields, and the behavioral feature groups are fields that record the number of transactions, transaction frequency, or behavioral time series. S32. On the participant side, perform encoding processing on the discrete feature group to convert the discrete values into discrete codes in the preset encoding dictionary; S33. On the participant side, normalization processing is performed on the continuous feature group, and the continuous values are linearly scaled to a uniform numerical range according to a preset interval. S34. On the participant side, perform time window statistical processing on the behavioral feature group. By setting the time window length, calculate the number of occurrences, occurrence frequency and sequence statistics of the behavioral field within the window to form a numerical representation of the behavioral features. S35. On the participant side, initialize the local feature group control vectors for the discrete feature group, continuous feature group and behavioral feature group respectively. During initialization, set all components of the local feature group control vector to zero. S36. On the participant side, the processed discrete features, continuous features and behavioral features are concatenated to form a local feature matrix, and an index relationship is established between the local feature matrix and the corresponding local feature group control vector.
5. The personal credit scoring method based on federated learning according to claim 1, characterized in that, S4 includes: S41. Receive global model parameters from the server side on the participant side, and store the global model parameters locally on the participant side as a local model parameter copy. The local model parameter copy is consistent with the global model parameters in terms of dimension and arrangement order. S42. Read the initialized local risk interval control vector set on the participant side. The local risk interval control vector set includes control vectors established for low-risk intervals, medium-risk intervals and high-risk intervals respectively. S43. Read the initialized local feature group control vector set on the participant side. The local feature group control vector set includes control vectors established for discrete feature groups, continuous feature groups and behavioral feature groups respectively. S44. Set a default score threshold on the participant side, store the default score threshold in the local configuration, and reserve a storage location for a threshold sensitivity factor in the local control structure based on the default score threshold. The threshold sensitivity factor is a numerical field that represents the degree of difference between the predicted value and the default score threshold. The threshold sensitivity factor value is set to zero during initialization. S45. On the participant side, according to the combination of risk interval dimension and feature group dimension, the local risk interval control vector set, the local feature group control vector set and the threshold sensitivity factor are indexed and arranged in the same data structure to form an improved SCAFFOLD local control structure containing risk interval control vector, feature group control vector and threshold sensitivity factor. S46. On the participant side, establish a one-to-one correspondence between the improved SCAFFOLD local control structure and the local model parameter copy, and record the control vector index and threshold sensitivity factor storage location in the improved SCAFFOLD local control structure according to the parameter index of the local model parameter copy.
6. The personal credit scoring method based on federated learning according to claim 1, characterized in that, S5 includes: S51. On the participant side, training samples are selected in batches from the local feature matrix. The training samples are input into the local model parameter copy to perform forward calculation and obtain the corresponding predicted values. S52. On the participant side, calculate the threshold sensitive weight based on the numerical difference between the predicted value and the default score threshold. The threshold sensitive weight is the product of the absolute difference and the preset weight coefficient. After calculation, store the threshold sensitive weight in the threshold sensitive factor storage location. S53. On the participant side, the local risk interval control vector is retrieved based on the risk interval identifier corresponding to the training sample. The local risk interval control vector is aligned with the gradient record of the local model parameter copy according to the parameter index order. Partition drift correction is performed. The partition drift correction is calculated by subtracting the difference between the local gradient and the local risk interval control vector. S54. On the participant side, the local feature group control vector is retrieved according to the feature group corresponding to the training sample. The local feature group control vector is aligned with the gradient record after partition drift correction according to the feature group arrangement order. Feature group drift correction is performed. The feature group drift correction is calculated by subtracting the difference between the current gradient and the local feature group control vector. S55. On the participant side, the gradient after the feature group drift correction is weighted and adjusted according to the value of the threshold sensitivity factor. The weighting adjustment is to perform multiplication scaling calculation on the gradient record according to the value of the threshold sensitivity factor. S56. On the participant side, the weighted gradient record is written into the local model parameter copy. The local model parameter copy is updated by subtraction according to the learning rate initialized on the server side. At the same time, the local risk interval control vector and the local feature group control vector are updated by addition according to the same gradient update method, forming the local model parameter update amount and the local control vector update amount.
7. The personal credit scoring method based on federated learning according to claim 1, characterized in that, S6 includes: S61. Receive the local model parameter update amount uploaded by the participants on the server side. The local model parameter update amount is calculated from the difference between the local model parameter copy and the global model parameter of the previous round. S62. Receive the local control vector update amount uploaded by the participants on the server side. The local control vector update amount consists of the current round update records of the local risk interval control vector and the local feature group control vector. S63. On the server side, assign corresponding weights to each local model parameter update based on the number of training samples uploaded by the participants, and perform weighted summation calculation on the local model parameter update according to the weights to generate the updated global model parameters. S64. On the server side, according to the order of local control vector update amounts, perform addition aggregation on the local risk interval control vector update records uploaded by the participants and the local feature group control vector update records to generate the updated global control vector. S65. On the server side, the updated global model parameters and the updated global control vector are packaged and sent to the participating party side according to the communication protocol.
8. The personal credit scoring method based on federated learning according to claim 1, characterized in that, S7 includes: S71. After the server side determines that the federated training has met the preset convergence conditions, it sends a convergence command to the participating side. After receiving the convergence command, the participating side stops the local model parameter update operation. S72. Load the final global model parameters sent by the server on the participant side, and store the final global model parameters as a copy of the final model parameters on the participant side. S73. On the participant side, extract the structured feature data of the customer to be evaluated from the business system, and arrange the structured feature data into an inference feature vector according to the feature grouping order; S74. On the participant side, the inference feature vector is input into the final model parameter copy to perform forward calculation. The matrix multiplication calculation and nonlinear transformation are completed in sequence according to the parameter order of each layer of the model to obtain the customer's credit score output. S75. On the participating party's side, the credit score value is recorded as the customer score result and written into the customer's credit file according to the field format of the business system.