Blood collection quantity prediction method and system based on residual learning and fusion

CN122364827BActive Publication Date: 2026-09-18BEIJING RED CROSS BLOOD CENTER (BEIJING BLOOD DONATION OFFICE BEIJING RED CROSS BLOOD INSTITUTE) +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610605658.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-06
Publication Date
2026-09-18
Estimated Expiration
2046-05-06

AI Technical Summary

Technical Problem

[0004]为解决现有采血预测技术易受短期波动与异常事件影响,缺乏对连续时间序列的残差动态和局部突变的捕捉能力,导致难以在业务侧稳定落地的问题,本申请提供一种基于残差学习与融合的采供血日采血量预测方法及系统,在保障预测结果可解释性的基础上,提升预测精度与长期运行稳定性,适配血站多周期采血调度的实际业务需求

Benefits of technology

本申请针对采血量非线性、周期性、突变性的业务特性,采用XGBoost基线预测与LSTM残差修正的两阶段融合架构,既保障了预测结果的可解释性与非线性特征拟合能力,又通过时序残差学习补全了基线模型的时序偏差;通过时序递增式K折交叉验证与OOF泛化基线构建,杜绝了未来信息泄露,提升了模型的泛化能力;并且通过残差自适应动态幅度约束,有效抑制了极端场景下的预测过冲问题,保障预测结果的业务合理性,进而提升日采血量预测的精度、鲁棒性与业务适配性,可为血站采血计划制定、库存管理、应急调度提供可靠的决策支撑,推动采血预测技术在业务侧落地应用。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122364827B_ABST
    Figure CN122364827B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of blood collection data intelligent analysis, and provides a blood collection amount prediction method and system based on residual learning and fusion. The application standardizes multiple-source blood collection data, fuses time sequence statistics, weather, and calendar multi-class features to construct a feature matrix; adopts K-fold cross-validation to train an XGBoost model to generate a baseline prediction result; constructs a residual sequence, and adopts LSTM to complete residual time sequence learning and prediction; corrects residual deviation through adaptive dynamic amplitude constraint, and fuses baseline values to output a final prediction result. The application supports variable prediction cycle length, configures a differentiated rolling update strategy, fuses the technical advantages of tree models and time sequence networks, effectively suppresses prediction overshoot while guaranteeing the explainability of blood collection and blood supply day blood collection amount prediction results and the nonlinear feature fitting capability, and can provide reliable decision basis for blood station blood collection planning and blood inventory scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of intelligent analysis technology of blood collection data. Specifically, it relates to a method and system for predicting daily blood collection volume based on residual learning and fusion. Background Technology

[0002] Voluntary blood donation is the sole source of blood for clinical medical use and a core foundation for safeguarding national health and public health security. In recent years, with the continuous growth of clinical medical needs, the difficulty of balancing blood supply and demand has been increasing. Blood collection volume is affected by multiple factors, including weather conditions, holiday cycles, school seasons, and public emergencies, exhibiting significant nonlinear, periodic, and abrupt characteristics. Reasonable daily blood collection volume forecasting is an important means for blood banks to optimize blood collection plans, avoid blood shortage risks, and reduce blood resource waste.

[0003] Existing blood collection volume prediction technologies have significant shortcomings: traditional empirical predictions and single statistical models struggle to fit the nonlinear fluctuations and sudden changes in blood collection volume, resulting in insufficient prediction accuracy; while tree models can handle nonlinear cross-features, their ability to capture dynamic temporal residuals and local mutations is insufficient; single deep learning models are prone to overfitting in small sample scenarios and have weak interpretability of prediction results; furthermore, existing solutions mostly employ static training modes, which are prone to error drift over long-term use and cannot adapt to the differentiated business needs of blood collection planning at different cycles. Therefore, there is an urgent need in blood collection and supply operations for a dynamic prediction technology that can predict the baseline of blood volume trends while simultaneously constraining and correcting short-term fluctuations and abnormal deviations, in order to assist blood banks in optimizing their blood collection plans. Summary of the Invention

[0004] To address the issues that existing blood collection prediction technologies are susceptible to short-term fluctuations and abnormal events, lack the ability to capture the residual dynamics and local mutations of continuous time series, and thus are difficult to implement stably on the business side, this application provides a method and system for predicting daily blood collection volume based on residual learning and fusion. While ensuring the interpretability of prediction results, it improves prediction accuracy and long-term operational stability, and adapts to the actual business needs of blood stations' multi-cycle blood collection scheduling.

[0005] In one approach, a method for predicting daily blood collection volume based on residual learning and fusion includes the following steps: S1. Collect raw blood collection and supply data, including blood collection time, blood collection volume, and blood type, using the blood bank's historical blood collection ledger. Perform field mapping, format unification, and blood collection volume unit conversion processing on the raw blood collection and supply data to obtain standardized basic data. S2. The standardized basic data are grouped and aggregated according to the three dimensions of date, blood station, and blood collection volume to generate a daily blood volume table for each blood station in the corresponding region. The continuous date sequence from the minimum date to the maximum date within the sample period is supplemented for each group of data and missing values ​​are filled to obtain continuous time series blood volume data that is adapted to prediction of different period lengths. S3. Based on continuous time-series blood volume data, construct time-series dynamic statistical features including historical window sum, lag features, rolling mean, and rolling standard deviation. At the same time, integrate exogenous context features from meteorology and calendar to generate an initial feature matrix for model training and testing. S4. Based on the initial feature matrix, divide the training set and test set into rolling sets according to the time sequence. The test set consists of samples from the later part of the time series, and the length of the test set matches the length of the target prediction period. S5. The XGBoost baseline model is trained using a time-series incremental K-fold cross-validation strategy. Based on the time-series validation set of each fold, the OOF out-of-fold generalization baseline unbiased prediction value corresponding to the training set is generated. Then, the final XGBoost baseline model for the target prediction period is fitted using the full training set. The test set is input into the model for inference to obtain the baseline prediction value for the target prediction period. S6. Based on the actual blood volume of samples and the corresponding unbiased predicted values ​​of continuous time-series blood volume data, construct residual sequences and residual lag features. Among them, perform quantile extreme value pruning on the residuals during the training period to remove extreme noise interference. S7. The time series input sample is constructed by integrating residual lag features, baseline predicted values ​​of the target prediction period, and exogenous context features. The LSTM model is used to complete the time series learning of the residual sequence and the residual prediction of the future period based on the lookback window of the target prediction period length. S8. Apply adaptive dynamic amplitude constraints to the residual prediction values ​​to obtain residual correction values. Linearly fuse the constrained residual correction values ​​with the baseline prediction values ​​of the target prediction period to obtain the adaptive fusion prediction values ​​of the daily blood collection volume of the target prediction period. S9. Output multi-dimensional prediction results including baseline predictions, fused predictions of unconstrained residuals, and adaptive fused predictions.

[0006] In one scheme, the dynamic constraint mechanism for applying adaptive dynamic magnitude constraints to the residual prediction value in step S8 is to dynamically calculate the upper and lower limits of the correction magnitude based on the statistical characteristics of historical residuals.

[0007] The upper limit of the dynamic constraint range for residual correction magnitude is determined by the formula: Calculate the output value; The lower limit of the dynamic constraint range for residual correction magnitude is determined by the formula: Calculate the output value; in, μ res This is the moving average of the historical residuals. σ res The moving standard deviation of the historical residuals. k Horizon is the prediction step size; the initial value of the dynamic coefficient is set to 2.5, and it is dynamically adjusted according to stability.

[0008] Furthermore, the dynamic adjustment mechanism of the dynamic coefficients is triggered by sudden changes in the statistical characteristics of the residual standard deviation change rate, residual distribution skewness, business events, or model performance deterioration.

[0009] The dynamic adjustment method is confirmed by calculating the product of the initial value's dynamic coefficient and the volatility correction degree, event coefficient, and performance degradation coefficient. Among them, the volatility correction degree, event coefficient, and performance degradation coefficient correspond to statistical characteristic mutations, business event-driven events, and model performance deterioration, respectively. Untriggered conditions do not participate in the dynamic adjustment calculation.

[0010] Furthermore, business events include meteorological events, periodic events, and seasonal events triggered by exogenous contextual features, as well as actively tagged or input social activity events and public health events.

