Supply chain financial risk prediction method based on buyer transaction

By employing a supply chain finance risk prediction method based on buyer transactions, and utilizing historical transaction data and the XGBoost model, the problem of lag in traditional risk assessment is solved. This enables dynamic identification and accurate prediction of buyer credit risk, reduces bad debt risk, and enhances supply chain stability.

CN121998766APending Publication Date: 2026-05-08SHENZHEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN UNIV
Filing Date
2025-12-15
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing technologies lack the ability to dynamically predict buyer credit risk, and traditional risk assessment methods cannot identify and quantify real-time risk signals in buyer transactions in a timely manner, resulting in significant lag in risk warnings and potentially triggering bad debt losses and liquidity crises.

Method used

This paper adopts a supply chain finance risk prediction method based on buyer transactions. By acquiring and preprocessing historical transaction data, applying the Pareto distribution law to define risk categories, combining the XGBoost machine learning model and random oversampling technology to optimize model parameters, and using indicators such as receiver operating characteristic curves and F1 scores to evaluate performance, the paper achieves accurate risk prediction and early warning.

Benefits of technology

It significantly improves the accuracy and practicality of supply chain finance risk prediction, dynamically identifies high-risk customers, reduces the probability of bad debts for financial institutions, enhances the resilience and sustainability of the supply chain, and provides reliable risk management technology support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121998766A_ABST
    Figure CN121998766A_ABST
Patent Text Reader

Abstract

The invention relates to a supply chain financial risk prediction method based on buyer transaction, in particular to the field of supply chain finance, and the method can dynamically recognize high-risk customers based on buyer historical transaction data in combination with a machine learning model and a systematic preprocessing process, effectively overcomes the hysteresis defect of traditional risk assessment, and improves the risk assessment efficiency. According to the method, risk categories are defined by applying a Pareto distribution rule, sample distribution is balanced by adopting a random oversampling technology, the model shows excellent robustness when processing data with non-uniform categories, the second-order Taylor expansion characteristic and grid search optimization of the XGBoost algorithm are utilized, the model training efficiency is high, the prediction stability is high, and the method is suitable for large-scale popularization and application. Meanwhile, the performance is comprehensively evaluated through indexes such as a subject working characteristic curve and an F1 score, in addition, a characteristic importance analysis and threshold optimization mechanism provides explainable decision support for a manager, the risk of default is warned in advance, payment terms are optimized, and supply chain cooperation is strengthened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of supply chain finance technology, and more specifically, to a method for predicting supply chain finance risks based on buyer transactions. Background Technology

[0002] Supply chain finance, a financing model based on core enterprises and genuine trade backgrounds, has become an important tool for solving the financing difficulties of SMEs in recent years. In buyer-based supply chain finance scenarios, financial institutions typically provide accounts receivable financing, inventory financing, and other financial services to numerous upstream SME suppliers, centered around core buyer enterprises with high credit ratings. In this business model, the buyer's creditworthiness and payment ability become key elements of risk control. Actual business involves multiple participants, including core buyers, suppliers, financial institutions, and third-party logistics companies, resulting in a complex and dynamic transaction chain. Traditional risk management methods mainly rely on manual review of buyer financial statements, historical transaction records, and static credit rating information, combined with industry experience, to assess risk. With the increasing globalization of supply chains and the surge in transaction data, the operating conditions and payment behavior of buyer enterprises may change rapidly due to market fluctuations, industry policies, or unforeseen events, making the lag of static risk assessment models increasingly prominent.

[0003] The core technical challenge facing current supply chain finance risk management systems lies in the lack of dynamic forecasting capabilities for buyer credit risk. Existing technologies typically employ statistical analysis models based on historical data. These models often rely on financial indicators and static credit scores, failing to effectively capture real-time risk signals in buyer transactions. For example, buyers may experience payment delays due to temporary cash flow problems or sudden changes in payment terms due to supply chain disruptions. These dynamic behavioral characteristics are difficult to identify and quantify in a timely manner using traditional risk control models. More specifically, existing technologies lack machine learning analysis tools targeting the multi-dimensional characteristics of buyer transactions and have failed to establish dynamic correlation models between risk indicators and payment defaults, resulting in significant lags in early warning of potential risks. This technical deficiency exposes financial institutions to operational risks such as untimely risk identification and inadequate early warning mechanisms when conducting accounts receivable factoring and reverse factoring businesses, potentially leading to bad debt losses and liquidity crises. Summary of the Invention

[0004] This invention addresses the technical problems existing in the prior art by providing a supply chain finance risk prediction method based on buyer transactions, thereby resolving the issues raised in the background section.

[0005] The technical solution of this invention to solve the above-mentioned technical problems is as follows: a supply chain finance risk prediction method based on buyer transactions, comprising the following steps:

[0006] S1. When the supply chain finance system receives a risk prediction request, it obtains the buyer's historical transaction dataset. The historical transaction dataset contains payment behavior variables and transaction interaction variables. The payment behavior variables include the average payment time and the overdue payment ratio. The transaction interaction variables include whether supply chain financing is provided and whether payment terms are changed. Then, the historical transaction data is preprocessed. The missing values ​​of continuous variables are handled by the mean imputation method, the missing values ​​of discrete variables are handled by the classification model, and the correlation analysis is performed to remove highly redundant variables with correlation coefficients higher than the preset threshold. After preprocessing, a cleaned and standardized dataset is obtained.

