Method and system for predicting the payment period of hospital purchase invoices based on deep learning

Through the combination of deep learning model and piecewise loss function, the shortcomings of the gradient boosting decision tree model in nonlinear prediction are solved, achieving more accurate payment period prediction and reducing the risk of payment period extension.

CN118429085BActive Publication Date: 2024-10-01SHENGYE INFORMATION TECH SERVICE (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410891146.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-10-01
Estimated Expiration
2044-07-04

AI Technical Summary

Technical Problem

The existing gradient boosting decision tree model cannot accurately predict the hospital's payment period when dealing with non-linear influencing factors, and the predicted payment period may be smaller than the actual payment period, leading to the risk of payment extension.

Method used

Adopt a method based on deep learning, use a multi-layer hidden layer neural network model, and optimize the training process through a segmented loss function to ensure that the predicted value is not less than the true account period when meeting the preset accuracy requirements.

Benefits of technology

It improves the forecasting effect under non-linear factors, ensures that the predicted account period is not less than the actual account period, and reduces the risk of account period extension.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429085B_ABST
    Figure CN118429085B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for predicting the payment period of hospital purchase invoices based on deep learning, and belongs to the field of deep learning. The method inputs the feature data corresponding to the invoice into the target neural network model; according to the output value of the neural network model, the payment period corresponding to the invoice is predicted. The target neural network model is obtained by training a deep learning model with at least two hidden layers, and the depth information has a better effect when processing nonlinear influencing factors. The loss function used in training obtains a first loss value when the predicted value is less than the label, and obtains a second loss value when the predicted value is not less than the label, and the first loss value is not less than the second loss value; therefore, the predicted payment period is not less than the actual payment period while meeting the preset accuracy requirements, thereby reducing the risk of payment period extension.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning technology, and in particular to a method and system for predicting the payment period of hospital procurement invoices based on deep learning. Background Art

[0002] With the development of machine learning technology, the financial industry has proposed a variety of technical solutions for using machine learning models to predict the risks of carrying out certain financial businesses, such as training machine learning models based on users' historical data to predict the repayment date in loan business or the collection period in supply chain finance. The predicted repayment date or collection period can provide reference for assessors when conducting risk assessment, thereby improving the work efficiency of financial industry practitioners. For example, Patent Document 1 (publication number CN108846520A) discloses a loan overdue prediction method, which uses user portrait information and historical loan repayment information to train a machine learning model to predict whether the user's loan will be overdue. For example, Patent Document 2 (publication number CN113159926A) discloses a repayment date determination method for loan business, which uses attribute information and loan information of multiple dimensions of loan customers to train a loan repayment date prediction model, thereby predicting the repayment date of the loan customer's target loan business. For example, Patent Document 3 (publication number CN110472815A) discloses a risk control method for financing enterprises in supply chain finance business, which uses transaction data of historical orders to train machine learning models to predict the payment period. The above solutions can provide references for evaluators in financial business and improve work efficiency.

[0003] In the supply chain finance business of the medical industry, hospitals need to purchase drugs from pharmaceutical suppliers and issue invoices. The pharmaceutical suppliers will transfer the accounts receivable of the hospital to the factoring agency. The factoring agency provides instant funds to the pharmaceutical supplier to accelerate the capital turnover of the pharmaceutical supplier. In order to control risks, the factoring agency needs to evaluate the risks corresponding to the accounts receivable. Therefore, machine learning is needed to help predict the hospital's payment period to improve the efficiency of risk assessment and business decision-making. Generally, the hospital-related data that the factoring agency can collect includes historical invoice data, historical payment period data, current invoice data, etc. Therefore, the solution of Patent Document 3 can be used to train the machine learning model with historical invoice data and historical payment period data to predict the payment period.

[0004] However, the inventors have found through research that if the solution of Patent Document 3 is used to predict the payment period, the machine learning model used is a gradient boosting decision tree model, which is not effective in dealing with nonlinear factors and cannot accurately predict the payment period. The prediction accuracy cannot meet actual needs. On the other hand, if the solution of Patent Document 3 is used to predict the payment period, it cannot meet the following requirements: the predicted payment period must not be less than the actual payment period in addition to meeting the preset accuracy requirements, so as to reduce the risk of payment period extension. Summary of the invention

[0005] The purpose of the present invention is to solve at least one of the technical problems existing in the prior art, and to provide a method and system for predicting the collection period of hospital purchase invoices based on deep learning, which can have better effects when dealing with nonlinear influencing factors, and make the predicted collection period not less than the actual collection period while meeting the preset accuracy requirements, thereby reducing the risk of payment period extension.

[0006] In a first aspect, the present invention provides a method for predicting the payment period of hospital purchase invoices based on deep learning, the method comprising the following steps:

[0007] Inputting the characteristic data corresponding to the invoice into the target neural network model; wherein the target neural network model is obtained by training an initial neural network model using multiple sets of training data, the initial neural network model includes at least two hidden layers, and each set of training data in the multiple sets of training data includes: the characteristic data corresponding to the historical invoice and a label for marking the actual payment period corresponding to the invoice;

[0008] Predicting the payment period corresponding to the invoice according to the output value of the neural network model;

[0009] The using multiple sets of training data to train the initial neural network model to obtain the target neural network specifically includes:

[0010] S1, after the initial neural network model completes the forward propagation of a batch of samples, the error between the predicted value and the label of the initial neural network model is calculated using a loss function as a loss value; wherein the multiple groups of training data are divided into multiple batches of samples; the loss function is a piecewise function, when the predicted value is less than the label, a first loss value is obtained, when the predicted value is not less than the label, a second loss value is obtained, and the first loss value is not less than the second loss value;

[0011] S2, calculate the partial derivatives of the loss function with respect to the parameters of the initial neural network model;

[0012] S3, based on the partial derivatives of each parameter, the gradient descent method is used to update each parameter in the initial neural network model;

[0013] S4, iterate the above steps S1 to S3, traverse multiple batches of samples, until the loss function converges or reaches a predetermined number of training rounds, and obtain the target neural network model.

[0014] In a second aspect, the present invention provides a system for predicting the collection period of hospital procurement invoices based on deep learning, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for predicting the collection period of hospital procurement invoices based on deep learning as described above is implemented.

[0015] Compared with the prior art, the method and system for predicting the payment period of hospital purchase invoices based on deep learning provided by the present invention has at least the following beneficial effects:

[0016] 1. The initial neural network model includes at least two hidden layers, which belongs to deep learning. Through multiple hidden layers, it can extract and learn more nonlinear relationships between features and prediction results. Compared with the gradient boosting decision tree model, it has stronger nonlinear fitting ability and has better effect in dealing with nonlinear influencing factors.

[0017] 2. Since the loss function is a piecewise function, when the predicted value is less than the label, the first loss value is obtained, and when the predicted value is not less than the label, the second loss value is obtained, and the first loss value is not less than the second loss value; therefore, the predicted payment period is not less than the actual payment period while meeting the preset accuracy requirements (for example, the prediction accuracy is greater than 95%), thereby reducing the risk of payment period extension.

[0018] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The present invention is further described below in conjunction with the accompanying drawings and embodiments;

[0020] Figure 1 A flowchart of a method for predicting the payment period of hospital purchase invoices based on deep learning in one embodiment;

[0021] Figure 2 A schematic diagram of a process for training a neural network model in one embodiment;

[0022] Figure 3 A schematic diagram of a process for determining labels corresponding to training data in one embodiment;

[0023] Figure 4 The figure is a flowchart of updating a low-risk hospital set in one embodiment. DETAILED DESCRIPTION

[0024] This section will describe in detail the specific embodiments of the present invention. The preferred embodiments of the present invention are shown in the accompanying drawings. The purpose of the accompanying drawings is to supplement the description of the text part of the specification with graphics, so that people can intuitively and vividly understand each technical feature and the overall technical solution of the present invention, but it cannot be understood as a limitation on the scope of protection of the present invention.

[0025] like Figure 1 As shown, in one embodiment, a method for predicting the payment period of hospital purchase invoices based on deep learning is provided, and the method includes the following steps:

[0026] Step S202, input the feature data corresponding to the invoice into the target neural network model. The target neural network model is obtained by training the initial neural network model using multiple sets of training data, each of which includes: feature data corresponding to the historical invoice and a label for marking the actual payment period corresponding to the invoice. The initial neural network model includes at least two hidden layers.

[0027] Step S204: predicting the payment period corresponding to the invoice based on the output value of the neural network model.

[0028] like Figure 2 As shown, in one example, the use of multiple sets of training data to train the initial neural network model to obtain the target neural network specifically includes:

[0029] S1, after the initial neural network model completes the forward propagation of a batch of samples, the loss function is used to calculate the error between the predicted value and the label of the initial neural network model as the loss value.

[0030] Specifically, the structure of the initial neural network model in this embodiment is a feedforward neural network (FNN), which is composed of a multi-layer Logistic regression model (continuous nonlinear function). In the feedforward neural network, each neuron belongs to a different layer, and the neurons in each layer can receive the signals of the neurons in the previous layer and generate signals to output to the next layer. The feedforward neural network can obtain the final output of the network through layer-by-layer information transmission. The entire network can be regarded as a composite function. . The process of forward propagation is to use the vector x as the input of the first layer and the output of the last layer as the output of the entire function. Among them, the first layer is called the input layer, the last layer is called the output layer, and the other intermediate layers are called hidden layers. In this embodiment, the hidden layer is not less than two layers, which belongs to deep learning. Through multiple hidden layers, more nonlinear relationships between features and prediction results can be extracted and learned. Compared with the gradient boosting decision tree model, it has stronger nonlinear fitting ability and has better effect in dealing with nonlinear influencing factors.

[0031] Among them, the multiple groups of training data are divided into multiple batches of samples; the loss function is a piecewise function, when the predicted value is less than the label, a first loss value is obtained, when the predicted value is not less than the label, a second loss value is obtained, and the first loss value is not less than the second loss value.

[0032] In one embodiment, the loss function is determined by the following formula: ;

[0033] Formula 1:

[0034] Wherein, λ is a preset adjustment coefficient, and λ is greater than 1; It is used to represent the neural network model, which is a function with parameter θ. x represents the feature data corresponding to the invoice, and the output is the predicted value; y is the label.

[0035] In one example, in one round of training, for two groups of training data with labels of 30, the predicted value of one group of training data after model prediction is 32, and the predicted value of the other group of training data after model prediction is 28. Obviously, according to the square loss function in the prior art, the errors of both are 2, which means that if the square loss function converges around an error of 2 and the prediction accuracy meets the requirements (for example, 95%), the collection period predicted by the trained model will be much smaller (nearly half) than the actual collection period, resulting in the collection period corresponding to the invoice evaluated by the evaluator being much smaller than the actual collection period, and there is a risk of a large amount of collection delay.

[0036] In this embodiment, Formula 1 is used as the loss function. Since λ is greater than 1, when the predicted value is less than the label, = Calculate the first loss value; when the predicted value is not less than the label, use = The second loss value is calculated, and the first loss value is not less than the second loss value. Take λ=3. In one round of training, for two sets of training data with labels of 30, the predicted value of one set of training data after model prediction is 32. = The second loss value is calculated to be approximately 2.1. The predicted value of another set of training data after model prediction is 28. = The first loss value is calculated to be approximately equal to 19.1, and the second loss value is close to the convergence position. However, due to the first loss value, the average loss corresponding to this round of training is increased, prompting the training to continue. The loss function can only converge when both sets of training data are greater than 30. Therefore, the model trained by the loss function provided by Formula 1 can make the predicted payment period (almost all) not less than the actual payment period, so that the payment period corresponding to the invoice evaluated by the evaluator is not less than the actual payment period, reducing the risk of a large amount of payment delay.

[0037] λ is a parameter used to adjust the sensitivity of the loss function to errors in different directions. When the predicted value is less than the label, the larger the λ value, the greater the penalty and the greater the loss value, that is, the greater the gradient when updating the parameters. When the predicted value is greater than the label, the smaller the λ value, the greater the penalty and the greater the loss value, that is, the greater the gradient when updating the parameters, that is, the greater the loss value. If the average loss does not decrease significantly in the current round of training, the detection and The proportion of is the number of times the predicted value is less than the label in this round of training, is the number of times the predicted value is greater than the label in this round of training. / If λ is greater than 1, the average loss value will be larger if λ is increased. In the next round of training, the gradient can be increased to accelerate convergence. / If it is less than 1, then λ is reduced, and the average loss value is also larger. The gradient can be increased in the next round of training to accelerate convergence.

[0038] S2, calculate the partial derivatives of the loss function with respect to the parameters of the initial neural network model.

[0039] Specifically, in each round of training, the average loss corresponding to that round of training is , to find the partial derivatives of each parameter. The average loss corresponding to one round of training is determined by the following formula 2 ;

[0040] Formula 2:

[0041] Among them, the batch of samples used in the current round of training includes n groups of training data. is the label of the i-th group of training data in this batch of samples, is the feature data corresponding to the invoice in the i-th group of training data in this batch of samples.

[0042] S3, based on the partial derivatives of each parameter, the gradient descent method is used to update the parameters in the initial neural network model.

[0043] Specifically, in the Tth round of training, the following formula is used to calculate the current parameters of the neural network model: Update to get the new parameters of the neural network model in the T+1th round of training ;

[0044] Formula 3:

[0045] Among them, η is the learning rate.

[0046] In this embodiment, due to It is an exponential function, and λ is greater than 1. Therefore, when the predicted value is less than the label, the partial derivative calculated by the square loss function in the prior art, that is, the gradient of the parameter is larger, which means that the model will adjust quickly to reduce the situation where the predicted value is less than the label, which can reduce the number of training rounds and speed up the training.

[0047] S4, iterate the above steps S1 to S3, traverse multiple batches of samples, until the loss function converges or reaches a predetermined number of training rounds, and obtain the target neural network model.

[0048] Since the loss function is a piecewise function, when the predicted value is less than the label, the first loss value is obtained, and when the predicted value is not less than the label, the second loss value is obtained, and the first loss value is not less than the second loss value; therefore, the predicted payment period is not less than the actual payment period while meeting the preset accuracy requirements (for example, the prediction accuracy is greater than 95%), thereby reducing the risk of payment period extension.

[0049] It should be noted that in Formula 3, due to It is an exponential function, and λ is greater than 1. Therefore, when the predicted value is less than the label, the partial derivative calculated by the square loss function in the prior art, that is, the gradient of the parameter is larger, which means that the model will adjust quickly to reduce the situation where the predicted value is less than the label, which can reduce the number of training rounds and speed up the training, but may cause the gradient explosion problem. When the predicted value is greater than the label, the gradient is small, which means that the model adjustment is relatively slow, resulting in slow convergence.

[0050] In this regard, this embodiment provides a solution that can speed up the model adjustment speed and reduce the possibility of gradient explosion. Specifically, the solution provides Formula 4 to adjust the learning rate η used in each round of training based on the characteristics of the loss function used in Formula 1, thereby speeding up the model adjustment speed and reducing the possibility of gradient explosion. Review Formula 1 again:

[0051]

[0052] It can be seen that in a round of training, if the number of times the predicted value is less than the label appears more frequently in this round of training, for example, reaching 80%, the partial derivatives of each parameter will be larger, that is, the gradient is too large, which may cause a gradient explosion. If the number of times the predicted value is greater than the label and the difference is not very large appears more frequently in this round of training, for example, reaching 80%, the partial derivatives of each parameter will be smaller, that is, the gradient is too small, which may lead to slow convergence, that is, gradient disappearance. In a round of training, if most of the predicted values ​​are either much larger or much smaller than the label, the partial derivatives of each parameter will be larger, that is, the gradient is too large, which may cause a gradient explosion. Therefore, refer to Formula 3:

[0053]

[0054] It is necessary to make the learning rate adaptive to the situation where the gradient is too large or too small in each round of training, so as to suppress the gradient explosion or gradient disappearance (that is, the convergence is too slow). In machine learning, the magnitude of the gradient usually refers to its absolute value. The larger the absolute value of the gradient, the more drastic the change in the gradient, and the larger the corresponding parameter update step. Specifically, the learning rate η for each round of training is determined by the following formula 4;

[0055] Formula 4:

[0056] in, is the baseline learning rate, is the number of times the predicted value is less than the label in this round of training, is the number of times the predicted value is greater than the label in this round of training. is the preset bias sensitivity, is the preset error sensitivity; and Both are greater than 0.

[0057] In one example, if in a training run, most of the predicted values ​​are much larger or much smaller than the label, this will result in Increase, leading to Reduce, so that the learning rate η is reduced and the gradient explosion is suppressed.

[0058] In one example, if in a round of training, if the number of cases where the predicted value is less than the label is large, for example, reaching 80%, it will lead to Increase, leading to Reduce, so that the learning rate η is reduced and the gradient explosion is suppressed.

[0059] In one example, if in a round of training, if the number of cases where the predicted value is greater than the label and the difference is not very large is large, for example, reaching 80%, it will lead to Increase, leading to Increases, thereby increasing the learning rate η and suppressing the gradient disappearance.

[0060] In summary, Formula 4 dynamically adjusts the learning rate based on the characteristics of the loss function provided by Formula 1, ensuring that when the gradient is small, the learning rate can automatically increase, thereby enhancing the strength of parameter updates and alleviating the problem of gradient disappearance; when the gradient is large, the learning rate decreases to prevent gradient explosion. This mechanism makes the training process more stable and efficient.

[0061] Furthermore, The preset bias sensitivity, which enlarges or reduces This item affects the learning rate, thereby finely controlling the adjustment range of the learning rate. is the preset error sensitivity, which amplifies or reduces This item affects the learning rate, thereby fine-tuning the adjustment range of the learning rate. Specifically, The initial value is 0.5, The initial value is 0.1. is 0.01. It can be adjusted dynamically during the model training process and For example, if the average loss value decreases slowly in consecutive rounds of training, you can increase it appropriately. and The value of Increase to 1, Increase to 0.2; if the average loss value fluctuates back and forth in consecutive rounds of training, you can reduce it appropriately and The value of Reduced to 0.2, Reduced to 0.05 to reduce the sensitivity of the learning rate. and The value of can facilitate the control of the training process and provide a new adjustment method for achieving the convergence of the loss function to speed up the training process.

[0062] In one embodiment, the loss function can also be determined by the following formula 5: ;

[0063] Formula 5:

[0064] Wherein, M is the preset adjustment coefficient; It is used to represent the neural network model, which is a function with parameter θ. x represents the feature data corresponding to the invoice, and the output is the predicted value; y is the label.

[0065] Usually, when the error is large, the gradient calculated by Formula 5 is not as large as that of Formula 1, so the gradient explosion problem of Formula 5 is not serious. However, correspondingly, its convergence speed will not be as fast as that of Formula 1. Therefore, when the model parameters are initialized at the beginning, the error is relatively large. The loss function of Formula 1 will impose a greater update force on the parameters, thereby accelerating the convergence of the model. However, Formula 5 improves the square loss function and introduces a penalty term. ,exist When this happens, the following effects can be achieved in Formula 1: a large number (almost all) of the predicted payment periods will be no less than the actual payment period, and the payment period corresponding to the invoice evaluated by the evaluator will be no less than the actual payment period, thus reducing the risk of delayed payment in a large amount.

[0066] In one embodiment, Figure 3 As shown, the labels in each set of training data are determined by the following steps:

[0067] Step S300, determine whether the historical invoice is an invoice corresponding to a single-period payment or an invoice corresponding to an installment payment.

[0068] Specifically, based on the payment record corresponding to the historical invoice, it can be determined whether the accounts receivable corresponding to the historical invoice is a single payment or installment payment. Alternatively, based on the payment contract corresponding to the historical invoice, it can also be determined whether the historical invoice is an invoice corresponding to a single payment or installment payment.

[0069] Step S302: When the historical invoice belongs to a single-period payment, the actual payment period corresponding to the invoice is used as a label.

[0070] The invoice date of the historical invoice is taken as the starting point of time, for example, January 1, 2018, and the corresponding payment date is taken as the end point of time, for example, February 1, 2018. The actual payment period is obtained by subtracting the starting point from the end point of time, which is 31 days. Therefore, the feature data corresponding to the historical invoice has a label of 31.

[0071] Step S304: When the historical invoice belongs to installment payment, determine whether the hospital that issued the invoice belongs to a low-risk hospital set. The low-risk hospital set is a set of hospitals that have cooperated with the hospital more than a preset number of times and whose on-time payment rate in each installment payment exceeds the preset payment rate.

[0072] For example, if the preset number of times is 10, the factoring agency has successfully received all the receivables corresponding to the hospital's 10 invoices. The preset collection rate is 90%.

[0073] Calculation steps for on-time payment collection rate:

[0074] 1. Data collection: Collect data on all relevant invoices of the hospital, including the issue date of each invoice, the amount payable for each period, the actual payment date, etc.

[0075] 2. Define on-time payment: According to the contract or agreement, determine the deadline for each payment. Usually, on-time payment refers to payment made before or on the deadline.

[0076] 3. Calculate the payment collection for each period: Evaluate the payment collection for each invoice to determine whether it is paid on time. Record the number of on-time payments and the total number of periods.

[0077] 4. Calculate the on-time collection rate: Use the formula to calculate the on-time collection rate: On-time collection rate = number of on-time collections / total number of periods.

[0078] For example, suppose a hospital has the following installment payment records in the past year as shown in Table 1:

[0079] Table 1

[0080]

[0081] Step 1 Data Collection: Collect all relevant data from the above tables.

[0082] Step 2: Define on-time payment: Assume that on-time payment refers to payment made before or on the due date.

[0083] Step 3: Calculate the payment for each period: Invoice 1: First period: on time (2023-01-30), second period: not on time (2023-03-05), third period: on time (2023-04-01). Invoice 2: First period: on time (2023-02-14), second period: on time (2023-03-15), third period: not on time (2023-04-20). Invoice 3: First period: on time (2023-01-10), second period: not on time (2023-02-12), third period: on time (2023-03-09), fourth period: on time (2023-04-10).

[0084] Step 4: Calculate the on-time payment collection rate: Count the number of on-time payment collections and the total number of periods: Total number of periods = 3 (invoice 1) + 3 (invoice 2) + 4 (invoice 3) = 10, number of on-time payment collections = 2 (invoice 1) + 2 (invoice 2) + 3 (invoice 3) = 7. Calculate the on-time payment collection rate: On-time payment collection rate = 7 / 10 = 70%.

[0085] Step S306: If not, the actual installment payment period corresponding to the last period is used as a label.

[0086] Obviously, hospitals that do not belong to the low-risk hospital set include hospitals that the factoring agency has newly contacted and hospitals whose on-time repayment rate of installment payments does not meet the factoring agency's requirements. The repayment ability and repayment credit of these hospitals are questioned by the factoring agency, so the actual installment repayment period corresponding to the last period must be used as a label to prevent the factoring agency from being overly optimistic in its assessment and misassessing the risks of these hospitals.

[0087] Step S308: If yes, then calculate the proportion of the cumulative repayment amount corresponding to each installment repayment period to the total amount of the invoice starting from the first period. When it is detected that the proportion is not less than the preset ratio, use the current installment repayment period as a label.

[0088] Obviously, the hospitals in the low-risk hospital set are the ones that factoring institutions frequently contact and believe to have good collection ability and credit. Due to long-term contact, factoring institutions have been able to control the risks of these hospitals very well. Therefore, in order to enhance the enthusiasm of hospitals to purchase drugs and thus improve the operating efficiency of supply chain finance, factoring institutions are willing to set a preset ratio based on their own risk profile for these hospitals. For example, if the factoring institutions believe that for these low-risk hospitals, they are willing to take the risk of losing 10% of their cash flow (i.e., the risk of collection), then the preset ratio is 90%. This setting can enhance the hospital's willingness to cooperate and ensure the risk control of financial institutions.

[0089] It should be noted that if the factoring agency estimates that some payment periods are too long, it may refuse to purchase the accounts receivable corresponding to a certain invoice based on risk considerations, resulting in a shortage of cash flow for pharmaceutical suppliers, thereby reducing cooperation with hospitals in the purchase mode of delivery first and payment later, and ultimately affecting the hospital's willingness to purchase. If the factoring agency estimates the accounts receivable corresponding to each invoice for installment payment according to the payment period of the first installment payment, the payment period will be evaluated as too short, resulting in the supplier getting cash quickly, and ultimately willing to increase cooperation with the hospital in the purchase mode of delivery first and payment later, which will ultimately increase the hospital's willingness to purchase, but the delay in payment may affect the cash flow of the factoring agency. Therefore, for the above scenario, steps S304 to S308 of this embodiment can balance risk control and improve the operating efficiency of supply chain finance by first dividing hospitals into low-risk hospital groups and then further assigning corresponding labels to invoices for installment payment. Specifically, in addition to relying on the model to predict the payment period, we also use the cooperation data from historical cooperation to find customers with good payment ability and credit (i.e. hospitals in the low-risk hospital set) and provide more efficient supply chain financial services to these customers. Figure 4 As shown, in one embodiment, the low-risk hospital set is updated by the following steps:

[0090] Step S402: Periodically collect historical cooperation data of all hospitals, including the number of cooperations with each hospital and the on-time payment rate of each installment under the condition of installment payment.

[0091] Step S404, screening out hospitals that meet the low-risk standard based on historical cooperation data. The low-risk standard is that the number of cooperation times is greater than a preset number and the on-time repayment rate of each installment in the installment repayment exceeds the preset repayment rate.

[0092] Step S406, determining whether the hospital meeting the low-risk standard is a hospital not existing in the low-risk hospital set, and if so, adding the hospital meeting the low-risk standard to the low-risk hospital set.

[0093] Step S408, determining whether the hospital that does not meet the low-risk standard is a hospital in the low-risk hospital set, and if so, removing the hospital that does not meet the low-risk standard from the low-risk hospital set.

[0094] By automatically updating the low-risk hospital set regularly, it can be ensured that the data in the low-risk hospital set is the latest data, and risk control can be achieved more accurately.

[0095] In one embodiment, the characteristic data corresponding to each invoice includes the data recorded on the invoice, the season when the invoice is issued, the purchasing frequency data of the hospital that issued the invoice obtained based on the data recorded on each historical invoice, the financial situation data of the location of the hospital that issued the invoice, the average collection period of all single-period collections in the history of the hospital that issued the invoice, and the on-time collection rate of all installment collections in the history of the hospital that issued the invoice.

[0096] In order to input the feature data corresponding to each invoice into the neural network model, the data needs to be quantified and feature processed. The following are the steps to obtain and process this data:

[0097] 1. Steps to obtain feature data:

[0098] Record data on the invoice: directly extracted from the invoice system or database, including invoice amount, invoice date, hospital name, type of medicine, address information, number of payments, amount of each payment, last payment date, etc.

[0099] Season when the invoice is issued: Determine the season when the invoice is issued based on the invoice date. Usually the months are converted into seasons, such as January to March is spring, April to June is summer, July to September is autumn, and October to December is winter.

[0100] Hospital procurement frequency data: Based on the hospital's historical invoice data, the number of procurements or the total procurement amount of each hospital within a certain time frame (such as within a year) is counted to calculate the monthly average procurement frequency.

[0101] Financial data of the hospital's location: Obtain financial data of the area where the hospital is located through government public financial reports, economic data and other sources, and match it to the corresponding hospital.

[0102] The average payment period for a single payment period in the hospital's history: From the historical invoice data, filter out the invoices for a single payment period, calculate the payment period for each invoice (i.e. the number of days from invoice issuance to actual payment), and then take the average of these payment periods.

[0103] The hospital's historical on-time collection rate of installment payments: From the invoice data of historical installment payments, calculate whether the collection of each installment is completed within the scheduled time (i.e., on-time collection), and then calculate the proportion of on-time collection, i.e., the on-time collection rate.

[0104] 2. Steps of data processing as neural network input

[0105] Data cleaning and preprocessing: Check the integrity of the data, handle missing values ​​and outliers, and ensure data quality.

[0106] Quantitative features: Convert date-type features (such as invoice date, last payment date) into numerical values ​​(such as timestamp or day number). Convert categorical features (such as hospital name, season) into numerical form, usually using One-Hot Encoding to convert them into binary vectors.

[0107] Feature standardization or normalization: Standardize (mean is 0, standard deviation is 1) or normalize (scale to between 0 and 1) numerical features (such as invoice amount, purchase frequency, average payment period) to make them have the same scale for easier model processing.

[0108] Feature combination: Combine all processed features into a matrix, where each row represents all features of an invoice and each column represents one feature. Ensure that the format and quantity of all feature data are consistent.

[0109] Divide the dataset: Divide the dataset into training set, validation set and test set for model training, validation and evaluation.

[0110] Input to the neural network: Input the processed feature data into the neural network model for training and prediction. The input layer of the neural network model will receive this feature matrix, and the hidden layer and output layer will perform corresponding calculations and predictions.

[0111] Through the above steps, the feature data of each invoice can be extracted and processed from the raw data and converted into a format acceptable to the neural network model. This includes steps such as data cleaning, feature quantification, standardization, feature combination, and data set partitioning. The processed feature data is input into the neural network in the form of a matrix, and the model will be trained and predicted based on these features.

[0112] There are significant advantages to using the above comprehensive data rather than just the data of a single invoice to train the collection period prediction.

[0113] 1. Improve forecast accuracy

[0114] Single invoice data only contains limited features, such as invoice amount, invoice date, number of payments, etc. These features may not fully reflect the various factors that affect the payment period. Comprehensive data includes the hospital's procurement frequency, historical payment behavior, seasonal factors, regional financial conditions, etc. These additional features can provide more comprehensive information and help to more accurately predict the payment period.

[0115] For example, a hospital's historical collection behavior can reveal its payment habits, regional fiscal conditions can reflect the impact of the economic environment on payment capabilities, seasonal factors can reflect the financial pressures of different seasons, and each hospital has its own medical consumption patterns, which also affects the invoice collection time.

[0116] 2. Provide contextual information

[0117] Single invoice data lacks contextual information and only reflects the situation of that specific transaction, but cannot capture broader context and historical behavior. Comprehensive data can provide richer contextual information. For example, by counting the hospital's procurement frequency and historical payment data, we can understand the hospital's overall credit level and payment pattern. This information helps identify long-term trends and abnormal behaviors, and improves the robustness and reliability of predictions.

[0118] 3. Capture underlying patterns and relationships

[0119] It may be difficult to capture complex patterns and relationships using only a single invoice data. For example, a hospital's payment behavior may be affected by its historical behavior, seasonal factors, and the economic environment, and these complex relationships are difficult to identify with a single invoice data. Comprehensive data can help capture more complex patterns and relationships. By combining data from multiple dimensions, machine learning models can learn the interactions between these features and improve the model's predictive ability. For example, historical single-period collection periods and installment collection on-time rates can work together to help better predict future collection periods.

[0120] 4. Enhance the generalization ability of the model

[0121] When the model is trained on a single invoice, it may be overly dependent on the data of a single invoice, which may lead to overfitting and poor generalization ability to new data. However, comprehensive data can enhance the generalization ability of the model by introducing features of more dimensions. The model can learn based on a wider range of features, so that it performs more stably and accurately when facing new data. The introduction of comprehensive data increases the diversity of samples, which helps the model better identify and adapt to different situations and changes during the training process.

[0122] In one embodiment, a method for predicting the payment period of hospital purchase invoices based on deep learning is also provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for predicting the payment period of hospital purchase invoices based on deep learning are executed. The steps of the method for predicting the payment period of hospital purchase invoices based on deep learning here can be the steps of the method for predicting the payment period of hospital purchase invoices based on deep learning in each of the above embodiments.

[0123] In one embodiment, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are used to cause a computer to execute the steps of the method for predicting the payment period of hospital purchase invoices based on deep learning. The steps of the method for predicting the payment period of hospital purchase invoices based on deep learning here may be the steps of the method for predicting the payment period of hospital purchase invoices based on deep learning in each of the above embodiments.

[0124] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRA), memory bus (Rambus) direct RAM (RDRA), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0125] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