[0011] Business events are categorized into negative impact events, positive impact events, and neutral impact events based on their direction of influence on blood collection trends. Negative impact events require tighter residual constraints to avoid over-reliance on future information, and the event coefficient is less than 1. Positive impact events require relaxed constraints to capture sudden upward fluctuations, and the event coefficient is greater than 1. Neutral impact events have a weak impact on blood collection trends, and the event coefficient is set to 1 to maintain a stable balance.

[0012] Furthermore, based on the nature of events, their impact mechanisms, and occurrence patterns, meteorological events are further subdivided and labeled as follows: low temperatures below 17℃, normal temperatures between 18-25℃, high temperatures between 26-35℃, extreme high temperatures above 35℃, and rainfall events; periodic events are further subdivided and labeled as weekends and weekdays; seasonal events are further subdivided and labeled as summer months, winter months, long holidays, and short holidays; and the event coefficient is set as follows: low temperature 1.1, normal temperature 1, high temperature 0.95, extreme high temperature 0.85, rainfall 0.9, weekend 1, summer months 0.9, winter months 1.1, long holidays 1.2, and short holidays 1.15.

[0013] Furthermore, when at least two sub-business events occur simultaneously, based on the differences in the direction and intensity of their impact, the superimposed business events will form positive superposition, neutral superposition, or negative superposition. The superimposed event coefficient is obtained by assigning a comprehensive weight to each sub-business event according to its frequency, scope of influence, and intensity of influence, and then multiplying the original event coefficient of each sub-business event with its comprehensive weight, and then multiplying the result with other simultaneously occurring sub-business events.

[0014] In one scheme, the comprehensive weights set for each subdivided business event are as follows: extreme high temperature event 0.6, high temperature event 0.6, low temperature event 0.52, long holiday event 0.62, short holiday event 0.48, summer month 0.51, winter month 0.57, social activity event 0.46, public health event 0.47, and weekend event 0.61.

[0015] In one approach, the target forecast period is divided into short-term forecasts of less than 7 days, medium-term forecasts of 7 to 30 days, and long-term forecasts of more than 30 days, using 7 days and 30 days as nodes.

[0016] Among them, short-term forecasts apply to meteorological events and weekend events, and are adjusted using preset event coefficients; medium-term forecasts apply to meteorological events, weekend events, short holiday events, and social event events, and are calculated using weighted superposition of event coefficients; long-term forecasts apply to seasonal events and public health events, and are calculated using weighted superposition of events over a period longer than the target forecast period or using historical event coefficients for the same period.

[0017] Furthermore, the exit conditions for dynamic coefficient adjustment include natural exit when the impact of the event subsides, forced exit when blood inventory warning is triggered for two consecutive days, and gradual exit when the model performance recovers to historical levels; when the exit conditions are triggered, the dynamic coefficient is restored to the initial value of 2.5.

[0018] Furthermore, to achieve the above objectives, this application also provides a blood collection and supply daily blood volume prediction system based on residual learning and fusion, used to implement the aforementioned blood collection and supply daily blood volume prediction method based on residual learning and fusion. The system includes: The data acquisition and standardization preprocessing module includes a data acquisition unit, a data storage unit, and a preprocessing calculation unit. The data acquisition unit is used to acquire raw blood collection and supply data and transmit it to the data storage unit. The data storage unit is used to store the raw blood collection and supply data and subsequent processing data. The preprocessing calculation unit is used to perform standardization processing, grouping and aggregation calculations, and output continuous time-series blood volume data. The feature engineering module includes a time-series feature processing unit, an exogenous feature fusion unit, and a feature matrix generation unit. The time-series feature processing unit constructs time-series dynamic features based on continuous time-series blood volume data. The exogenous feature fusion unit interfaces with meteorological and calendar databases to extract and standardize exogenous features. The feature matrix generation unit is used to concatenate time-series features and exogenous features to generate an initial feature matrix. The baseline prediction module includes a dataset partitioning and validation unit, a K-fold cross-validation unit, an XGBoost training unit, an OOF concatenation unit, and a full-scale fitting unit. The dataset partitioning and validation unit partitions the training and test sets sequentially, verifying temporal continuity and preventing future information leakage. The K-fold cross-validation unit partitions the training set into multiple folds and then divides them into training and validation subsets. The XGBoost training unit trains the model fold by fold and performs predictions on the validation set. The OOF concatenation unit concatenates the prediction results from each fold of the validation set, generating the OOF out-of-fold generalization baseline unbiased prediction value for the entire training set. The full-scale fitting unit fits the final XGBoost baseline model using the entire training set and performs inference on the test set, outputting the baseline prediction value for the target prediction period. The residual learning module includes a residual calculation unit, an LSTM training unit, and a residual inference unit. The residual calculation unit constructs a residual sequence based on the unbiased baseline prediction value and the actual blood collection volume of the sample. The LSTM training unit trains the residual model using time-series sample inputs with fused features. The residual inference unit performs residual prediction on the test set. The dynamic constraint and fusion calculation module includes a dynamic constraint unit and a linear fusion unit; the dynamic constraint unit applies adaptive dynamic magnitude constraints to the residual prediction values; the linear fusion unit fuses the residual correction values ​​and the baseline prediction values. The multi-dimensional output module is used to output multi-dimensional prediction results that include baseline predictions, fused predictions of unconstrained residuals, and adaptive fused predictions.

[0019] One or more technical solutions provided in this application have at least the following technical effects or advantages: This application addresses the nonlinear, periodic, and abrupt changes in blood collection volume by employing a two-stage fusion architecture of XGBoost baseline prediction and LSTM residual correction. This ensures both the interpretability of the prediction results and the ability to fit nonlinear features, while also compensating for temporal biases in the baseline model through temporal residual learning. Furthermore, by using temporally incremental K-fold cross-validation and OOF generalization baseline construction, future information leakage is prevented, enhancing the model's generalization ability. Additionally, adaptive dynamic amplitude constraints on residuals effectively suppress prediction overshoot in extreme scenarios, ensuring the business rationality of the prediction results. This improves the accuracy, robustness, and business adaptability of daily blood collection volume prediction, providing reliable decision support for blood bank blood collection planning, inventory management, and emergency dispatch, and promoting the practical application of blood collection prediction technology in the business sector. Attached Figure Description

[0020] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic flowchart of a method for predicting daily blood collection volume based on residual learning and fusion in one embodiment of this application; Figure 2 This is a time-series comparison chart of the total blood volume prediction effect for a one-week prediction cycle in one embodiment of this application; Figure 3 This is a tracking comparison diagram of the baseline prediction error sequence and the corrected residual sequence for a one-week prediction period in one embodiment of this application; Figure 4 This is a time-series comparison chart of the total blood volume prediction effect in a half-month prediction cycle according to one embodiment of this application; Figure 5 This is a tracking comparison diagram of the total blood volume baseline prediction error sequence and the corrected residual sequence for a half-month prediction cycle in one embodiment of this application; Figure 6 This is a time-series comparison chart of the total blood volume prediction effect for a one-month prediction cycle in one embodiment of this application; Figure 7 This is a tracking comparison diagram of the total blood volume baseline prediction error sequence and the corrected residual sequence for a one-month prediction cycle in one embodiment of this application; Figure 8 This is a time-series comparison chart of the total blood volume prediction effect over a three-month prediction cycle in one embodiment of this application; Figure 9 This is a tracking comparison diagram of the total blood volume baseline prediction error sequence and the corrected residual sequence for a three-month prediction cycle in one embodiment of this application; Figure 10 This is a time-series comparison chart of the total blood volume prediction effect for a six-month prediction cycle in one embodiment of this application; Figure 11 This is a tracking comparison diagram of the total blood volume baseline prediction error sequence and the corrected residual sequence for a six-month prediction cycle in one embodiment of this application; Figure 12 This is a time-series comparison chart of the total blood volume prediction effect over a one-year prediction period in one embodiment of this application; Figure 13 This is a tracking comparison diagram of the total blood volume baseline prediction error sequence and the corrected residual sequence for a one-year prediction cycle in one embodiment of this application; Figure 14This is a time-series comparison chart of the prediction effect of blood type A over a three-month prediction period in one embodiment of this application; Figure 15 This is a time-series comparison chart of the prediction effect of blood type AB for a three-month prediction period in one embodiment of this application; Figure 16 This is a time-series comparison of the prediction effect of blood type B for a three-month prediction period in one embodiment of this application; Figure 17 This is a time-series comparison chart of the prediction effect of type O blood in a three-month prediction cycle according to one embodiment of this application. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, 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, not all embodiments. The data content of the embodiments of this application described and shown in the accompanying drawings can be substituted with variables according to specific needs. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0023] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.