[0007] S2. Based on the preprocessed standardized data, the Pareto distribution law is applied to define risk categories. The proportion of invoices not paid according to the agreed terms is used as the benchmark variable, and its 80th percentile is used as the classification threshold. Samples above the threshold are marked as high-risk categories, and the remaining samples are marked as low-risk categories. To address the problem of uneven category distribution, random oversampling technology is used to balance the training data. By replicating high-risk category samples, the number of high- and low-risk samples is balanced, resulting in a balanced training dataset.

[0008] S3. Based on the balanced training set, construct and train the XGBoost machine learning model. First, divide the data into training subset and test subset according to a preset ratio. Then, optimize the model parameter combination through grid search. At the same time, use multi-fold cross-validation to evaluate the model stability. During the training process, use the second-order Taylor expansion property of the XGBoost algorithm to improve computational efficiency and generate an optimized risk prediction model.

[0009] S4. The trained risk prediction model is evaluated using a test subset. The model performance is quantified using three indicators: receiver operating characteristic (ROC) curve, area under the curve (AUC), and F1 score. The ROC curve is used to analyze the classification ability of the risk prediction model under different decision thresholds, the AUC provides an overall performance measure, and the F1 score comprehensively evaluates the prediction accuracy. Once the evaluation indicators reach the preset standards, new buyer transaction data is input into the risk prediction model, which outputs classification results for high-risk or low-risk categories, thereby achieving accurate prediction and early warning of supply chain finance risks.

[0010] In a preferred embodiment, in step S1, the historical transaction dataset in the data acquisition and preprocessing step includes payment behavior variables and transaction interaction variables, wherein the payment behavior variables include average payment time and overdue payment ratio, and the transaction interaction variables include whether supply chain financing is provided and whether payment terms are changed.

[0011] When handling missing values, mean imputation is used for continuous variables, that is, the arithmetic mean of each continuous variable is calculated and the missing value is replaced with the mean. For discrete variables, a decision tree-based classification model is used for prediction imputation, that is, the decision tree model is trained on non-missing data to predict missing values.

[0012] During correlation analysis, a redundancy index based on eigenvalue decomposition is used. Redundancy is quantified by calculating the ratio of the absolute value of the difference between the eigenvalues ​​of a pair of variables to the square root of the sum of squares of the eigenvalues. When the redundancy score is lower than a preset threshold, the variable is identified as highly redundant and removed.

[0013] When standardizing data, the minimum-maximum scaling method is used. The value of each continuous variable is reduced by its minimum value and then divided by the difference between the maximum and minimum values, so that the variable values ​​are normalized to the range of zero to one.

[0014] In a preferred embodiment, in step S1, the preset threshold is set to 0.1 for redundancy judgment in correlation analysis; eigenvalue decomposition is performed based on the covariance matrix of the variable set, and the eigenvalue represents the variance contribution of the variable in the matrix.

[0015] The minimum and maximum values ​​in the min-max scaling method are calculated from the historical data of each continuous variable, ensuring that the standardized data are comparable.

[0016] In a preferred embodiment, in step S2, based on the preprocessed standardized data, the Pareto distribution law is applied to define risk categories. The proportion of invoices not paid according to the agreed terms is used as the benchmark variable, and its 80th percentile is used as the classification threshold. Samples above the threshold are marked as high-risk categories, and the remaining samples are marked as low-risk categories.

[0017] To address the issue of uneven class distribution, a random oversampling technique is employed to balance the training data. By replicating high-risk class samples, the number of high- and low-risk samples is balanced, resulting in a balanced training dataset.

[0018] In a preferred embodiment, in step S2, the 80th decimal place is calculated by the inverse function of the empirical cumulative distribution function, specifically by finding the smallest real number such that the cumulative distribution function value is greater than or equal to 0.8.

[0019] Random oversampling technology replicates samples from high-risk samples with replacement, making the number of high-risk samples equal to the number of low-risk samples.

[0020] In a preferred embodiment, in step S3, an XGBoost machine learning model is constructed and trained based on the balanced training set. First, the data is divided into a training subset and a test subset according to a preset ratio. Then, the model parameter combination is optimized by grid search method, and the model stability is evaluated by multi-fold cross-validation method.

[0021] During training, the second-order Taylor expansion property of the XGBoost algorithm is used to improve computational efficiency and generate an optimized risk prediction model.

[0022] In a preferred embodiment, in step S3, the data partitioning adopts a random stratified sampling method to ensure that the class distribution of the training set and the test set is consistent with the original data;

[0023] The grid search method traverses the preset parameter space to find the optimal parameter combination; multi-fold cross-validation divides the training set into multiple mutually exclusive subsets, which are used in turn as the validation set to evaluate the model performance.

[0024] XGBoost uses the first and second derivatives of the loss function for gradient boosting during training.

[0025] In a preferred embodiment, in step S4, the trained risk prediction model is evaluated using a test subset. The model performance is quantified using three metrics: the receiver operating characteristic (ROC) curve, the area under the curve (AUC), and the harmonic mean of precision and recall. The ROC curve is plotted by calculating the true positive rate and false positive rate by traversing decision thresholds. The true positive rate is the proportion of true positives to actual positives, and the false positive rate is the proportion of false positives to actual negatives. The AUC is obtained by integrating the area under the ROC curve. The harmonic mean of precision and recall is calculated by the harmonic mean of precision and recall. Precision is the proportion of true positives to predicted positives, and recall is the proportion of true positives to actual positives.

[0026] In a preferred embodiment, in step S4, after the performance evaluation index reaches the preset standard, the decision threshold is optimized by maximizing the difference between the true positive rate and the false positive rate to select the optimal decision threshold; wherein the difference between the true positive rate and the false positive rate is defined as the Youden index, and the optimal decision threshold is the threshold that makes the Youden index reach its maximum value.

