Liver disease detection training method and system based on multi-cnn-former
By combining the Multi-Cnn-Former model with a multi-task learning mechanism, the problems of accuracy and multi-task detection in existing technologies for liver disease detection have been solved, enabling accurate prediction of hepatitis and liver fibrosis grades, and improving the accuracy and efficiency of medical testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JIANGSU TAIZHOU PEOPLES HOSPITAL
- Filing Date
- 2021-12-07
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies are insufficient for accurately detecting the severity of various liver diseases, such as hepatitis B and liver fibrosis, and it is difficult to use a single model to detect multiple liver diseases.
The Multi-Cnn-Former model, combined with a multi-task learning mechanism, is used to predict the grades of hepatitis and liver fibrosis as sub-tasks. The model is trained using the Multi-Cnn-Former model, and features are extracted using one-dimensional convolutional layers. The loss values are weighted and backpropagated using the ProbSpare self-attention mechanism and voting method to construct a multi-task loss to improve the model's generalization ability and accuracy.
It enables accurate detection of various liver diseases, improves medical quality and service efficiency, avoids local optima traps and overfitting risks, and enhances the applicability and accuracy of the model.
Smart Images

Figure CN114300119B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of multi-task deep learning and medicine, and relates to a training method and system for liver disease detection based on Multi-Cnn-Former. Background Technology
[0002] Current methods struggle to accurately detect the severity level (S0-S5) of various liver diseases, including hepatitis B and liver fibrosis, and it's also difficult to implement a single model for detecting multiple liver diseases. Therefore, it's essential to develop an efficient deep learning algorithm to assist in detection.
[0003] Multi-task learning, a popular concept in recent years, has yielded advantages across various fields. Combining it with Transformer-based models, in liver fibrosis detection, can predict the degree of liver fibrosis in patients. The learning of multiple tasks complements each other, with each sub-task serving as its primary task while other tasks are treated as auxiliary tasks. When learning a sub-task, unrelated parts are essentially added as noise, which enhances the model's generalization ability, thereby improving the performance of each sub-task. This invention provides a novel algorithm, Multi-Cnn-Former, and applies it to the field of liver disease detection, aiming to improve medical quality and service efficiency, and contribute to the interdisciplinary integration of medicine and artificial intelligence. Summary of the Invention
[0004] Purpose of the invention: To address the shortcomings of existing technologies, the purpose of this invention is to propose a training method and system for liver disease detection based on Multi-Cnn-Former, applying the new Multi-Cnn-Former algorithm model to the field of liver disease detection, enabling the detection of multiple liver diseases through a single model, thereby improving medical quality and service efficiency.
[0005] Technical solution: To achieve the above-mentioned objectives, the present invention adopts the following technical solution:
[0006] The training method for liver disease detection based on Multi-Cnn-Former includes the following steps:
[0007] Step 1: Obtain patient medical record information and perform preprocessing and filtering to obtain a dataset of biochemical and physiological descriptive features for Multi-Cnn-Former model learning;
[0008] Step 2: Construct a Multi-CNN-Former model, which includes multiple sub-task models. The input of each sub-task model is connected to the same CNN convolutional module, and the input of the CNN convolutional module is the features in the dataset. The sub-task model is based on the existing Informer model, but the outermost word embedding layer and relative position encoding layer are removed. The output of the CNN convolutional module is connected to the ProbSpare self-attention layer of the sub-task model. The multiple sub-task models include sub-tasks for identifying different stages of hepatitis and liver fibrosis in patients, and each sub-task model outputs the corresponding disease probability.
[0009] Step 3: Input the data from the training dataset into the Multi-Cnn-Former model for training. The loss values of all sub-tasks are weighted and summed to obtain the total loss. The model is then iteratively trained through backpropagation to finally obtain the trained liver disease detection model. For the sub-task of liver fibrosis staging detection, a voting method is used to determine the disease stage. Further, the preprocessing in Step 1 includes: imputation, standardization, and anomaly correction of the original biochemical feature information of the patient's medical records; entity extraction and conversion into numerical data from the original physiological description information of the patient's medical records, and labeling of categories or levels.
[0010] Further, in step 1, the preprocessed biochemical and physiological descriptive features are screened using feature correlation coefficients and feature analysis engineering. The biochemical features ultimately used for model learning include G value, S value, alanine aminotransferase (ALT), aspartate aminotransferase (AST), AST / ALT ratio, alkaline phosphatase, gamma-glutamyl transferase (GGT), total bile acids, prealbumin, cholinesterase, α-fucosidase, lactate dehydrogenase, blood urea nitrogen, creatinine, uric acid, β-microglobulin, cystatin C, glucose, total cholesterol, triglycerides, high-density cholesterol, low-density cholesterol, alpha-fetoprotein (AFP), type III procollagen (PIIINP), type IV collagen, laminin, hyaluronic acid, erythrocytes, hemoglobin, leukocytes, neutrophils, lymphocytes, platelets, and prothrombin time. Physiological descriptive features include age, sex, history of alcoholism, presence of other liver diseases, and perceived pain level.
[0011] Furthermore, the sub-task models include S0, S1, S2, S3, S4, S5, G0, and G1, where S0-S5 correspond to different stages of predicting liver fibrosis, and G0 and G1 correspond to predicting hepatitis.
[0012] Furthermore, the loss values of the sub-tasks are summed using an average weighting method.
[0013] Furthermore, the specific strategy of the voting method is as follows: when the left and right probabilities of the stage with the highest probability are the second highest probabilities, the stage with the highest probability is regarded as the disease stage; when the stage with the second highest probability of the stage with the highest probability predicted by the model is not adjacent to the stage with the highest probability, it is regarded as an abnormal prediction, and the abnormal prediction result is pushed to the experts.
[0014] Based on the same inventive concept, this invention provides a liver disease detection and training system based on Multi-CNN-Former, comprising a feature extraction module, a model building module, and a model training module. The feature extraction module is used to acquire patient medical record information and perform preprocessing and filtering to obtain a dataset of biochemical and physiological descriptive features for Multi-CNN-Former model learning. The model building module is used to construct a Multi-CNN-Former model, which includes multiple sub-task models. The input of each sub-task model is connected to the same CNN convolutional module, and the input of the CNN convolutional module is the features from the dataset. Each sub-task model, based on the existing Informer model, removes the outermost word embedding layer and the relative position encoding layer. The output of the CNN convolutional module is connected to the ProbSpare function of the sub-task model. In the self-attention layer, the multiple sub-task models include sub-tasks for identifying different stages of hepatitis and liver fibrosis in patients, with each sub-task model outputting a corresponding disease probability. The model training module is used to input data from the training dataset into the Multi-Cnn-Former model for training, weighted summation of the loss values of all sub-tasks to obtain the total loss, and iterative training of the model through backpropagation to finally obtain a trained liver disease detection model. For the sub-task of liver fibrosis staging detection, a voting method is used to determine the disease stage. Based on the same inventive concept, the liver disease detection system based on Multi-Cnn-Former provided by this invention includes various modules of the training system and a detection module. The detection module is used to input the patient's biochemical characteristics and physiological description characteristics into the trained liver disease detection model to obtain the detection results of hepatitis and liver fibrosis staging.
[0015] Based on the same inventive concept, the present invention provides a computer system including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded onto the processor, it implements a training method or a method for detecting liver diseases based on Multi-Cnn-Former.
[0016] Beneficial Effects: The Multi-Cnn-Former proposed in this invention is an improved LSTF (Long Sequence Time Series) prediction model based on Informer. Compared with the traditional Informer, this model has the following advantages: (1) Adding a one-dimensional convolutional layer to the outermost layer of the model allows the model to quickly extract features after the training set is input into the network, and converge faster; (2) When different stages of liver fibrosis subtasks are learned together, there are related parts and unrelated parts. When learning a subtask, the unrelated parts are equivalent to adding some noise, which can improve the generalization ability of the model; (3) Single-task learning is prone to getting stuck in local optima, while in multi-task learning, the local optima of different tasks are in different positions. Through interaction, they can escape local optima; (4) On the one-dimensional convolutional layer, different subtasks share hard parameters in the convolutional layer, thereby reducing the risk of overfitting and the Rademacher complexity of the model; (5) The model has high scalability and compatibility, so that the model is no longer limited to solving one task. After fine-tuning, it can be compatible with other related tasks. This invention is the first to apply a multi-task mechanism to the Informer model and improves upon it, effectively avoiding the shortcomings of traditional models that can only perform single-task predictions and therefore cannot accurately stage diseases. While ensuring accuracy, it provides disease staging prediction functionality. This invention keeps pace with the forefront of technological development, introducing a multi-task learning mechanism into the Informer model to achieve effective liver disease prediction and contribute to the new development of AI in healthcare. Attached Figure Description
[0017] Figure 1 This is a flowchart of a method according to an embodiment of the present invention;
[0018] Figure 2 This is a Loss-weighted backpropagation graph in an embodiment of the present invention;
[0019] Figure 3 This is a diagram of the Multi-Cnn-Former network structure in an embodiment of the present invention. Detailed Implementation
[0020] The technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0021] like Figure 1 As shown in the figure, an embodiment of the present invention discloses a training method for liver disease detection based on an improved Multi-Cnn-Former, which includes the following steps:
[0022] Step 1: Dataset Construction. This step involves acquiring patient medical record information and performing preprocessing and filtering to obtain a dataset of biochemical and physiological descriptive features for the Multi-Cnn-Former model; specifically including:
[0023] Step 1.1: Obtain the patient's electronic medical record, including raw biochemical characteristics and physiological descriptions, and organize it into a CSV format data sample table;
[0024] Step 1.2: Perform missing value completion, standardization, and anomaly correction on the above-mentioned raw biochemical characteristic information, and extract custom entities from the physiological description information and convert them into numerical values; specifically as follows:
[0025] Biochemical characteristic information preprocessing:
[0026] Missing values are handled for all attributes of the obtained data sample. The mean imputation method is used for the main fields. If the field can be measured by a constant, the mean of the valid values of the attribute is used to imput missing values. If the attribute is measured by a numerical rank, the mode of the valid values of the attribute is used to imput missing values.
[0027] The data is standardized using the Z-Score standardization method. The processed data conforms to a standard normal distribution, thereby eliminating errors caused by different units.
[0028] Anomaly detection is performed based on Cook's Distance. According to Cook's principle, each sample should have a balanced impact on the model parameters. If a sample has too large an impact on the model parameters, it is considered an outlier and anomaly correction is performed.
[0029] Physiological description information preprocessing:
[0030] For medical records, such as doctor's orders and descriptions of symptoms, custom entity extraction is performed using the Lac network to obtain information such as "whether there is alcoholism" and "whether there has been stinging sensation". The features are then processed into data. For example, 0 / 1 is used to distinguish between no alcoholism and alcoholism, and 1 to 12 are used to mark the pain level. The extracted pathological information is further transformed into data features.
[0031] Step 1.3: Draw the Feature Importance Plot. Based on the influence of features on the classification label in the plot, filter features, remove meaningless features, and retain effective features.
[0032] Step 1.4: Calculate the correlation coefficients of all features based on the Spearman correlation coefficient, and plot the results as a heatmap to verify the effectiveness of the features selected in Step 1.3. If inconsistencies are found, expert analysis is performed on the feature to determine whether it is considered a valid feature. Specifically, in this embodiment, Pycaret is used for feature engineering analysis to create a Feature Importance Plot. Features are adjusted according to their influence weights to complete the feature selection process. The final features used for model learning are shown in the table below:
[0033] Table 1: Relevant Characteristics for Liver Disease Detection
[0034]
[0035]
[0036] Step 2: Model Construction. This invention uses Multi-CNN-Former to construct the model. Multi-CNN-Former is an improvement on the Informer model, including multiple sub-task models: S0, S1, S2, S3, S4, S5, G0, and G1. Task G represents hepatitis, task S represents liver fibrosis, G0 and S0 represent hepatitis and liver fibrosis without disease, respectively, G1 represents hepatitis, and S1-S5 represent different stages of liver fibrosis. Each sub-task model, based on the existing Informer, removes the outermost word embedding layer and relative position encoding layer, allowing the Informer network layer to accept pathological features. Next, a one-dimensional convolutional layer is embedded in the outermost layer. The input of the training set is first fed into the one-dimensional CNN convolution, and the result is added to the multi-task ProbSpareself-attention layer. After passing through the encoding and decoding layers, the final SoftPlus activation function is changed to the Softmax activation function to obtain the output results of different sub-tasks.
[0037] Traditional deep learning models have some serious shortcomings when dealing with long features, as follows:
[0038] 1. Traditional deep learning models use self-attention, which leads to secondary computational complexity. Due to the operation of the self-attention computation mechanism, the time complexity of our model is O(L*L), where L represents the length of the feature.
[0039] 2. When conducting liver disease detection, unlike multi-classification tasks, patients often fall between two staging criteria, and cannot be classified into either category I or category II. Therefore, through multi-task learning, the probability of patients having different liver diseases can be obtained, thereby better capturing the current status of patients.
[0040] 3. Model incompatibility: As a model in the field of natural language processing, the Informer model is not well-suited for medical deep learning prediction tasks. Some adaptation and improvement are needed to apply it to medical deep learning prediction.
[0041] 4. The model carries the risk of overfitting.
[0042] To address these issues, this invention proposes a Multi-CNN-Former multi-task learning model based on the traditional Informer model. The improved model structure is shown in the diagram below. Figure 3 As shown. Improvements include:
[0043] 1. A self-attention mechanism is used instead of the traditional self-attention mechanism, resulting in better performance in sequence dependency alignment. A self-attention distillation mechanism is employed to shorten the input feature length of each layer, thereby reducing computational and space complexity, and thus facilitating subsequent computations.
[0044] 2. Remove the outermost word embedding layer and relative position encoding layer, and change the activation function of the last layer from Softplus to SoftMax layer, so that the CNN-former network layer can input pathological features. The original Informer network was used to solve problems in the field of natural language processing. The framework of the model needs to be modified to ensure that the model can be applied to this task.
[0045] 3. Adding a one-dimensional convolutional layer to the outermost layer of the network can enable the network to recognize the main features and accelerate the convergence speed of the model.
[0046] 4. The total loss of a multi-task task is a weighted sum of the losses of its subtasks. The parameters are then backpropagated through the total loss.
[0047] 5. A multi-task mechanism is introduced to prevent overfitting and to detect liver diseases, thereby better capturing the current state of the patient's condition.
[0048] Step 3: Model Training. The data from the training dataset is input into the Multi-Cnn-Former model for training. The losses of all subtasks are averaged and weighted to form the total loss. Backpropagation is then performed using this total loss to iterate the parameters, ultimately obtaining a trained liver disease detection model. Once trained, the model can simultaneously predict hepatitis and liver fibrosis, as well as their stages. For liver fibrosis prediction, after obtaining the probabilities of different stages, a voting method is used to determine the patient's liver disease stage. Specifically, the voting method mentioned in this step is:
[0049] Subtasks S0, S1, S2, S3, S4, and S5 predict the probability of each subtask and then use a voting strategy to classify the disease into stages. Specifically, the strategy is as follows: when the stage with the highest probability is flanked by the next highest probability stage, the stage with the highest probability is considered the disease stage. If the next highest probability stage predicted by the model is not adjacent to the stage with the highest probability, it is considered an abnormal prediction. This abnormal prediction is then sent to experts for review, and the final prediction is given after expert evaluation.
[0050] After the model training is complete, the extracted biochemical and physiological characteristics of the patients are input into the trained model to make predictions. For each task, the result with the highest probability is selected. For example, patient A may have both viral hepatitis and liver fibrosis, and the possible output results are G1 and S3 (liver fibrosis stage); patient B may only have liver fibrosis, and the possible output results are G0 and S1 (liver fibrosis stage).
[0051] Based on the same inventive concept, the liver disease detection training system based on Multi-Cnn-Former provided in this embodiment of the invention includes a feature extraction module, a model building module, and a model training module. The feature extraction module is used to acquire patient medical record information and perform preprocessing and filtering to obtain a dataset of biochemical and physiological descriptive features for Multi-Cnn-Former model learning. The model building module is used to construct the Multi-Cnn-Former model. The model training module is used to input data from the training dataset into the Multi-Cnn-Former model for training, weighted summation of the loss values of all sub-tasks to obtain the total loss, iteratively training the model through backpropagation, and finally obtaining a trained liver disease detection model. For the sub-task of liver fibrosis staging detection, a voting method is used to determine the disease stage. The specific implementation of each module is as described in the above method embodiment and will not be repeated here.
[0052] Based on the same inventive concept, the liver disease detection system based on Multi-Cnn-Former provided in this embodiment of the invention includes various modules of a training system and a detection module; the detection module is used to input the patient's biochemical characteristics and physiological description characteristics into the trained liver disease detection model to obtain the detection results of hepatitis and liver fibrosis staging.
[0053] Based on the same inventive concept, the present invention provides a computer system including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded onto the processor, it implements a training method or a method for detecting liver diseases based on Multi-Cnn-Former.
Claims
1. A training method for liver disease detection based on Multi-Cnn-Former, characterized by: Includes the following steps: Step 1: Obtain patient medical record information and perform preprocessing and filtering to obtain a dataset of biochemical and physiological descriptive features for Multi-Cnn-Former model learning; Step 2: Construct a Multi-CNN-Former model, which includes multiple sub-task models. The input of each sub-task model is connected to the same CNN convolutional module, and the input of the CNN convolutional module is the features in the dataset. The sub-task model is based on the existing Informer model, but the outermost word embedding layer and relative position encoding layer are removed. The output of the CNN convolutional module is connected to the ProbSparse self-attention layer of the sub-task model. The multiple sub-task models include sub-tasks for identifying different stages of hepatitis and liver fibrosis in patients, and each sub-task model outputs the corresponding disease probability. Step 3: Input the data from the training dataset into the Multi-Cnn-Former model for training. Sum the loss values of all sub-tasks with weights to obtain the total loss. Iterate the model through backpropagation to finally obtain the trained liver disease detection model. For the sub-task of liver fibrosis staging detection, a voting method is used to determine the disease stage.
2. The training method for liver disease detection based on Multi-Cnn-Former according to claim 1, characterized in that: The preprocessing in step 1 includes: filling gaps, standardizing and correcting anomalies in the original biochemical characteristic information of the patient's medical records; extracting entities from the original physiological description information of the patient's medical records and converting it into numerical data, and labeling it with categories or levels.
3. The training method for liver disease detection based on Multi-Cnn-Former according to claim 1, characterized in that: In step 1, the preprocessed biochemical and physiological descriptive features are screened using feature correlation coefficients and feature analysis engineering. The biochemical features ultimately used for model learning include G value, S value, alanine aminotransferase (ALT), aspartate aminotransferase (AST), AST / ALT ratio, alkaline phosphatase, gamma-glutamyl transferase (GGT), total bile acids, prealbumin, cholinesterase, α-fucosidase, lactate dehydrogenase, blood urea nitrogen, creatinine, uric acid, β-microglobulin, cystatin C, glucose, total cholesterol, triglycerides, high-density lipoprotein (HDL) cholesterol, low-density lipoprotein (LDL) cholesterol, alpha-fetoprotein (AFP), type III procollagen (PIIINP), type IV collagen, laminin, hyaluronic acid, erythrocytes, hemoglobin, leukocytes, neutrophils, lymphocytes, platelets, and prothrombin time. Physiological descriptive features include age, sex, history of alcoholism, presence of other liver diseases, and perceived pain level.
4. The training method for liver disease detection based on Multi-Cnn-Former according to claim 1, characterized in that: The sub-task models are S0, S1, S2, S3, S4, S5, G0, and G1, where S0-S5 correspond to different stages of predicting liver fibrosis, and G0 and G1 correspond to predicting hepatitis.
5. The training method for liver disease detection based on Multi-Cnn-Former according to claim 1, characterized in that: The loss values of the sub-tasks are summed using an average weighting method.
6. The training method for liver disease detection based on Multi-Cnn-Former according to claim 1, characterized in that: The specific strategy of the voting method is as follows: when the probability of the next stage to the left of the stage with the highest probability is the second highest probability, the stage with the highest probability is regarded as the disease stage; when the stage with the second highest probability predicted by the model is not adjacent to the stage with the highest probability, it is regarded as an abnormal prediction, and the abnormal prediction result is pushed to the experts.
7. A liver disease detection training system based on Multi-CNN-Former, characterized in that: It includes a feature extraction module, a model building module, and a model training module; The feature extraction module is used to acquire patient medical record-related information and perform preprocessing and filtering to obtain a dataset of biochemical and physiological descriptive features for learning the Multi-Cnn-Former model; The model building module is used to construct a Multi-CNN-Former model, which includes multiple sub-task models. The input of each sub-task model is connected to the same CNN convolutional module, and the input of the CNN convolutional module is the features in the dataset. The sub-task models are based on the existing Informer model, but the outermost word embedding layer and relative position encoding layer are removed. The output of the CNN convolutional module is connected to the ProbSparse self-attention layer of the sub-task model. The multiple sub-task models include sub-tasks for identifying different stages of hepatitis and liver fibrosis in patients, and each sub-task model outputs the corresponding disease probability. The model training module is used to input data from the training dataset into the Multi-Cnn-Former model for training, sum the weighted loss values of all sub-tasks to obtain the total loss, and iteratively train the model through backpropagation to finally obtain a trained liver disease detection model; for the sub-task of liver fibrosis staging detection, a voting method is used to determine the disease stage.
8. A liver disease detection system based on Multi-CNN-Former, characterized in that: It includes the various modules of the training system according to claim 7 and a detection module; the detection module is used to input the patient's biochemical characteristics and physiological description characteristics into the trained liver disease detection model to obtain the detection results of hepatitis and liver fibrosis staging.
9. A computer system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is loaded into the processor, it implements the Multi-Cnn-Former-based liver disease detection training method according to any one of claims 1-6.
10. A computer system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is loaded into the processor, it performs the following steps: Step 1: Obtain patient medical record information and perform preprocessing and filtering to obtain a dataset of biochemical and physiological descriptive features for Multi-Cnn-Former model learning; Step 2: Construct a Multi-CNN-Former model, which includes multiple sub-task models. The input of each sub-task model is connected to the same CNN convolutional module, and the input of the CNN convolutional module is the features in the dataset. The sub-task model is based on the existing Informer model, but the outermost word embedding layer and relative position encoding layer are removed. The output of the CNN convolutional module is connected to the ProbSparse self-attention layer of the sub-task model. The multiple sub-task models include sub-tasks for identifying different stages of hepatitis and liver fibrosis in patients, and each sub-task model outputs the corresponding disease probability. Step 3: Input the data from the training dataset into the Multi-Cnn-Former model for training. Sum the loss values of all sub-tasks with weights to obtain the total loss. Iterate the model through backpropagation to finally obtain the trained liver disease detection model. For the sub-task of liver fibrosis staging detection, a voting method is used to determine the disease stage. Step 4: Input the patient's biochemical and physiological characteristics into the trained liver disease detection model to obtain the detection results of hepatitis and liver fibrosis staging.