[0024] To address the shortcomings of existing blood collection prediction technologies, such as susceptibility to short-term fluctuations and abnormal events, and a lack of ability to capture residual dynamics and local mutations in continuous time series data, which hinders stable implementation in operational settings, this application provides a method for predicting daily blood collection volume based on residual learning and fusion. Please refer to [link to relevant documentation]. Figure 1 The method includes the following steps: Step S1: Collect raw blood collection and supply data, including blood collection time, blood volume, and blood type, using the blood bank's historical blood collection ledger. Perform field mapping, format unification, and blood volume unit conversion processing on the raw blood collection and supply data to obtain standardized basic data.

[0025] In this embodiment, the system can traverse the historical blood collection and supply raw data files in formats such as xlsx and csv stored in the blood bank's preset data directory, and uniformly read core fields such as blood collection time, blood collection volume, and blood type from each raw data file to complete the batch collection and merging of multi-source raw data.

[0026] Simultaneously, the collected raw data undergoes standardized cleaning and format normalization processing. For example, the "Blood Collection Department" field is uniformly mapped and named "Blood Station" to identify the blood collection entity; the "Record Blood Type" field is uniformly mapped and named "Blood Type" to identify blood typing; and the "Blood Collection Volume" field is uniformly mapped and named "Blood Volume," forming a standardized field naming system to eliminate field heterogeneity from multi-source data. The date portion is precisely extracted from the "Blood Collection Time" field, and redundant time information such as hours, minutes, and seconds is removed. The extracted date data is uniformly converted to the datetime standard date and time type to ensure the consistency of the time axis for subsequent time series aggregation and feature construction. A unified unit conversion is performed on the "Blood Volume" field, and a blood volume value judgment threshold is set. When the original blood volume value is greater than the preset threshold, it is converted into a standard basic unit of 200 ml. When the original blood volume value is less than or equal to the preset threshold, the actual collected value is retained and converted into standard units, realizing the uniformity of measurement standards for all blood collection data and eliminating differences in blood volume measurement under different collection scenarios. Furthermore, it provides standardized basic data for subsequent data aggregation, time series construction, and model training, avoiding modeling bias caused by noise in the original data.

[0027] Step S2: Group and aggregate the standardized basic data according to the three dimensions of date, blood station, and blood collection volume to generate a daily blood volume table for each blood station's corresponding region. Complete the continuous date sequence from the minimum date to the maximum date within the sample period for each group of data and fill in the missing values ​​to obtain continuous time-series blood volume data that is adapted to predictions of different period lengths.

[0028] In this embodiment, the standardized data preprocessed in step S1 is grouped and aggregated according to the three dimensions of date, blood station, and blood collection volume. Using daily as the statistical granularity, the standard unit blood volume of all blood types under the same date and blood station is accumulated to obtain daily-level blood collection volume aggregated data. The aggregated results of all processed original data files are vertically stitched together to form a daily-level total blood volume table covering the entire collection cycle and all blood types within the blood station's service area. A grouped time-series completion operation is then performed on the daily-level total blood volume table, including completing all consecutive natural days from the minimum date to the maximum date. For missing dates without collection records, the corresponding daily-level blood collection volume values ​​are adaptively filled to ensure that each blood station and each blood type forms a continuous and uninterrupted daily time-series sequence. A duplicate check is performed on the completed time-series data to remove duplicate date entries, ensuring the uniqueness of blood volume data under a single group and date, thus meeting the input requirements of the time-series prediction model for continuous time series.

[0029] Step S3: Based on continuous time-series blood volume data, construct time-series dynamic statistical features including historical window sum, lag features, rolling mean, and rolling standard deviation. At the same time, integrate exogenous context features from meteorology and calendar to generate an initial feature matrix for model training and testing.

[0030] Among them, the construction of time-series dynamic statistical features is based on the continuous daily blood volume data of blood stations, and dynamic statistical features that characterize the historical blood collection inertia, fluctuation patterns and periodic trends are extracted. Using 1 day, 3 days, 7 days, 14 days, and 30 days as different prediction periods as examples, we construct multi-window historical blood collection volume summation features for 1 day, 3 days, 7 days, 14 days, and 30 days to capture the total blood collection volume trend for prediction periods of different window lengths. We also construct features for the previous day's blood volume lag1, the previous 7 days' blood volume lag7, the previous 14 days' blood volume lag14, and the previous 30 days' blood volume lag30 to characterize the temporal lag inertia of blood collection behavior. At the same time, we construct rolling mean features for rolling7, rolling14, and rolling30, rolling standard deviation features for rolling_std7 and rolling_std14, absolute difference features for absdiff1 and absdiff7, relative difference features for diff7 and diff14, and rolling absolute difference features for rolling_absdiff7 to comprehensively characterize the short-term fluctuations, long-term stability, and abnormal mutation characteristics of blood collection volume.

[0031] Meteorological features are obtained by reading meteorological data for the corresponding date from publicly available meteorological databases, extracting rainfall information, and using the daily maximum temperature or the average temperature of the daytime interval as core indicators, and generating meteorological correlation features, such as temperature square feature, used to capture the nonlinear effect of temperature on blood collection volume; temperature difference feature, to characterize the daytime temperature fluctuation range; and rolling temperature feature of the window interval, to characterize the continuous temperature change trend.

[0032] Calendar context features, based on date information, generate calendar features representing the cycles of social behavior, adapting to the significant impact of holidays, back-to-school seasons, and weekdays / weekends on blood collection behavior. Specifically, holiday features mark Spring Festival, National Day, Qingming Festival, Dragon Boat Festival, and Mid-Autumn Festival, representing the impact of statutory holidays on blood collection behavior; back-to-school season features represent the cyclical changes in blood collection contributions from student groups; and weekdays, weekends, and months can represent periodic and seasonal blood collection patterns. By integrating three major categories of features—time-series dynamic statistical features, meteorological features, and calendar context features—an initial feature matrix adapted to the nonlinear, periodic, and abrupt characteristics of blood collection volume is constructed. This comprehensively characterizes the multiple influences of historical inertia, meteorological changes, social cycles, and holiday impacts on blood collection volume, providing highly discriminative and interpretable input features for the baseline model.

[0033] Step S4: Based on the initial feature matrix, divide the training set and test set into a rolling set according to the time sequence. The test set consists of samples from the later part of the time series, and the length of the test set matches the length of the target prediction period.

[0034] In this embodiment, the initial feature matrix is ​​used as the modeling basis. The entire set of modeling samples is divided strictly according to the chronological order of the timeline. Samples that are later in the time dimension and whose length matches the current target prediction period are designated as the test set. All historical samples before the test set time points are uniformly designated as the training set. That is, a configuration of a single test set paired with a corresponding historical training set is adopted. The training and test sets are completely separated on the timeline with no overlap. The collection time of all test set samples is later than that of the training set samples. This ensures that the model training, validation, and inference processes fully align with the core logic of predicting future blood collection volume using only historical blood collection data in actual business scenarios, ensuring the training effectiveness, evaluation accuracy, and generalization reliability of the baseline model.

[0035] Step S5: Train the XGBoost baseline model using a time-series incremental K-fold cross-validation strategy. Generate the OOF out-of-fold generalization baseline unbiased prediction value corresponding to the training set based on the time-series validation set of each fold. Then, fit the final XGBoost baseline model for the target prediction period using the full training set, input the test set into the model for inference, and obtain the baseline prediction value for the target prediction period.

[0036] K-fold cross-validation is a statistical method for evaluating the performance of machine learning models. It divides the dataset into K subsets (folds), trains the model with K-1 folds each time, and uses the remaining 1 fold as the validation set. After repeating this process K times, the average performance metric is used to evaluate the model. OOF prediction, or Out-of-Fold Prediction, is the prediction result generated by a model that has never seen the sample during K-fold cross-validation. It is used to more realistically reflect the model's generalization ability.