[0027] In a preferred embodiment, in step S4, new buyer transaction data is input into the risk prediction model to obtain the prediction probability, and then the optimal decision threshold is applied for classification: when the prediction probability is greater than or equal to the optimal decision threshold, a high-risk category is output; otherwise, a low-risk category is output, thereby achieving accurate prediction and early warning of supply chain finance risks.

[0028] The beneficial effects of this invention are as follows: This invention significantly improves the accuracy and practicality of supply chain finance risk prediction through an innovative data-driven method. Based on historical transaction data of buyers, combined with machine learning models and a systematic preprocessing process, this method can dynamically identify high-risk customers, effectively overcoming the lag defects of traditional risk assessment. By applying the Pareto distribution law to define risk categories and using random oversampling technology to balance the sample distribution, the model exhibits excellent robustness when dealing with unevenly distributed data. Utilizing the second-order Taylor expansion characteristics and grid search optimization of the XGBoost algorithm, the model has high training efficiency and strong predictive stability. At the same time, performance is comprehensively evaluated through indicators such as receiver operating characteristic curves and F1 scores. In addition, feature importance analysis and threshold optimization mechanisms provide interpretable decision support for managers, helping to provide early warning of default risks, optimize payment terms, and strengthen supply chain collaboration. Ultimately, this invention not only reduces the probability of bad debts for financial institutions but also enhances the overall resilience and sustainability of the supply chain, providing reliable technical support for risk management in complex transaction environments. Attached Figure Description

[0029] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

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

[0031] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0032] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0033] This embodiment provides, for example Figure 1 The method for predicting supply chain finance risks based on buyer transactions, as shown, includes the following steps:

[0034] S1. When the supply chain finance system receives a risk prediction request, it obtains the buyer's historical transaction dataset. The historical transaction dataset contains payment behavior variables and transaction interaction variables. The payment behavior variables include the average payment time and the overdue payment ratio. The transaction interaction variables include whether supply chain financing is provided and whether payment terms are changed. Then, the historical transaction data is preprocessed. The missing values ​​of continuous variables are handled by the mean imputation method, the missing values ​​of discrete variables are handled by the classification model, and the correlation analysis is performed to remove highly redundant variables with correlation coefficients higher than the preset threshold. After preprocessing, a cleaned and standardized dataset is obtained.

[0035] S2. Based on the preprocessed standardized data, the Pareto distribution law is applied to define risk categories. The proportion of invoices not paid according to the agreed terms is used as the benchmark variable, and its 80th percentile is used as the classification threshold. Samples above the threshold are marked as high-risk categories, and the remaining samples are marked as low-risk categories. To address the problem of uneven category distribution, random oversampling technology is used to balance the training data. By replicating high-risk category samples, the number of high- and low-risk samples is balanced, resulting in a balanced training dataset.

[0036] S3. Based on the balanced training set, construct and train the XGBoost machine learning model. First, divide the data into training subset and test subset according to a preset ratio. Then, optimize the model parameter combination through grid search. At the same time, use multi-fold cross-validation to evaluate the model stability. During the training process, use the second-order Taylor expansion property of the XGBoost algorithm to improve computational efficiency and generate an optimized risk prediction model.

[0037] S4. The trained risk prediction model is evaluated using a test subset. The model performance is quantified using three indicators: receiver operating characteristic (ROC) curve, area under the curve (AUC), and F1 score. The ROC curve is used to analyze the classification ability of the risk prediction model under different decision thresholds, the AUC provides an overall performance measure, and the F1 score comprehensively evaluates the prediction accuracy. Once the evaluation indicators reach the preset standards, new buyer transaction data is input into the risk prediction model, which outputs classification results for high-risk or low-risk categories, thereby achieving accurate prediction and early warning of supply chain finance risks.

[0038] In this embodiment, it should be specifically noted that in step S1, the historical transaction dataset includes payment behavior variables and transaction interaction variables. The payment behavior variables include the average payment time and the overdue payment ratio, and the transaction interaction variables include whether supply chain financing is provided and whether payment terms are changed.

[0039] Specifically, when the supply chain finance system receives a risk prediction request, the system reads the historical transaction dataset D from the storage medium. raw The dataset D raw The data, derived from publicly available UK government data on large enterprises, spans from 2017 to 2020 and contains at least 21,820 observation records. The payment behavior variable set V... pay The focus is on quantifying the buyer's payment habits, while the transaction interaction variable set V... interact Used to capture the collaborative characteristics of both parties in a transaction. After data acquisition, the system verifies the integrity of the data format to ensure there are no structural errors.

[0040] When handling missing values, mean imputation is used for continuous variables, that is, the arithmetic mean of each continuous variable is calculated and the missing value is replaced with the mean. For discrete variables, a decision tree-based classification model is used for prediction imputation, that is, the decision tree model is trained on non-missing data to predict missing values.

[0041] Specifically, the system first detects dataset D. raw Missing values ​​in a subset of continuous variables Mean imputation is a method that calculates the mean value for each continuous variable v. c ∈V cont arithmetic mean μv c Achieve, where the average value is μv c The missing values ​​were calculated from the non-missing values ​​of the variable and replaced with μv. c For a subset of discrete variables The system trains a lightweight decision tree model M. impute For non-missing data, features such as other variable values ​​are used to predict missing values. After processing, the dataset D with missing values ​​imputed is output. imputed .

[0042] During correlation analysis, a redundancy index based on eigenvalue decomposition is used. Redundancy is quantified by calculating the ratio of the absolute value of the difference between the eigenvalues ​​of a pair of variables to the square root of the sum of squares of the eigenvalues. When the redundancy score is lower than a preset threshold, the variable is identified as highly redundant and removed.