Claims

1. A method for predicting the payment period of hospital purchase invoices based on deep learning, characterized in that: The method comprises the following steps: Inputting the characteristic data corresponding to the invoice into the target neural network model; wherein the target neural network model is obtained by training an initial neural network model using multiple sets of training data, the initial neural network model includes at least two hidden layers, and each set of training data in the multiple sets of training data includes: the characteristic data corresponding to the historical invoice and a label for marking the actual payment period corresponding to the invoice; Predicting the payment period corresponding to the invoice according to the output value of the neural network model; The using multiple sets of training data to train the initial neural network model to obtain the target neural network specifically includes: S1, after the initial neural network model completes the forward propagation of a batch of samples, the error between the predicted value and the label of the initial neural network model is calculated using a loss function as a loss value; wherein the multiple groups of training data are divided into multiple batches of samples; the loss function is a piecewise function, when the predicted value is less than the label, a first loss value is obtained, when the predicted value is not less than the label, a second loss value is obtained, and the first loss value is not less than the second loss value; S2, calculate the partial derivatives of the loss function with respect to the parameters of the initial neural network model; S3, based on the partial derivatives of each parameter, the gradient descent method is used to update each parameter in the initial neural network model; S4, iterating the above steps S1 to S3, traversing multiple batches of samples, until the loss function converges or reaches a predetermined number of training rounds, and obtaining a target neural network model; The characteristic data corresponding to each invoice includes the data recorded on the invoice, the season when the invoice was issued, the purchase frequency data of the hospital that issued the invoice obtained based on the data recorded on each historical invoice, the financial situation data of the location of the hospital that issued the invoice, the average payment period for all single-period payments in the history of the hospital that issued the invoice, and the on-time payment rate for all installment payments in the history of the hospital that issued the invoice; The labels in each set of training data are determined by the following steps: When a historical invoice is for a single payment period, the actual payment period corresponding to the invoice is used as a label; When the historical invoice is for installment repayment, determine whether the hospital that issued the invoice is in the low-risk hospital set. If not, use the actual installment repayment period corresponding to the last period as the label; if so, calculate the proportion of the cumulative repayment amount corresponding to each installment repayment period to the total amount of the invoice starting from the first period. When it is detected that the proportion is not less than the preset ratio, use the current installment repayment period as the label; The low-risk hospital set is a set of hospitals that have cooperated with the hospital more than a preset number of times and whose on-time repayment rate in each installment repayment period exceeds the preset repayment rate. Among them, based on the partial derivatives of each parameter, the gradient descent method is used to update the parameters in the initial neural network model, specifically including: In the Tth round of training, the following formula is used to calculate the current parameters of the neural network model: Update to get the new parameters of the neural network model in the T+1th round of training ; Formula 3: Where η is the learning rate, It is used to represent the neural network model, which is a function with parameter θ. x represents the feature data corresponding to the invoice, and the output is the predicted value; y is the label; is the loss function. The batch of samples used in the current round of training includes n sets of training data. is the label of the i-th group of training data in this batch of samples, is the feature data corresponding to the invoice in the i-th group of training data in this batch of samples.