[0037] In this embodiment, based on the initial feature matrix from step S3 and the rolling training set from step S4, the XGBoost baseline model is trained using a time-series incremental K-fold cross-validation strategy, and the OOF out-of-fold generalization baseline prediction value corresponding to the training set is generated. Specifically, the time-series incremental K-fold cross-validation divides the training and validation subsets fold by fold according to the chronological order of the samples. Each validation subset is the later part of the time series data of the corresponding training subset, without disrupting the time sequence or introducing future information, thus preventing data leakage at its source. The OOF out-of-fold generalization baseline unbiased prediction value is formed by concatenating the prediction results of each fold model on the corresponding validation set according to the original sample order, resulting in an unbiased prediction value covering the entire training set. This result has not been directly trained by any fold model and possesses extremely strong generalization ability.

[0038] Specifically, based on the size of the training set sample and the time-series characteristics of blood collection, the rolling training set is divided into a preset number of time-series folds according to the time sequence. Each fold has an equal sample size and maintains temporal continuity, with no time overlap or data overlap between all folds. The data of each fold is traversed sequentially, and all samples from all folds other than the current fold are used as the training subset for that round and input into the XGBoost model for training. The model uses preset parameters such as learning rate, number of trees, maximum depth, subsampling and column sampling ratio, etc., and uses mean squared error as the evaluation index. Combined with an early stopping mechanism, it prevents overfitting. During the training process, only historical time-series data is used, and the validation samples of subsequent folds are not touched. After each fold of model training is completed, predictions are only performed on the validation set samples corresponding to the current fold. The prediction results are stored separately and do not participate in the next iteration of model training to ensure the unbiasedness of the prediction values. After all folds have been trained and predicted, the prediction results of each fold's validation set are concatenated and integrated one by one according to the original time order of the training set and the sample number to form the OOF out-of-fold generalization baseline prediction value covering the entire training set samples. This prediction value is the unbiased baseline prediction value of the training set.

[0039] As an optional implementation of this application, considering the characteristics of strong nonlinearity, local outliers, and significant time-series dependence of daily blood collection, and combining the requirements of time-series K-fold cross-validation and OOF generalization baseline generation, the XGBoost model can adopt a parameter configuration that balances fitting ability, generalization ability, and training stability. The specific parameter setting logic can be as follows: `n_estimators=200` sets 200 decision trees to build the ensemble model. This number is suitable for small to medium-sized time-series samples for blood collection volume prediction. It ensures that the model has sufficient ensemble learning ability to fully fit the nonlinear correlation between historical blood volume, weather, calendar, and other features and daily blood collection volume, while avoiding overfitting and reduced training efficiency due to an excessive number of trees. It also forms an optimal match with the learning rate to ensure smooth model convergence. `learning_rate=0.05` uses a relatively small learning rate / step size of 0.05 to control the parameter update magnitude in each iteration. A small learning rate reduces training oscillations, allowing the model to learn the cyclical patterns and fluctuations of blood collection volume more precisely, significantly improving the stability of the OOF generalization baseline. Combined with 200 decision trees, it ensures prediction accuracy while suppressing overfitting risk at its source, adapting to the business characteristics of blood collection volume data with high noise levels.

[0040] `max_depth=4` limits the maximum depth of the decision tree to 4 layers, which can accurately fit the cross-correlation between features, while strictly limiting the model complexity to avoid the model overlearning random noise and abnormal blood collection records in historical data, and ensuring the generalization ability of the baseline model.

[0041] min_child_weight=3 sets the minimum sample weight of the leaf nodes to 3, which can effectively filter extreme outliers in the blood collection data, prevent the model from generating unreasonable splitting rules due to a small number of abnormal samples, improve the model's ability to learn regular blood collection patterns, ensure that the OOF generalization baseline is not disturbed by abnormal data, and adapt to scenarios with strong mutations in blood collection data.

[0042] `subsample=0.8` means that only 80% of the training samples are randomly selected for modeling during the training of each decision tree. Random sampling breaks the local correlation of time series data and reduces the model's dependence on samples from specific dates or blood banks. `colsample_bytree=0.8` means that only 80% of the input features are randomly used for each decision tree to avoid the model's over-reliance on a single feature and to force the model to learn the joint rules of multi-dimensional features.

[0043] With scale_pos_weight=1, the daily blood volume continuous value regression prediction task does not have the sample imbalance problem in classification tasks. The positive and negative sample weight ratio is set to 1 to ensure the model's learning fairness for all dates and all blood volume intervals, which is in line with the business goal of blood volume prediction.

[0044] seed=1024, a fixed random seed value, ensures that the random sampling and initial parameters of the model are completely consistent in each training session; eval_metric=mean_squared_error, uses mean squared error as the core evaluation metric for model training and validation; early_stopping_rounds=20, enables the automatic early stopping mechanism. If the mean squared error of the model on the validation set does not improve after 20 consecutive iterations, training will be terminated immediately to avoid overfitting and reduce invalid iterations.

[0045] In this embodiment, based on the determined XGBoost model hyperparameters and training configuration, the final baseline model is fitted and trained using the full rolling training set, and inference is performed on the test set samples to generate the test set baseline prediction results, which serve as the core benchmark data for subsequent fusion with the residual correction values.

[0046] Specifically, keeping the model parameters, regularization rules, and missing value handling methods unchanged from the cross-validation stage, all rolling training set samples from step S4 are used as training data to perform a one-time complete fitting training on the XGBoost model. No validation layers are defined in this stage, allowing the model to fully absorb the distribution patterns, temporal cycle characteristics, and correlations between meteorological and calendar features of all historical blood collection data. This maximizes the model's ability to learn from historical blood collection patterns, forming a final, finalized baseline model adapted to the current variable prediction cycle. Then, test set samples from the later temporal phase are input into the trained final XGBoost baseline model, and forward inference calculations are performed. The model uses the initial feature matrix as input and daily blood collection volume as the prediction target, outputting continuous predicted values ​​for each sample. This set of values ​​is the baseline predicted value for the target prediction cycle.

[0047] In particular, preliminary business regularization can be performed on the baseline predicted values, including nonnegation constraints and numerical rounding, so that the baseline predicted values ​​conform to the actual business rules of nonnegative and integer measurement of blood collection volume, in order to prepare for subsequent residual fusion and final output.

[0048] Step S6: Construct residual sequences and residual lag features based on the actual blood volume of samples and the corresponding unbiased predicted values ​​from continuous time-series blood volume data. Among them, quantile extreme value pruning is performed on the residuals during the training period to remove extreme noise interference.

[0049] Specifically, the residuals are calculated as the difference between the actual daily blood collection volume and the corresponding baseline predicted value. The training set residuals are constructed based on the unbiased predicted values ​​of the OOF generalization baseline without data leakage, while the test set residuals are constructed based on the baseline predicted values ​​of the test set. To reduce the interference of extreme abnormal blood collection records and sudden fluctuations on the training of the residual model, extreme value pruning is performed only on the residual sequences during the training period. A quantile truncation strategy is adopted, that is, the 1% quantile and 99th quantile of the training set residuals are extracted as upper and lower truncation thresholds, and extreme residual values ​​exceeding the threshold range are constrained to the corresponding quantile values ​​to complete the noise reduction of the residual sequences. No pruning operation is performed on the residuals during the test period to maintain the original distribution and verify the true generalization ability of the model.

[0050] Step S7: Construct time series input samples by fusing residual lag features, baseline predicted values ​​of the target prediction period, and exogenous context features. Use an LSTM model based on a lookback window of the target prediction period length to complete time series learning of the residual sequence and residual prediction of future periods.

[0051] In this embodiment, the denoised residual sequence is the core objective. A dedicated input sequence for residual learning is constructed by fusing multi-dimensional features. These input features include at least the first-order lag residual feature, XGBoost baseline prediction, average temperature meteorological features, holiday markers, back-to-school season markers, window length periodic rolling mean features, 1-day lag blood volume features, weekend markers, and monthly calendar features, comprehensively covering the factors influencing residual fluctuations. Standardization is performed on both the constructed input features and the target residual to eliminate the impact of differences in feature magnitude and units on model training, ensuring model convergence efficiency and prediction stability. A lookback window is set based on the target prediction period, converting the standardized two-dimensional feature data into three-dimensional time-series samples in the format of sample count × lookback window × feature dimension, adapting to the input requirements of time-series models.