[0043] The system is based on a dataset (D) imputed ) Calculate all variables (V = V) pay ∪V ineract The covariance matrix (Σ) of the eigenvalue matrix is ​​obtained, and the eigenvalue matrix (Λ) and eigenvector matrix (Q) are decomposed. The redundancy index is calculated using the following formula:

[0044]

[0045] Among them, v i v j λ represents the i-th and j-th variables in the variable set (V), which are specific variable names (e.g., "average payment time"), have no unit, and represent payment behavior or transaction interaction characteristics; i ,λ j Represents variable (v) i ) and (v j In the eigenvalue decomposition of the covariance matrix (Σ), the corresponding eigenvalues ​​are real numbers greater than zero, without units, reflecting the variance contribution of the variable in the data; R(v i v j ) represents the variable pair ((v i ,v j The redundancy score is a dimensionless scalar with a value range of [0,1]. A smaller value indicates higher redundancy between variables. This formula quantifies variable redundancy through the relative proportion of eigenvalue differences, ensuring the accuracy of redundancy assessment. When the redundancy score (R(v)) is less than or equal to the redundancy score (R(v)), the redundancy score is calculated as follows: i ,v j When the value is below a preset threshold (τ), the system determines the variable pair ((v)). i ,v j This step identifies high redundancy and removes one of the variables (e.g., retaining the variable with the higher contribution to variance); this step outputs the dimensionality-reduced dataset (D). reduced ).

[0046] When standardizing data, the minimum-maximum scaling method is used. The value of each continuous variable is reduced by its minimum value and then divided by the difference between the maximum and minimum values, so that the variable values ​​are normalized to the range of zero to one.

[0047] Specifically, the system targets dataset (D) reduced Continuous variables (v) in ) c ∈V contThe minimum-maximum scaling method is applied. The formula is as follows:

[0048]

[0049] Among them, v c Represents the dataset (D) reduced A continuous variable (such as "average payment time") in the table takes real values, representing the original variable values; min(v c ) represents the variable (v) c The minimum value of the variable in the historical dataset, a real number, is calculated from all observations of the variable; max(v c ) represents the variable (v) c The maximum value in the historical dataset, a real number, calculated from all observations of the variable; v c ' represents the standardized variable value, a dimensionless scalar with a range of [0,1]. This formula eliminates the influence of dimensions on continuous variables through linear transformation, bringing all variables to the same scale and improving the stability and comparability of subsequent model processing. After processing, the final cleaned standardized dataset (D) is output. clean ), which serves as the input for step S2.

[0050] In this embodiment, it should be specifically noted that in step S1, the preset threshold is set to 0.1, which is used for redundancy judgment in correlation analysis.

[0051] Specifically, the parameter settings for the correlation analysis sub-step are further clarified: the preset threshold (τ) is fixed at 0.1, which is derived from historical data experiments and used for the redundancy score (R(v)). i v j The judgment of (R(v)). i v j When ) < τ), the system automatically performs a variable removal operation.

[0052] Eigenvalue decomposition is based on the covariance matrix of the variable set, and the eigenvalues ​​represent the variance contribution of the variables in the matrix.

[0053] Specifically, the basis of eigenvalue decomposition is the covariance matrix (Σ), obtained by calculating the covariance of the variable set (V), and the eigenvalue decomposition (Σ=QΛQ) -1 In ), the elements (λ) of the diagonal matrix (Λ) of eigenvalues ​​(λ) i Each variable (v) was quantified. i The variance contribution of a variable is denoted as , and a larger value indicates that the variable has a stronger influence on the dataset.

[0054] The minimum and maximum values ​​in the min-max scaling method are calculated from the historical data of each continuous variable, ensuring that the standardized data are comparable.

[0055] Specifically, the parameters for the data standardization sub-step are sourced from: the minimum value (min(v)). c )) and maximum value (max(v c Dynamically extracting data from historical transaction datasets (D) raw The calculations ensure that the standardization process adapts to the data distribution, avoiding scale bias in future data applications.

[0056] Through the above implementation methods, step S1 achieves the transformation of data from its original state to high-quality input, providing a reliable foundation for subsequent risk prediction.

[0057] In this embodiment, it is specifically noted that in step S2, based on the preprocessed standardized data, the Pareto distribution law is applied to define risk categories. The proportion of invoices not paid according to the agreed terms is used as the benchmark variable, and its 80th percentile is used as the classification threshold. Samples above the threshold are marked as high-risk categories, and the remaining samples are marked as low-risk categories.

[0058] Specifically, the system is based on the standardized data (D) output in step S1. clean Define risks using standardized data (D). clean It contains multiple feature variables, among which the benchmark variable (V) risk The risk category is defined as "the proportion of invoices not paid according to the agreed terms," ​​which is a continuous variable with a value range of [0,1]. The risk category is defined by calculating the 80th percentile threshold (Q). 80 This is achieved through advanced calculations using the inverse function of the Empirical Cumulative Distribution Function (ECDF), as shown in the following formula:

[0059]

[0060] Where x represents the benchmark variable (V) risk The potential values ​​of ) are real numbers, ranging from [0,1], representing the possible values ​​of the invoice ratio; Represents the benchmark variable (V) risk The empirical cumulative distribution function of is defined as follows: N is the total number of samples (taken from standardized data (D)). clean The sample size, such as N≥21,820. This is an indicator function (it takes the value 1 when the condition is true, and 0 otherwise). The baseline variable (V) for the i-th sample risk ) value, empirical cumulative distribution function ( The value range of Q is [0,1], reflecting the cumulative probability of the data distribution; 80The quantile threshold, representing the 80th quartile, is a real number ranging from [0,1] and is used to distinguish between high-risk and low-risk categories. This formula accurately calculates the quantile threshold using the inverse function of the empirical cumulative distribution function, ensuring that the threshold (Q) is accurate. 80 This corresponds to the 80% position of the data distribution, improving the mathematical rigor and robustness of the risk category definition. After calculation, the system will assign the baseline variable value for each sample ( ) and threshold (Q) 80 Comparison: If Then mark the risk category label y i =1 (high-risk category), otherwise mark y i =0 (low-risk category), output the dataset with risk labels (D) labeled ).

