摘要
This study proposes a multi-task learning (MTL) model to predict the need for blood transfusion in patients with acute upper gastrointestinal bleeding (AUGIB), as well as to estimate the appropriate type and volume of transfusion. The proposed model demonstrates improved predictive performance over existing scoring systems and aims to support clinical decision-making in transfusion management. Clinical data were retrospectively collected from 1256 emergency patients with AUGIB admitted to the First Hospital of Shanxi Medical University from January 1, 2022, to December 31, 2023. An external validation cohort (n = 209) was sourced from Fenyang Hospital, Shanxi Province, using identical inclusion criteria. The MTL model integrates oversampling techniques and distribution correction to address data imbalance. A soft-voting ensemble of CatBoost and XGBoost classifiers was used for the classification task, while a stacked regressor combining random forest and XGBoost was employed for the regression task. Model performance was further optimized through a dynamically weighted loss function. In the classification task, the model achieved an area under the curve (AUC) of 0.965, representing a 20.5% improvement over the traditional Glasgow-Blatchford Score (GBS). In the regression task, the two-stage stacked regressor (TSR) outperformed other machine learning models in predicting transfusion type and volume , significantly reducing the prediction error of transfusion volume. Compared to random forest (RF), XGBoost, multilayer perceptron (MLP), and backpropagation neural network (BP), the model reduced the overall loss by 9.9%, 21.0%, 38.3%, and 10.0%, respectively, validating the advantages of hierarchical feature selection and dynamic task-weighting. In the external validation set, the model exhibited favorable generalization performance with an AUC of 0.860, and showed good performance in infusion volume prediction error and weighted loss This study presents a robust and interpretable multi-task learning model for transfusion decision-making in AUGIB. By jointly optimizing classification and regression tasks through hierarchical feature selection and dynamic loss allocation, the model supports precision transfusion strategies and holds strong potential for broader application in emergency and critical care settings.