[0052] A lightweight unidirectional LSTM temporal network is used to construct a residual prediction model. The model consists of an input layer, a two-layer unidirectional LSTM feature extraction layer, a batch normalization layer, a Dropout regularization layer, a fully connected mapping layer, and a linear output layer stacked sequentially. The first LSTM layer extracts short-term residual temporal features, and batch normalization and Dropout layers are used to prevent overfitting. The second LSTM layer further refines deep temporal patterns and outputs compressed feature vectors. The fully connected layer completes the nonlinear mapping, and finally, the linear output layer outputs the daily residual prediction value. The model training uses an adaptive optimizer with a gradient pruning strategy to prevent gradient explosion during training. The mean squared error is used as the loss function, and the mean absolute error is used as the evaluation metric. After training, the three-dimensional temporal samples of the test set are input into the model, and the residual prediction values ​​of the test set are obtained through inference.

[0053] Step S8: Apply adaptive dynamic amplitude constraints to the residual prediction values ​​to obtain residual correction values. Linearly fuse the constrained residual correction values ​​with the baseline prediction values ​​of the target prediction period to obtain the adaptive fusion prediction values ​​of the daily blood collection volume of the target prediction period.

[0054] In this embodiment, to avoid overshooting distortion of the residual prediction value under extreme business scenarios, an adaptive dynamic amplitude constraint is applied to the residual prediction value output in step S7. That is, based on the numerical value of the baseline prediction value, a reasonable upper and lower limit range of the residual prediction value is adaptively generated. Then, the original residual prediction value is constrained to the dynamic range to obtain the compliant residual correction value after trimming. The trimmed residual correction value is then added to the baseline prediction value sample by sample to obtain the initial fusion prediction value. The initial fusion prediction value is non-negatively verified and the negative value is corrected to form the final adaptive fusion prediction value of the daily blood collection volume.

[0055] Step S9: Output a multi-dimensional prediction result that includes the baseline prediction value, the fused prediction value of the unconstrained residuals, and the adaptive fused prediction value.

[0056] In this embodiment, after completing the adaptive fusion prediction, multi-level, traceable, and multi-dimensional prediction results can be output for blood collection scheduling and inventory management operations. The output content includes at least the baseline prediction value for the target prediction period generated by the XGBoost model, the fusion prediction value without dynamic amplitude constraints, and the final adaptive fusion prediction value after dynamic constraints and business verification. In addition, the model can be periodically updated according to the length of the target prediction period during subsequent use and maintenance.

[0057] Furthermore, based on the actual daily blood collection volume of the sample, the mean absolute error (MAE) and mean absolute percentage error (MAPE) of the XGBoost baseline prediction and the final adaptive fusion prediction are calculated to quantitatively evaluate the prediction accuracy and technical improvement effect of this method. The mean absolute error characterizes the absolute deviation level between the predicted value and the actual value, intuitively reflecting the average error scale of a single day's blood collection prediction; the mean absolute percentage error characterizes the relative proportion of prediction deviation, allowing for comparison of prediction accuracy across blood stations and cycles, and adapting to evaluation scenarios with different blood collection scales. By comparing the evaluation index difference between the baseline prediction and the final adaptive fusion prediction, the accuracy improvement effect brought about by residual correction and dynamic constraints can be quantitatively verified.

[0058] For example, business visualization analysis charts can be generated, such as time-series comparison curves of actual blood collection volume, baseline predicted value and final adaptive fusion predicted value, to intuitively present the fluctuation trend and fitting effect of the three types of data; and tracking comparison charts of XGBoost baseline prediction error sequence and corrected residual sequence to verify the correction effect and tracking capability of the residual model on baseline error, providing intuitive basis for model optimization and business decision-making.

[0059] For details, please refer to Figures 2 to 13 The figures are time-series comparisons of the total blood volume prediction results obtained by applying the prediction method of this application with different target prediction periods of one week, half a month, one month, three months, half a year, and one year, respectively, including the actual blood volume, baseline prediction value, and final adaptive fusion prediction value, and tracking comparisons of the baseline prediction error sequence and the corrected residual sequence.

[0060] As shown in the time-series comparison chart of the prediction effects of various total blood volumes, in short-term predictions within one week, the final adaptive fusion prediction value effectively corrected the prediction deviation compared to the baseline prediction value, making the prediction sequence more consistent with the actual blood collection volume. In medium-term predictions such as half a month and one month, the prediction effect of the final adaptive fusion prediction value is close to the level of short-term prediction. Although the actual blood collection volume fluctuates more frequently and with greater amplitude, the final adaptive fusion prediction value can identify and track it in a timely manner, and the deviation is effectively reduced compared to the baseline prediction value. In long-term predictions such as six months and one year, the deviation of the final adaptive fusion prediction value does not worsen with the extension of the period. Based on the adaptive dynamic amplitude constraint of this application, the final adaptive fusion prediction value can stably grasp the long-term seasonal and periodic fluctuation trend of the actual blood collection volume, while the fluctuation amplitude is significantly smaller than that of the baseline prediction value, effectively suppressing the prediction deviation caused by sudden business events. Taking the prediction period of three months as an example, the MAE of the XGBoost baseline prediction is 60.2, while the MAE of the final adaptive fusion prediction in this application is 41.6, a decrease of about 30%; at the same time, the MAPE of the XGBoost baseline prediction is 5.5%, while the MAPE of the final adaptive fusion prediction in this application is 3.83%, also a decrease of about 30%.

[0061] As shown in the tracking comparison chart of the baseline prediction error sequence and the corrected residual sequence, the corrected residual sequence of this application can dynamically constrain and compensate for the XGBoost baseline prediction error sequence under different prediction periods. In short-term prediction scenarios, the corrected residual can neutralize the systematic bias of the baseline, supporting a high-precision fit between short-term prediction results and actual blood volume. In medium- and long-term prediction scenarios, while compensating for errors, the corrected residual also uses a dynamic constraint mechanism to stably control the residual fluctuation amplitude within a reasonable range, effectively suppressing extreme fluctuations and drifts of the baseline error in long-term predictions and improving prediction stability. In other words, compared with the conventional XGBoost baseline model, the hybrid model and prediction method of this application achieve a reduction in prediction error or an improvement in stability under different prediction periods, demonstrating strong robustness and covering the full-scenario business needs of blood banks from daily scheduling to annual planning.

[0062] Specifically, standardized basic data can be segmented by blood type (A, B, AB, O) to generate dedicated continuous time-series blood volume data and corresponding initial feature matrices for each blood type. The daily blood collection volume prediction method of this application can then be executed independently as needed, outputting independent baseline prediction values, fused prediction values ​​of unconstrained residuals, and adaptive fused prediction values ​​for each blood type. For an example, please refer to [link to example]. Figures 14 to 17 These are time-series comparison charts of the prediction effects obtained by independently executing the prediction of blood type A, B, AB, and O data with a target prediction period of three months. Figures 14 to 17It can be seen that the hybrid model and prediction method of this application show stable optimization effects in both blood type independent prediction and total blood type unified prediction scenarios. The final adaptive fusion prediction curves of each blood type are closer to the actual blood collection volume than the XGBoost baseline prediction curve, with smaller fluctuations, effectively correcting the deviation of the baseline prediction. Furthermore, the blood type independent prediction is less affected by the interference of multiple factors, and the MAE performance is better, with AB type only 5.1, A type 10.2, O type 12.2, and B type 12.6. Therefore, the prediction method of this application has universality in both blood type and unified total volume prediction scenarios, and can provide information data support for blood collection scheduling in different scenarios.

[0063] Furthermore, this application employs a two-stage fusion architecture of XGBoost baseline prediction and LSTM residual correction. The XGBoost model accurately fits the nonlinear cross-relationship between multivariate features and blood collection volume, ensuring the interpretability of the prediction results. The LSTM model then captures the temporal dynamics of the baseline prediction error, compensating for the baseline model's shortcomings in fitting local mutations and periodic fluctuations, significantly improving the prediction accuracy of daily blood collection volume. Simultaneously, by applying adaptive dynamic amplitude constraints to the residual prediction values, this application effectively suppresses prediction distortion caused by over-correction of residual predictions in extreme scenarios, ensuring that the final prediction results conform to the actual operational fluctuations in blood collection volume. This avoids ineffective predictions misleading blood collection scheduling and provides reliable data reference assistance for blood station long-term blood collection planning decisions and frontline blood collection and supply scheduling.