[0061] To address the issue of uneven class distribution, a random oversampling technique is employed to balance the training data. By replicating high-risk class samples, the number of high- and low-risk samples is balanced, resulting in a balanced training dataset.

[0062] Specifically, the system is based on a risk-labeled dataset (D labeled ) Detection category distribution, if the number of high-risk samples (N) high The number of low-risk samples is less than the number of low-risk samples (N). low If ), then random oversampling will be performed;

[0063] The specific process is as follows: from the high-risk sample subset (D) high Random sampling with replacement is performed in the sample, and N copies are made. low -N high From the given samples, generate a new sample set (D′). high Then, the original high-risk samples and the newly added samples are merged to obtain a balanced high-risk sample set (D″). high ), finally balancing the dataset (D balanced =D″ high ∪D low After processing, the number of high-risk samples (N′) high ) and the number of low-risk samples (N) low The training dataset (D) is equal to the given dataset, achieving a 1:1 balanced ratio. balanced This is used for subsequent model training.

[0064] In this embodiment, it should be specifically noted that in step S2, the 80th decimal place is calculated by the inverse function of the empirical cumulative distribution function, specifically by finding the smallest real number such that the cumulative distribution function value is greater than or equal to 0.8.

[0065] Specifically, further clarifying the details of threshold calculation: empirical cumulative distribution function ( Based on historical data (i.e., standardized data (D)clean The calculation and solution of the inverse function are achieved through iterative search, for example, starting from x = 0 and gradually increasing the value of x until the condition is met. The minimum x value is the 80th decimal threshold (Q). 80 This method ensures that the threshold accurately matches the data distribution, avoiding approximate calculation errors.

[0066] Random oversampling technology replicates samples from high-risk samples with replacement, making the number of high-risk samples equal to the number of low-risk samples.

[0067] Specifically, sample balancing operations: Sampling with replacement means that each high-risk sample can be replicated multiple times, with the number of replications determined by the difference in number (N). low -N high It was decided that a random number generator would be used in the sampling process to ensure randomness and avoid introducing bias. Ultimately, the sample distribution was balanced, improving the model training effect.

[0068] Through the above implementation methods, step S2 achieves accurate definition of risk categories and balanced sample distribution, providing a high-quality data foundation for subsequent model training.

[0069] In this embodiment, it is specifically noted that in step S3, based on the balanced training set, an XGBoost machine learning model is constructed and trained. First, the data is divided into a training subset and a test subset according to a preset ratio. Then, the model parameter combination is optimized by grid search method, and the model stability is evaluated by multi-fold cross-validation method. During the training process, the second-order Taylor expansion property of the XGBoost algorithm is used to improve the computational efficiency and generate an optimized risk prediction model.

[0070] Specifically, the system is based on the balanced training set (D) output in step S2. balanced The model is trained, and the balanced training set (D) is used. balanced It contains a sample feature matrix and a risk label vector, and the total number of samples is denoted as N. balanced (Positive integer, based on S2 output), First, the data partitioning sub-step: The system uses a random stratified sampling method to partition the balanced training set (D) according to a preset ratio ρ = 0.7 (real number, ranging from 0 to 1). balanced ) divided into training subsets (D train ) and test subset (D test Training subset (D) train ) sample size Test subset (D) test The number of samples N test =N balanced -N train Random stratified sampling ensures that the training subset (D) train ) and test subset (Dtest The ratio of high-risk to low-risk categories in the balanced training set (D) balanced Consistency is maintained to avoid discrepancies in the classification.

[0071] Then, the model training and parameter optimization sub-steps: the system uses a training subset (D train An XGBoost model is constructed, and its parameter combinations are optimized using a grid search method. The parameter combinations include the maximum tree depth *d* (a positive integer, ranging from 3 to 10), the learning rate *η* (a real number, ranging from 0.01 to 0.3), and the subsampling ratio *s* (a real number, ranging from 0.6 to 1.0). The grid search iterates through all combinations in the preset parameter space. For each parameter combination, the XGBoost model is trained, and its performance is evaluated. During training, the second-order Taylor expansion property of the XGBoost algorithm is utilized to improve computational efficiency. Specifically, the objective function of the *t*-th tree is approximated using the following formula:

[0072]

[0073] Where i represents the index of the training sample, which is a positive integer and takes values ​​in the range 1 ≤ i ≤ N. train , representing the training subset (D train The sample number in ); x i Let represent the feature vector of the i-th sample, which is a real number vector taken from the training subset (D). train The feature matrix of f represents the feature values ​​of the sample; t (x i ) represents the t-th tree for sample x i The predicted value of g is a real number, representing the output of the current tree; i The first derivative of the loss function is expressed by the formula: Where L is the loss function (e.g., logarithmic loss), y i For real labels, g represents the cumulative prediction value for the first t-1 trees. i h is a real number, reflecting the gradient direction of the loss function; i The second derivative of the loss function is expressed by the formula: h i Ω(f) is a real number, reflecting the curvature information of the loss function; t ) represents the regularization term for the t-th tree, used to control model complexity, such as Where T is the number of leaf nodes, w is the leaf weight vector, and γ and λ are regularization coefficients; this formula approximates the objective function as a quadratic function through a second-order Taylor expansion, uses first-order and second-order derivative information to accelerate the gradient boosting process, avoids the use of common statistics such as variance or standard deviation, and ensures the efficiency and numerical stability of model training.

[0074] Simultaneously, the multi-fold cross-validation evaluation sub-step: the system uses the multi-fold cross-validation method to evaluate model stability, with the number of folds K = 10 (a positive integer); the training subset (D) is then used to evaluate the model stability. train The model is randomly divided into K mutually exclusive subsets. K-1 subsets are used in turn to train the model, and the remaining subset is used as the validation set to calculate performance metrics (such as AUC). The final average performance is then calculated. and standard deviation σ A As a measure of stability.

[0075] Finally, the model generation sub-step: when the cross-validation results show that the model stability meets the criteria (e.g., σ... A When <0.05), the system uses the entire training subset (D). train The XGBoost model is retrained using the optimal parameter combination to generate an optimized risk prediction model (M). model Risk prediction model (M) model This is used for subsequent risk prediction.

[0076] In this embodiment, it should be specifically noted that in step S3, the data partitioning adopts a random stratified sampling method to ensure that the category distribution of the training set and the test set is consistent with the original data; the grid search method traverses the preset parameter space to find the optimal parameter combination; multi-fold cross-validation divides the training set into multiple mutually exclusive subsets, which are used as validation sets in turn to evaluate the model performance; during XGBoost training, the first and second derivative information of the loss function is used for gradient boosting.

[0077] Specifically, the data partitioning uses a stratified random sampling method to divide the training subset (D). train ) and test subset (D test When performing training, stratification is based on risk category labels to ensure that each category is included in the training subset (D). train ) and test subset (D test The proportion in the balanced training set (D) balanced )same;