2. The method according to claim 1, characterized in that The loss function is determined by the following formula 1 ; Formula 1: Wherein, λ is a preset adjustment coefficient, and λ is greater than 1; It is used to represent the neural network model, which is a function with parameter θ. x represents the feature data corresponding to the invoice, and the output is the predicted value; y is the label.

3. The method according to claim 2, characterized in that The average loss corresponding to one round of training is determined by the following formula 2 ; Formula 2: Among them, the batch of samples used in the current round of training includes n groups of training data. is the label of the i-th group of training data in this batch of samples, is the feature data corresponding to the invoice in the i-th group of training data in this batch of samples.

4. The method according to claim 3, characterized in that The learning rate η for each round of training is determined by the following formula 4; Formula 4: in, is the baseline learning rate, is the number of times the predicted value is less than the label in this round of training, is the number of times the predicted value is greater than the label in this round of training. is the preset bias sensitivity, is the preset error sensitivity.

5. The method according to claim 1, characterized in that The loss function is determined by the following formula 5 ; Formula 5: Wherein, M is the preset adjustment coefficient; It is used to represent the neural network model, which is a function with parameter θ. x represents the feature data corresponding to the invoice, and the output is the predicted value; y is the label.

6. The method according to claim 1, characterized in that Update the low-risk hospital set by following the steps below: Regularly collect historical cooperation data of all hospitals; the historical cooperation data includes the number of cooperations with each hospital and the on-time payment rate of each period under the installment payment method; Screen out hospitals that meet the low-risk standard based on historical cooperation data; the low-risk standard is that the number of cooperations is greater than the preset number and the on-time repayment rate of each period in the installment repayment exceeds the preset repayment rate; Determine whether the hospital that meets the low-risk criteria is a hospital that does not exist in the low-risk hospital set, and if so, add the hospital that meets the low-risk criteria to the low-risk hospital set; It is determined whether the hospital that does not meet the low-risk standard is a hospital in the low-risk hospital set. If so, the hospital that does not meet the low-risk standard is removed from the low-risk hospital set.

7. A system for predicting the payment period of hospital purchase invoices based on deep learning, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for predicting the payment period for hospital purchase invoices based on deep learning as described in any one of claims 1 to 6 is implemented.