[0064] In one embodiment, based on the aforementioned embodiment, the dynamic constraint mechanism for applying adaptive dynamic magnitude constraints to the residual prediction value in step S8 is to dynamically calculate the upper and lower limits of the correction magnitude according to the statistical characteristics of historical residuals, so as to ensure that the constraint range conforms to the data pattern and controls the prediction risk.

[0065] Specifically, the formulas for calculating the upper and lower limits of the dynamic constraint range for residual correction amplitude are as follows: ; ; In the formula, μ res This is the moving average of the historical residuals. σ res The moving standard deviation of the historical residuals. k Horizon is the dynamic coefficient, which is the prediction step size, i.e., the window length of the target prediction period. Dynamic coefficient k The initial value is set to 2.5, and dynamically adjusted based on stability; the moving average of historical residuals. μ res Moving standard deviation of historical residuals σ resThe preferred window length is 3 times the target prediction period window length.

[0066] Among them, dynamic coefficient k This is a core parameter balancing the sensitivity and stability of forecast corrections. The initial value of 2.5 is set based on a comprehensive consideration of statistical theory, business risk tolerance, and empirical verification. In statistical theory, under a normal distribution... k =1.96 corresponds to a 95% confidence interval, which can cover approximately 95% of the data points; k =2.58 corresponds to a 99% confidence interval, covering approximately 99% of the data points. However, the actual residual distribution is often non-normal, and the blood collection station data exhibits right skewness and heavy tails, meaning the probability of sudden low blood collection events is higher than the normality assumption. In the measured residual distribution, the 99th percentile is usually between 2.3 and 2.7, rather than the theoretical 2.58. Therefore, = k The initial value is set to 2.5, with the goal of 99% business security and a 5% fault tolerance margin reserved to avoid excessive constraints that could lead to correction failure.

[0067] Specifically, dynamic coefficients k The absolute boundary is limited to 1.2~3.2, when k When the error rate is <1.2, the miscorrection rate is >35%, which easily leads to misjudging normal fluctuations as abnormalities, resulting in frequent adjustments to blood distribution; when k When the score is greater than 3.2, the failure rate of high-risk events exceeds 12%, which has exceeded the business security threshold.

[0068] Furthermore, dynamic coefficients k The dynamic adjustment mechanism is triggered by sudden changes in the statistical characteristics of the residual standard deviation, residual distribution skewness, business events, or model performance deterioration. Specifically, the triggering of sudden changes in statistical characteristics requires simultaneous satisfaction of the residual standard deviation. σ res The 7-day moving average change rate is greater than 20% for three consecutive days; and the absolute value of the skewness of the residual distribution is greater than 0.8, indicating a significant heavy-tailed effect. The trigger condition for model performance deterioration can be that the MAPE of the test set is greater than the historical mean + 1.5 standard deviations for three consecutive days.

[0069] Specifically, the dynamic adjustment method is determined by calculating the product of the initial value's dynamic coefficient, volatility correction level, event coefficient, and performance degradation coefficient, i.e., the formula: ; In the formula, k base =2.5, which is the initial value of the anchor point when no adjustment is made; ∆ σ The current residual standard deviation σ res The difference between the target prediction period and the reference value, which can be the median within the target prediction period; αThe value of 0.3 is the sensitivity coefficient determined through backtesting; β event For event coefficients; γ perf The performance degradation coefficient is determined by... Calculation. Among them, volatility correction degree, event coefficient, and performance decay coefficient correspond to statistical characteristic mutation, business event-driven, and model performance deterioration, respectively. Conditions that are not triggered do not participate in the dynamic adjustment calculation or are calculated with a value of 1.

[0070] Furthermore, business events include meteorological events, periodic events, and seasonal events triggered by exogenous contextual features, as well as social activity events and public health events that are actively labeled or input by humans when an event occurs.

[0071] Based on their impact on blood collection trends, business events are categorized into negative impact events, positive impact events, and neutral impact events. Negative impact events have an event coefficient less than 1, indicating tighter residual constraints. This makes the model's prediction of blood collection volume more conservative, avoiding over-reliance on future information. While the impact of negative impact events is highly predictable, the model should not overly rely on these predictable negative factors when predicting the future; therefore, the correction magnitude needs to be controlled to avoid information leakage. Positive impact events have an event coefficient greater than 1, indicating relaxed constraints. This makes the model's prediction of blood collection volume more flexible, allowing it to capture sudden increases in blood collection volume. Although the impact of positive impact events is predictable, fluctuations in blood donation volume may lead to blood supply shortages, requiring increased model sensitivity to such fluctuations. Neutral impact events have an event coefficient equal to 1, indicating no adjustment of constraints, maintaining a balance between the model's predictive sensitivity and stability.

[0072] Furthermore, based on the nature of the events, their impact mechanisms, and their occurrence patterns, meteorological events are further subdivided and labeled as low temperatures below 17℃, normal temperatures between 18-25℃, high temperatures between 26-35℃, extreme high temperatures above 35℃, and rainfall events; periodic events are further subdivided and labeled as weekends and weekdays; and seasonal events are further subdivided and labeled as summer months, winter months, long holidays (Spring Festival, National Day), and short holidays (Qingming Festival, Dragon Boat Festival, Mid-Autumn Festival).

[0073] In this embodiment, the event coefficient for low temperature is set to 1.1. Cold weather reduces the willingness to donate blood outdoors, but the increased prevalence of influenza in low temperatures may increase clinical blood demand and thus intensify blood collection efforts. In other words, low temperature has a predominantly negative impact, but there are some special positive effects. Relaxing the constraints allows for a wider range of model adjustments. The event coefficient for normal temperature is set to 1. Normal temperature has no bias towards outdoor blood donation and can be considered a non-influencing event. The event coefficient for high temperature is set to 0.95, and for extreme high temperature to 0.85. Increased temperature leads to decreased outdoor comfort, potentially reducing the public's willingness to go out, and the higher the temperature, the more significant the impact. This is a negative impact, and the constraint tightening is adjusted based on high and extreme high temperatures. The event coefficient for rainfall is set to 0.9. Rainfall hinders public outdoor activities and may reduce the public's willingness to go out, which is a negative impact, and the constraints are moderately tightened. The event coefficient for weekends is set to 1. Weekends have a strong regularity in their impact, and the model has already learned sufficiently from the training data, so no additional adjustments are needed. The event coefficient is set at 0.9 for summer months and 1.1 for winter months. Summer and winter months experience similar seasonal high and low temperature events, so restrictions are appropriately tightened or relaxed accordingly. The event coefficient is set at 1.2 for long holidays and 1.15 for short holidays. Significant population movement occurs during long and short holidays, potentially causing temporary interruptions in blood donation, which is a negative impact, so restrictions are relaxed. Furthermore, social events, primarily including multi-channel public awareness campaigns, incentivize blood donation, which is a positive impact, with an event coefficient of 1.05. Public health events, mainly referring to regional epidemics, restrict regional population movement or the allocation of medical resources, are a negative impact, with an event coefficient of 0.95.

[0074] Furthermore, when at least two sub-business events occur simultaneously, based on the differences in the direction and intensity of their impact, the superimposed business events will form positive superposition, neutral superposition, or negative superposition. The superimposed event coefficient is obtained by assigning a comprehensive weight to each sub-business event according to its frequency, scope of influence, and intensity of influence, and then multiplying the original event coefficient of each sub-business event with its comprehensive weight, and then multiplying the result with other simultaneously occurring sub-business events.

[0075] In one embodiment, based on the aforementioned embodiments, the comprehensive weights set for each subdivided business event are as follows: extreme high temperature event 0.6, high temperature event 0.6, low temperature event 0.52, long holiday event 0.62, short holiday event 0.48, summer month 0.51, winter month 0.57, social activity event 0.46, public health event 0.47, and weekend event 0.61.