[0078] The grid search method traverses a preset parameter space that is a subset of the Cartesian product of parameter combinations. The optimal parameter combination is selected through performance comparison. In multi-fold cross-validation, the training subset (D) train The subset is divided into K mutually exclusive subsets, each of which is approximately N in size. train / K, the verification process is repeated K times, and the average value of the performance metrics is taken. During XGBoost training, the first derivative of the loss function g i and second derivative h i Used to calculate the gradient boosting direction, the first derivative g i Provides gradient information, second derivative h i Provide curvature information to jointly optimize the model fitting process.

[0079] Through the above implementation methods, step S3 achieves efficient training and optimization of the model, providing a reliable model foundation for risk prediction.

[0080] In this embodiment, it is specifically noted that in step S4, the performance of the trained risk prediction model is evaluated using a test subset. The model performance is quantified using three indicators: the receiver operating characteristic (ROC) curve, the area under the curve (AUC), and the harmonic mean of precision and recall. The ROC curve is plotted by calculating the true positive rate and false positive rate by traversing the decision threshold. The true positive rate is the proportion of true positives to actual positives, and the false positive rate is the proportion of false positives to actual negatives. The AUC is obtained by integrating the area under the ROC curve. The harmonic mean of precision and recall is calculated by the harmonic mean of precision and recall. Precision is the proportion of true positives to predicted positives, and recall is the proportion of true positives to actual positives.