[0076] In this embodiment, the overall weight is calculated using a weighted average method, i.e., Overall Weight = (Frequency Weight × 0.4) + (Affect Scope Weight × 0.3) + (Affect Intensity Weight × 0.3). The frequency weight, due to its direct impact on the model's daily adjustment frequency, is assigned a higher weight; the affect scope weight determines the impact of an event on the regional blood collection network; and the affect intensity weight determines the fluctuation range of blood collection volume from a single event, both assigned equal, lower weights. The specific frequency weight, affect scope weight, and affect intensity weight settings for each sub-business event are shown in Table 1.

[0077] Table 1. Weighting of Subdivided Business Events The weighting logic is as follows: frequency weight is calculated based on the annual average number of occurrences and duration of the event, with weekends showing the highest frequency due to their periodic high frequency; public health events have a lower annual probability of occurrence; the annual average number of days with extreme high temperatures varies significantly across different regions, but the overall frequency is low. The impact range weight is based on the scope of the event's impact on blood collection stations, while the impact intensity weight is based on a comprehensive consideration of the fluctuation range of the event on blood collection volume.

[0078] In one embodiment, based on the aforementioned embodiments, the target prediction period is divided into short-term prediction (less than 7 days), medium-term prediction (7 to 30 days), and long-term prediction (more than 30 days) using 7 days and 30 days as nodes.

[0079] Short-term forecasts require rapid response to predictable events of the day, are applicable to meteorological events and weekend events, and are adjusted using preset event coefficients. Medium-term forecasts need to balance short-term fluctuations and medium-term trends, and may also involve the combined impact of multiple events, are applicable to meteorological events, weekend events, short holiday events and social event events, and are calculated using weighted superposition of event coefficients. Long-term forecasts need to consider a wider range of event impacts, are applicable to seasonal events and public health events, and are calculated using weighted superposition of events over a period longer than the target forecast period or using historical event coefficients from the same period.

[0080] Furthermore, dynamic coefficients k The dynamic adjustment exit conditions include natural exit as the event's impact subsides, mandatory exit upon triggering a blood inventory warning for two consecutive days, and gradual exit when model performance recovers to historical levels; when the exit conditions are triggered, the dynamic coefficients... k Restored to the initial value of 2.5.

[0081] As one implementation scheme, this application also provides a blood collection and supply daily blood volume prediction system based on residual learning and fusion, which is used to implement a blood collection and supply daily blood volume prediction method based on residual learning and fusion in the aforementioned embodiments. The system includes a data acquisition and standardization preprocessing module, a feature engineering module, a baseline prediction module, a residual learning module, a dynamic constraint and fusion calculation module, and a multi-dimensional output module.

[0082] In this embodiment, the data acquisition and standardization preprocessing module includes a data acquisition unit, a data storage unit, and a preprocessing calculation unit.

[0083] The data acquisition unit is used to collect raw blood collection and supply data from multiple sources, including blood collection records uploaded by blood collection station terminals and historical blood collection data stored in the blood station database. The collected content includes at least blood collection time, blood type, and blood collection volume, and the collected data is transmitted to the data storage unit. The data storage unit is used to store the raw blood collection and supply data and subsequent processing data. Specifically, it adopts an expandable storage architecture to adapt to the rolling data update requirements. The preprocessing and calculation unit is used to call the raw data in the data storage unit and perform standardized processing such as field mapping and renaming, date format unification, and blood collection volume unit unification conversion. Then, it performs grouping and aggregation calculations by date, blood station, and blood collection volume, fills missing values ​​in date time sequence, and outputs continuous time-series blood volume data.

[0084] In this embodiment, the feature engineering module includes a temporal feature operation unit, an exogenous feature fusion unit, and a feature matrix generation unit.

[0085] The temporal feature processing unit receives continuous temporal blood volume data and constructs multi-scale temporal dynamic features based on the target prediction period, including historical window sums, lags, rolling statistics, and differential volatility. The exogenous feature fusion unit connects to meteorological and calendar databases, extracts meteorological features and calendar context features corresponding to the target prediction period, and completes feature standardization and dimension alignment. The feature matrix generation unit concatenates the temporal features and exogenous features according to the sample dimensions to generate an initial feature matrix that matches the length of the current target prediction period.

[0086] In this embodiment, the baseline prediction module includes a dataset partitioning and validation unit, a K-fold cross-validation unit, an XGBoost training unit, an OOF stitching unit, and a full fitting unit.

[0087] The dataset partitioning and validation unit strictly divides the rolling training and test sets according to the chronological order, controlling the test set to be samples from the later part of the time series and matching its length with the current target prediction period length. It also verifies the temporal continuity of the training and test sets to prevent future information leakage and outputs compliant rolling training and test sets. The K-fold cross-validation unit divides the training set into a preset number of time series folds, and then further divides each fold into training and validation subsets, with each validation subset representing the later part of the training subset. The XGBoost training unit trains the XGBoost model based on each fold's training subset, using preset hyperparameter configurations. After each fold's training, it performs predictions on the corresponding validation set. The OOF concatenation unit concatenates the prediction results from each fold's validation set according to the original chronological order of the training set, generating an OOF-fold out-of-fold generalization baseline unbiased prediction value covering the entire training set. The full-scale fitting unit keeps the XGBoost model hyperparameters unchanged, uses the full training set to fit the finalized XGBoost baseline model, performs forward inference calculations on the test set, and outputs the baseline prediction value for the target prediction period.

[0088] In this embodiment, the residual learning module includes a residual calculation unit, an LSTM training unit, and a residual inference unit.

[0089] The residual calculation unit receives the OOF out-of-flush generalization baseline prediction value and the actual blood collection volume of the training set, calculates the difference between the two for each sample, and constructs a residual sequence; the LSTM training unit uses time-series samples with fused features as input to train a unidirectional LSTM residual model, and adopts gradient pruning and Dropout regularization strategies to ensure training stability; the residual inference unit inputs the time-series samples of the test set into the trained LSTM model, performs residual prediction, and outputs the residual prediction value for the future target prediction period.

[0090] In this embodiment, the dynamic constraint and fusion calculation module includes a dynamic constraint unit and a linear fusion unit.

[0091] The dynamic constraint unit applies an adaptive dynamic amplitude constraint to the residual prediction value that matches the target prediction period to suppress extreme overshoot; the linear fusion unit performs linear superposition and fusion of the constrained residual correction value and the baseline prediction value to obtain the adaptive fusion prediction result of the daily blood collection volume. In this embodiment, the multi-dimensional output module is used to output multi-dimensional prediction results including the baseline prediction value of the target prediction period, the fused prediction value of the unconstrained residual, and the adaptive fused prediction value. It can also support docking with the blood station scheduling system or visualization server to enable the business side to directly apply and refer to the prediction results.

[0092] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for predicting daily blood collection volume based on residual learning and fusion, characterized in that, The method includes the following steps: S1. Collect raw blood collection and supply data, including blood collection time, blood collection volume, and blood type, using the blood bank's historical blood collection ledger. Perform field mapping, format unification, and blood collection volume unit conversion processing on the raw blood collection and supply data to obtain standardized basic data. S2. The standardized basic data are grouped and aggregated according to the three dimensions of date, blood station, and blood collection volume to generate a daily blood volume table for each blood station in the corresponding region. The continuous date sequence from the minimum date to the maximum date within the sample period is supplemented for each group of data and missing values ​​are filled to obtain continuous time series blood volume data that is adapted to prediction of different period lengths. S3. Based on continuous time-series blood volume data, construct time-series dynamic statistical features including historical window sum, lag features, rolling mean, and rolling standard deviation. At the same time, integrate exogenous context features from meteorology and calendar to generate an initial feature matrix for model training and testing. S4. Based on the initial feature matrix, divide the training set and test set into rolling sets according to the time sequence. The test set consists of samples from the later part of the time series, and the length of the test set matches the length of the target prediction period. S5. The XGBoost baseline model is trained using a time-series incremental K-fold cross-validation strategy. Based on the time-series validation set of each fold, the OOF out-of-fold generalization baseline unbiased prediction value corresponding to the training set is generated. Then, the final XGBoost baseline model for the target prediction period is fitted using the full training set. The test set is input into the model for inference to obtain the baseline prediction value for the target prediction period. S6. Based on the actual blood volume of samples and the corresponding unbiased predicted values ​​of continuous time-series blood volume data, construct residual sequences and residual lag features. Among them, perform quantile extreme value pruning on the residuals during the training period to remove extreme noise interference. S7. The time series input sample is constructed by integrating residual lag features, baseline predicted values ​​of the target prediction period, and exogenous context features. The LSTM model is used to complete the time series learning of the residual sequence and the residual prediction of the future period based on the lookback window of the target prediction period length. S8. Apply adaptive dynamic amplitude constraints to the residual prediction values ​​to obtain residual correction values. Linearly fuse the constrained residual correction values ​​with the baseline prediction values ​​of the target prediction period to obtain the adaptive fusion prediction values ​​of the daily blood collection volume of the target prediction period. S9. Output multi-dimensional prediction results including baseline predictions, fused predictions of unconstrained residuals, and adaptive fused predictions.