[0081] Specifically, the system is based on the risk prediction model (M) output in step S3. model ) and test subset (D test Performance evaluation was conducted on the test subset (D). test It contains a sample feature matrix and a true label vector, where the true label vector (y) test The value can be 0 or 1, representing low risk and high risk categories respectively. First, the risk prediction model (M) is used. model ) for the test subset (D test To make a prediction, obtain the prediction probability vector. Where p i Let represent the probability (a real number, ranging from [0,1]) that sample i belongs to the high-risk category. Then, calculate the following index:

[0082] Receiver Operating Characteristic (ROC) curve: The true positive rate (TPR) and false positive rate (FPR) are calculated by iterating through the decision threshold τ (a real number, ranging from [0,1]), as shown in the following formula:

[0083]

[0084] Where i represents the index of the test sample, which is a positive integer and takes values ​​in the range 1 ≤ i ≤ N. test , representing the sequential number of the sample in the test subset; p represents the true label of the i-th sample, with a value of 0 or 1, where 0 represents the low-risk category and 1 represents the high-risk category; i τ represents the predicted probability of the i-th sample, which is a real number and ranges from [0,1]. It represents the probability that the model predicts that the sample belongs to the high-risk category. τ represents the decision threshold, which is a real number and ranges from [0,1]. It is used to convert the predicted probability into a binary classification label. The parentheses represent an indicator function, which takes the value 1 when the condition in parentheses is true, and 0 otherwise; TPR(τ) represents the true positive rate at the threshold τ, which is a real number with a value range of [0,1], reflecting the model's ability to correctly identify high-risk samples; FPR(τ) represents the false positive rate at the threshold τ, which is a real number with a value range of [0,1], reflecting the proportion of low-risk samples that the model misclassifies as high-risk; by traversing the thresholds to calculate TPR and FPR, and plotting the ROC curve, the classification performance of the model at different thresholds is intuitively displayed, avoiding the use of common statistics such as variance.

[0085] Area under the curve (AUC): Calculated by integrating the area under the ROC curve, using the following formula:

[0086]

[0087] Where u represents the integral variable, is a real number, takes values ​​in the range [0,1], and represents the false positive rate; FPR -1 The inverse function of the false positive rate is used to map the false positive rate back to the threshold space;

[0088] AUC represents the area under the curve, which is a real number and ranges from [0,1]. The larger the value, the better the overall performance of the model. By integrating and quantifying the area under the ROC curve, we provide an overall measure of the model's classification ability and ensure the comprehensiveness of the evaluation.

[0089] Precision / Recall Harmonic Mean (F1 Score): Calculated as the harmonic mean of precision and recall. Precision P and recall R are defined as follows:

[0090]

[0091] Among them, its It is the predicted label of sample i, determined by the threshold τ, when p i When ≥τ (High risk), otherwise (Low risk). F1 score is calculated as follows:

[0092]

[0093] in, represents the predicted label of the i-th sample, with a value of 0 or 1; P represents precision, a real number ranging from [0,1], reflecting the proportion of samples predicted as high-risk that are actually high-risk; R represents recall, a real number ranging from [0,1], reflecting the proportion of actual high-risk samples that are correctly predicted; F1 represents the F1 score, a real number ranging from [0,1], which is the harmonic mean of precision and recall. This formula balances precision and recall through the harmonic mean, comprehensively evaluating model accuracy and solving the evaluation bias problem caused by uneven class distribution. After performance evaluation, the system checks whether the indicators meet the preset standards (e.g., AUC value greater than 0.8 and F1 score greater than 0.7). If the standards are met, the system proceeds to the decision threshold optimization sub-step.

[0094] In this embodiment, it should be specifically noted that in step S4, after the performance evaluation index reaches the preset standard, the decision threshold is optimized by maximizing the difference between the true positive rate and the false positive rate to select the optimal decision threshold; wherein the difference between the true positive rate and the false positive rate is defined as the Youden index, and the optimal decision threshold is the threshold that makes the Youden index reach its maximum value.

[0095] Specifically, once the performance evaluation meets the standards, the system optimizes the decision threshold. The Youden's index J(τ) is defined as the difference between the true positive rate and the false positive rate.

[0096] J(τ)=TPR(τ)-FPR(τ)

[0097] Optimal decision threshold τ * By maximizing the Youden index, we obtain:

[0098]

[0099] Where J(τ) represents the Youden index, a real number with a value range of [-1, 1], reflecting the model's performance at the threshold.

[0100] The overall classification ability is τ; a higher value indicates a better classification effect. * τ represents the optimal decision threshold, a real number ranging from [0,1], which is the threshold that maximizes the Youden index; arg max represents the parameter operation that maximizes the function. This formula automatically selects the optimal threshold by maximizing the Youden index, balancing the true positive rate and the false positive rate, and improving the classification sensitivity and specificity of the model in practical applications. After optimization, the system outputs the optimal decision threshold τ. * It is used for risk prediction applications.

[0101] In this embodiment, it is specifically noted that in step S4, new buyer transaction data is input into the risk prediction model to obtain the prediction probability, and then the optimal decision threshold is applied for classification: when the prediction probability is greater than or equal to the optimal decision threshold, a high-risk category is output; otherwise, a low-risk category is output, thereby achieving accurate prediction and early warning of supply chain finance risks.

[0102] Specifically, the system receives new buyer transaction data (D new After that, it is input into the trained risk prediction model (M). model ), thus obtaining the predicted probability p new (A real number, ranging from [0,1]), then, apply the optimal decision threshold τ. * Categorize:

[0103] If p new ≥τ * If the risk level is high, output the high-risk category (label 1); otherwise, output the low-risk category (label 0).

[0104] The classification results are used for supply chain finance risk early warning and to achieve real-time dynamic monitoring. For example, in reverse factoring business, high-risk results can trigger risk control measures and reduce the probability of liquidity crisis.

[0105] Through the above implementation methods, step S4 realizes the complete process of model performance evaluation, threshold optimization and risk prediction, ensuring the accuracy and reliability of supply chain finance risk prediction.

[0106] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0107] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0108] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0109] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0110] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0111] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0112] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A supply chain finance risk prediction method based on buyer transactions, characterized in that, Includes the following steps: S1. When the supply chain finance system receives a risk prediction request, it obtains the buyer's historical transaction dataset. The historical transaction dataset contains payment behavior variables and transaction interaction variables. The payment behavior variables include the average payment time and the overdue payment ratio. The transaction interaction variables include whether supply chain financing is provided and whether payment terms are changed. The historical transaction data was then preprocessed. The missing values ​​of continuous variables were handled by mean imputation, the missing values ​​of discrete variables were handled by classification models, and correlation analysis was performed to remove highly redundant variables with correlation coefficients higher than a preset threshold. The preprocessed data was then cleaned and standardized. S2. Based on the preprocessed standardized data, the Pareto distribution law is applied to define risk categories. The proportion of invoices not paid according to the agreed terms is used as the benchmark variable, and its 80th decimal place is used as the classification threshold. Samples above the threshold are marked as high-risk categories, and the remaining samples are marked as low-risk categories. To address the problem of uneven class distribution, a random oversampling technique is used to balance the training data. By replicating high-risk class samples, the number of high- and low-risk samples is balanced, resulting in a balanced training dataset. S3. Based on the balanced training set, construct and train the XGBoost machine learning model. First, divide the data into training subset and test subset according to a preset ratio. Then, optimize the model parameter combination through grid search and evaluate the model stability using multi-fold cross-validation. During training, the second-order Taylor expansion property of the XGBoost algorithm is used to improve computational efficiency and generate an optimized risk prediction model. S4. The trained risk prediction model is evaluated using a test subset. The model performance is quantified using three indicators: receiver operating characteristic (ROC) curve, area under the curve (AUC), and F1 score. The ROC curve is used to analyze the classification ability of the risk prediction model under different decision thresholds, the AUC provides an overall performance measure, and the F1 score comprehensively evaluates the prediction accuracy. Once the evaluation indicators reach the preset standards, new buyer transaction data is input into the risk prediction model, which outputs classification results for high-risk or low-risk categories, thereby achieving accurate prediction and early warning of supply chain finance risks.