2. The method for predicting daily blood collection volume based on residual learning and fusion according to claim 1, characterized in that, The dynamic constraint mechanism for applying adaptive dynamic magnitude constraints to the residual prediction value in step S8 is to dynamically calculate the upper and lower limits of the correction magnitude based on the statistical characteristics of historical residuals. The upper limit of the dynamic constraint range for residual correction magnitude is determined by the formula. Calculate the output value; The lower limit of the dynamic constraint range for residual correction magnitude is determined by the formula. Calculate the output value; in, μ res This is the moving average of the historical residuals. σ res The moving standard deviation of the historical residuals. k Horizon is the dynamic coefficient, and Horizon is the prediction step size; the initial value of the dynamic coefficient is set to 2.5, and it is dynamically adjusted according to stability.

3. The method for predicting daily blood collection volume based on residual learning and fusion according to claim 2, characterized in that, The dynamic adjustment mechanism of the dynamic coefficients is triggered by abrupt changes in the statistical characteristics of the residual standard deviation change rate, residual distribution skewness, business events, or model performance deterioration. The dynamic adjustment method is confirmed by calculating the product of the initial value's dynamic coefficient and the volatility correction degree, event coefficient, and performance degradation coefficient. Among them, the volatility correction degree, event coefficient, and performance degradation coefficient correspond to statistical characteristic mutations, business event-driven events, and model performance deterioration, respectively. Untriggered conditions do not participate in the dynamic adjustment calculation.

4. The method for predicting daily blood collection volume based on residual learning and fusion according to claim 3, characterized in that, The business events include meteorological events, periodic events, and seasonal events triggered by exogenous context features, as well as actively tagged or input social activity events and public health events; Business events are categorized into negative impact events, positive impact events, and neutral impact events based on their direction of influence on blood collection trends. For events with negative impact, the residual constraints need to be tightened to avoid over-reliance on future information, and the event coefficient should be less than 1; for events with positive impact, the constraints need to be relaxed to capture sudden upward fluctuations, and the event coefficient should be greater than 1; for events with neutral impact, the blood collection trend is weakly disturbed, and the event coefficient should be 1 to maintain a stable balance.

5. The method for predicting daily blood collection volume based on residual learning and fusion according to claim 4, characterized in that, Based on the nature of events, their impact mechanisms, and their occurrence patterns, meteorological events are further subdivided and labeled as follows: low temperatures below 17℃, normal temperatures between 18-25℃, high temperatures between 26-35℃, extreme high temperatures above 35℃, and rainfall events; periodic events are further subdivided and labeled as weekends and weekdays; and seasonal events are further subdivided and labeled as summer months, winter months, long holidays, and short holidays. Furthermore, the event coefficient is set as follows: low temperature 1.1, normal temperature 1, high temperature 0.95, extreme high temperature 0.85, rainfall 0.9, weekend 1, summer month 0.9, winter month 1.1, long holiday 1.2, and short holiday 1.

15. 6.The method of claim 5, wherein, When at least two sub-business events occur simultaneously, the superimposed business events will form a positive superposition, a neutral superposition, or a negative superposition based on the differences in the direction and intensity of the impact of each sub-business event. The superimposed event coefficient is obtained by setting a comprehensive weight for each subdivided business event according to its frequency, scope of influence, and intensity of influence, and then multiplying the original event coefficient of the subdivided business event with its comprehensive weight, and then multiplying the result with other subdivided business events that occur at the same time.

7. The method for predicting daily blood collection volume based on residual learning and fusion according to claim 6, characterized in that, The overall weights set for each sub-business event are as follows: extreme high temperature event 0.6, high temperature event 0.6, low temperature event 0.52, long holiday event 0.62, short holiday event 0.48, summer month 0.51, winter month 0.57, social event 0.46, public health event 0.47, and weekend event 0.

61.

8. The method for predicting daily blood collection volume based on residual learning and fusion according to claim 6, characterized in that, The target forecast period is divided into short-term forecasts of less than 7 days, medium-term forecasts of 7 to 30 days, and long-term forecasts of more than 30 days, based on 7 days and 30 days as nodes. Among them, short-term forecasts apply to meteorological events and weekend events, and are adjusted using preset event coefficients; medium-term forecasts apply to meteorological events, weekend events, short holiday events, and social event events, and are calculated using weighted superposition of event coefficients; long-term forecasts apply to seasonal events and public health events, and are calculated using weighted superposition of events over a period longer than the target forecast period or using historical event coefficients for the same period. 9.The method of claim 3, wherein, The exit conditions for the dynamic adjustment of the dynamic coefficient include natural exit when the impact of the event subsides, forced exit when the blood inventory warning is triggered for two consecutive days, and gradual exit when the model performance recovers to the historical level; when the exit condition is triggered, the dynamic coefficient is restored to the initial value of 2.

5.

10. A blood collection and supply daily blood volume prediction system based on residual learning and fusion, characterized in that, The system is used to implement the daily blood collection volume prediction method based on residual learning and fusion as described in any one of claims 1 to 9, the system comprising: The data acquisition and standardization preprocessing module includes a data acquisition unit, a data storage unit, and a preprocessing calculation unit. The data acquisition unit is used to acquire raw blood collection and supply data and transmit it to the data storage unit. The data storage unit is used to store the raw blood collection and supply data and subsequent processing data. The preprocessing calculation unit is used to perform standardization processing, grouping and aggregation calculations, and output continuous time-series blood volume data. The feature engineering module includes a time-series feature processing unit, an exogenous feature fusion unit, and a feature matrix generation unit. The time-series feature processing unit constructs time-series dynamic features based on continuous time-series blood volume data. The exogenous feature fusion unit interfaces with meteorological and calendar databases to extract and standardize exogenous features. The feature matrix generation unit is used to concatenate time-series features and exogenous features to generate an initial feature matrix. The baseline prediction module includes a dataset partitioning and validation unit, a K-fold cross-validation unit, an XGBoost training unit, an OOF concatenation unit, and a full-scale fitting unit. The dataset partitioning and validation unit partitions the training set and test set sequentially, simultaneously verifying temporal continuity to prevent future information leakage. The K-fold cross-validation unit partitions the training set into multiple folds and then divides them into training and validation subsets. The XGBoost training unit trains the model fold by fold and performs predictions on the validation set. The OOF concatenation unit concatenates the prediction results from each fold of the validation set to generate the OOF-fold out-of-fold generalization baseline unbiased prediction value for the entire training set. The full-scale fitting unit uses the entire training set to fit the final XGBoost baseline model and performs inference on the test set, outputting the baseline prediction value for the target prediction period. The residual learning module includes a residual calculation unit, an LSTM training unit, and a residual inference unit. The residual calculation unit constructs a residual sequence based on unbiased baseline predictions and the actual blood collection volume of the sample. The LSTM training unit trains the residual model using time-series sample inputs with fused features. The residual inference unit performs residual prediction on the test set. The dynamic constraint and fusion calculation module includes a dynamic constraint unit and a linear fusion unit; the dynamic constraint unit applies adaptive dynamic magnitude constraints to the residual prediction values; the linear fusion unit fuses the residual correction values ​​and the baseline prediction values. The multi-dimensional output module is used to output multi-dimensional prediction results that include baseline predictions, fused predictions of unconstrained residuals, and adaptive fused predictions.

Citation Information

Patent Citations

  • Glucose concentration prediction method based on model fusion and related equipment

    CN115394440A

  • Power grid safety margin prediction and risk assessment method and system based on double-layer LSTM-XGBoost model

    CN120373860A