2. The supply chain finance risk prediction method based on buyer transactions according to claim 1, characterized in that: In step S1, the historical transaction dataset in the data acquisition and preprocessing step includes payment behavior variables and transaction interaction variables. The payment behavior variables include the average payment time and the overdue payment ratio, and the transaction interaction variables include whether supply chain financing is provided and whether payment terms are changed. When handling missing values, mean imputation is used for continuous variables, that is, the arithmetic mean of each continuous variable is calculated and the missing value is replaced with the mean. For discrete variables, a decision tree-based classification model is used for prediction imputation, that is, the decision tree model is trained on non-missing data to predict missing values. During correlation analysis, a redundancy index based on eigenvalue decomposition is used. Redundancy is quantified by calculating the ratio of the absolute value of the difference between the eigenvalues ​​of a pair of variables to the square root of the sum of squares of the eigenvalues. When the redundancy score is lower than a preset threshold, the variable is identified as highly redundant and removed. When standardizing data, the minimum-maximum scaling method is used. The value of each continuous variable is reduced by its minimum value and then divided by the difference between the maximum and minimum values, so that the variable values ​​are normalized to the range of zero to one.

3. The supply chain finance risk prediction method based on buyer transactions according to claim 2, characterized in that: In step S1, the preset threshold is set to 0.1, which is used for redundancy judgment in correlation analysis. Eigenvalue decomposition is based on the covariance matrix of the variable set, and the eigenvalues ​​represent the variance contribution of the variables in the matrix. The minimum and maximum values ​​in the min-max scaling method are calculated from the historical data of each continuous variable, ensuring that the standardized data are comparable.

4. The supply chain finance risk prediction method based on buyer transactions according to claim 3, characterized in that: In step S2, based on the preprocessed standardized data, the Pareto distribution law is applied to define risk categories. The proportion of invoices not paid according to the agreed terms is used as the benchmark variable, and its 80th percentile is used as the classification threshold. Samples above the threshold are marked as high-risk categories, and the remaining samples are marked as low-risk categories. To address the issue of uneven class distribution, a random oversampling technique is employed to balance the training data. By replicating high-risk class samples, the number of high- and low-risk samples is balanced, resulting in a balanced training dataset.

5. The supply chain finance risk prediction method based on buyer transactions according to claim 4, characterized in that: In step S2, the 80th decimal place is calculated by the inverse function of the empirical cumulative distribution function, specifically by finding the smallest real number such that the cumulative distribution function value is greater than or equal to 0.

8. Random oversampling technology replicates samples from high-risk samples with replacement, making the number of high-risk samples equal to the number of low-risk samples.

6. The supply chain finance risk prediction method based on buyer transactions according to claim 5, characterized in that: In step S3, based on the balanced training set, an XGBoost machine learning model is constructed and trained. First, the data is divided into a training subset and a test subset according to a preset ratio. Then, the model parameter combination is optimized by grid search method, and the model stability is evaluated by multi-fold cross-validation method. During training, the second-order Taylor expansion property of the XGBoost algorithm is used to improve computational efficiency and generate an optimized risk prediction model.

7. The supply chain finance risk prediction method based on buyer transactions according to claim 6, characterized in that: In step S3, the data is partitioned using a random stratified sampling method to ensure that the class distribution of the training set and the test set is consistent with the original data. The grid search method traverses the preset parameter space to find the optimal parameter combination; multi-fold cross-validation divides the training set into multiple mutually exclusive subsets, which are used in turn as the validation set to evaluate the model performance. XGBoost uses the first and second derivatives of the loss function for gradient boosting during training.

8. The supply chain finance risk prediction method based on buyer transactions according to claim 7, characterized in that: In step S4, the trained risk prediction model is evaluated using a test subset. The model performance is quantified using three metrics: the receiver operating characteristic (ROC) curve, the area under the curve (AUC), and the harmonic mean of precision and recall. The ROC curve is plotted by calculating the true positive rate and false positive rate by traversing decision thresholds. The true positive rate is the proportion of true positives to actual positives, and the false positive rate is the proportion of false positives to actual negatives. The AUC is obtained by integrating the area under the ROC curve. The harmonic mean of precision and recall is calculated by the harmonic mean of precision and recall. Precision is the proportion of true positives to predicted positives, and recall is the proportion of true positives to actual positives.

9. A supply chain finance risk prediction method based on buyer transactions according to claim 8, characterized in that: In step S4, once the performance evaluation index reaches the preset standard, the decision threshold is optimized by maximizing the difference between the true positive rate and the false positive rate to select the optimal decision threshold. The difference between the true positive rate and the false positive rate is defined as the Youden index, and the optimal decision threshold is the threshold that maximizes the Youden index.

10. A supply chain finance risk prediction method based on buyer transactions according to claim 9, characterized in that: In step S4, new buyer transaction data is input into the risk prediction model to obtain the prediction probability. Then, the optimal decision threshold is applied for classification: when the prediction probability is greater than or equal to the optimal decision threshold, a high-risk category is output; otherwise, a low-risk category is output, thereby achieving accurate prediction and early warning of supply chain finance risks.