A disease classification method, device and medium

By preprocessing and enhancing medical text data, constructing heterogeneous graphs and performing hierarchical attention training, the problems of data imbalance and multi-source heterogeneous data modeling in medical text analysis are solved, achieving efficient disease classification and interpretable results.

CN120994837BActive Publication Date: 2026-01-27XIANGYA HOSPITAL CENT SOUTH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511509626.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2026-01-27
Estimated Expiration
2045-10-22

AI Technical Summary

Technical Problem

Existing technologies in medical text analysis suffer from problems such as data imbalance, lack of correlation modeling of multi-source heterogeneous data, difficulty in integrating medical expertise, and inconsistent labels, resulting in poor performance of traditional natural language processing technologies in disease classification.

Method used

By preprocessing and enhancing medical text data, a heterogeneous graph of patient nodes, symptom nodes, and disease nodes is constructed, and hierarchical attention training is performed. By combining data augmentation, heterogeneous graphs, and hierarchical attention training, disease classification is achieved.

Benefits of technology

It improves the accuracy and generalization ability of disease classification, and ensures the robustness and interpretability of classification results, especially in the classification of rare diseases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994837B_ABST
    Figure CN120994837B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of natural language processing, and particularly discloses a disease classification method and device and a medium, the method comprising the following steps: performing data preprocessing and data enhancement on a medical text data set to obtain medical text data; analyzing the medical text data to construct a heterogeneous graph comprising patient nodes, symptom nodes and disease nodes; performing hierarchical attention training on the heterogeneous graph in combination with the relationships among the patient nodes, the symptom nodes and the disease nodes to obtain a disease classification model; inputting patient node data in the heterogeneous graph into the disease classification model to output disease probability and complete disease classification. The method prevents data sparseness through data enhancement, realizes relationship modeling by constructing a heterogeneous graph of medical text, thereby preventing data fragmentation, and finally adopts hierarchical attention training to dynamically screen weights, ensures effective information transmission, and ensures the robustness and interpretability of the medical text classification result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, specifically to a disease classification method, device, and medium. Background Technology

[0002] Medical text analysis (such as electronic medical records and clinical diagnostic reports) has significant value in disease classification, risk prediction, and assisted diagnosis. However, medical text data presents challenges due to its unique characteristics, including data imbalance, lack of correlation modeling among multi-source heterogeneous data, difficulty in integrating medical expertise, and inconsistent labeling.

[0003] Existing technical solutions have limitations: 1) Traditional data augmentation methods cannot effectively augment data while preserving medical semantics; 2) Methods based on pre-trained language models (PLM) only process independent texts and cannot model the dependencies between multiple patient records, resulting in insufficient utilization of physician knowledge (such as clinical guidelines) and uninterpretable decision-making processes; 3) Graph neural network-based methods (HGT) do not explicitly model the association between physician knowledge and text (such as symptom keyword matching), and their attention mechanisms have difficulty distinguishing the importance of different meta-paths (such as "examination items → disease" and "medication records → disease"); 4) Multimodal medical data analysis requires aligning multimodal data, which is highly complex to implement, and due to the limited disease coverage of knowledge graphs, it is difficult to generalize to new diseases.

[0004] In summary, there is an urgent need for a disease classification method, device, and medium to solve the problems in the existing technology. Summary of the Invention

[0005] The purpose of this invention is to provide a method, device, and medium for disease classification, the specific technical solution of which is as follows:

[0006] A disease classification method includes the following steps:

[0007] Step S1: Perform data preprocessing and data augmentation on the medical text dataset to obtain medical text data; the data augmentation expression is as follows:

[0008] ;

[0009] in, This indicates the enhanced medical text. This indicates a splicing operation. This indicates reverse translation. This indicates an expansion of the medical dictionary. This indicates the calculation of semantic similarity, used for filtering and enhancing text;

[0010] Step S2: Parse the medical text data and construct a heterogeneous graph including patient nodes, symptom nodes, and disease nodes;

[0011] Step S3: Combining the relationships between patient nodes, symptom nodes, and disease nodes, perform hierarchical attention training on the heterogeneous graph to obtain a disease classification model;

[0012] Step S4: Input the patient node data from the heterogeneous graph into the disease classification model, output the disease probability, and complete the disease classification.

[0013] Optionally, in step S1, data preprocessing includes data cleaning, text segmentation, and standardization.

[0014] Optionally, in step S2, the process of constructing the heterogeneous graph is as follows:

[0015] Define patient nodes, symptom nodes, and disease nodes. A patient node represents a patient, a symptom node represents the patient's clinical symptoms, and a disease node represents the final diagnosis.

[0016] Node initialization, obtaining the initial node embedding The expression is: ,in, Indicates medical text Perform BERT / ERNIE encoding;

[0017] The patient node is embedded, and the expression is: ,in, This indicates the embedding of the patient node. Indicates the number of symptoms. This indicates symptom embedding;

[0018] The process involves establishing connections between patient nodes and symptom nodes to represent the relationship between patients and related symptoms; establishing connections between symptom nodes and disease nodes to represent the relationship between symptoms and related diseases; and establishing connections between patient nodes and disease nodes to represent the relationship between patients and related diseases.

[0019] Optionally, in step S3, the hierarchical attention training includes a graph propagation process, which includes disease node propagation, symptom node propagation, and attention weight calculation.

[0020] Optionally, in step S3, the calculation expressions for disease node transmission and symptom node transmission are as follows:

[0021] ;

[0022] ;

[0023] in, This indicates the embedding of disease nodes after transmission. This indicates the embedding of symptom nodes after propagation. This indicates the embedding of pre-spreading symptom nodes. This indicates the embedding of disease nodes before transmission. This indicates that the patient node was de-embedded before transmission. Represents a non-linear activation function. , , Both represent learnable linear transformation matrices. , , Let each represent the set of neighbors of the patient node, disease node, and symptom node under the relation. s , d , p These represent patient nodes, disease nodes, and symptom nodes, respectively.

[0024] Optionally, in step S3, the attention weight calculation includes node-level attention calculation, relation-level attention calculation, and result aggregation calculation;

[0025] The expression for calculating node-level attention is as follows:

[0026] ;

[0027] in, Indicates the attention weights of the node layer. express function, express function, This represents a learnable linear transformation matrix. and These represent the target node representation and the neighbor node representation, respectively. Represents the attention parameter vector. Indicates matrix transpose;

[0028] The expression for calculating relational layer attention is as follows:

[0029] ;

[0030] in, Indicates the attention weights of the relationship layer. Represents the query vector. This represents a learnable linear transformation matrix. Represents the set of all relations. Indicates a relationship;

[0031] The expression for the aggregate calculation is as follows:

[0032] ;

[0033] in, This represents the updated node representation. Represents a node In relation The set of neighbors below.

[0034] Optionally, in step S3, the hierarchical attention training also includes classification and consistency optimization, where the total loss includes classification loss and consistency loss, calculated as follows:

[0035] ;

[0036] ;

[0037] ;

[0038] in, Indicates the total loss; The classification loss is expressed using cross-entropy. The consistency loss is represented by KL divergence.

[0039] In addition, the present invention also provides a disease classification device, comprising:

[0040] The data preprocessing and data augmentation module is used to perform data preprocessing and data augmentation on medical text data.

[0041] The heterogeneous graph construction module is used to parse medical text data and construct a heterogeneous graph including patient nodes, symptom nodes, and disease nodes.

[0042] The hierarchical attention training module is used to perform hierarchical attention training on heterogeneous graphs to obtain a disease classification model.

[0043] The disease classification module is used to input patient node data from the heterogeneous graph into the disease classification model, output disease probabilities, and complete disease classification.

[0044] In addition, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described disease classification method.

[0045] The application of the technical solution of the present invention has the following beneficial effects:

[0046] This invention's method achieves disease classification of medical texts through data augmentation, constructing heterogeneous graphs of medical texts, and hierarchical attention training. The method prevents sparsity through data augmentation, and then prevents data fragmentation by constructing heterogeneous graphs of medical texts to achieve relationship modeling. Finally, hierarchical attention training is used for dynamic weight selection to ensure effective information dissemination and prevent noise. This method employs a layered approach of data augmentation, constructing heterogeneous graphs of medical texts, and hierarchical attention training to achieve medical text classification, ensuring the robustness and interpretability of the medical text classification results.

[0047] In addition to the objectives, features, and advantages described above, the present invention has other objectives, features, and advantages. The invention will now be described in further detail with reference to the figures. Attached Figure Description

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

[0049] Figure 1 This is a flowchart of the steps of the disease classification method in a preferred embodiment of the present invention. Detailed Implementation

[0050] To enable those skilled in the art to better understand the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0051] Example:

[0052] like Figure 1 As shown, this embodiment provides a disease classification method, including the following steps (S1 to S4):

[0053] Step S1: Perform data preprocessing and data augmentation on the medical text dataset to obtain medical text data;

[0054] Specifically, data preprocessing includes data cleaning, text segmentation, and standardization, which are used to construct effective text corpora from medical text datasets.

[0055] Furthermore, in this embodiment, data cleaning specifically involves removing invalid data, which includes empty data, duplicate data, and invalid labels, wherein:

[0056] Empty data: refers to text fields that are empty, or that contain only spaces, newlines, and meaningless symbols (such as "-" " / "). The record of ").

[0057] Duplicate data: This refers to records under the same patient ID that have completely identical text content, visit time, and diagnosis label. Only one record should be kept, and the rest should be deleted.

[0058] Invalid labels include missing labels and incorrect labels. Missing labels, such as "patient complains of dizziness" without a diagnostic label, cannot be used as training samples and should be removed. Incorrectly labeled data, such as diagnostic labels not within the ICD-10 classification system, or containing abnormal characters or spelling errors, such as "heart failure ##", should be corrected or removed.

[0059] Furthermore, in this embodiment, text segmentation and standardization are performed using a word segmentation tool combined with a medical dictionary to ensure that medical terms are not mis-segmented. For example, "reduced left ventricular ejection fraction" is retained as a whole phrase.

[0060] In this embodiment, data augmentation is performed using reverse translation, medical dictionary expansion, and language model consistency constraints. The data augmentation expression is as follows:

[0061] ;

[0062] in, This indicates the enhanced medical text. This indicates a splicing operation. This indicates reverse translation. This indicates an expansion of the medical dictionary. This indicates the calculation of semantic similarity, used for filtering and enhancing text.

[0063] Step S2: Parse the medical text data and construct a heterogeneous graph including patient nodes, symptom nodes, and disease nodes.

[0064] Specifically, the process of constructing the heterogeneous graph in this embodiment is as follows:

[0065] Define patient nodes, symptom nodes, and disease nodes. A patient node represents a patient, a symptom node represents the patient's clinical symptoms, and a disease node represents the final diagnosis.

[0066] Node initialization, obtaining the initial node embedding The expression is: ,in, Indicates medical text Perform BERT / ERNIE encoding;

[0067] The patient node is embedded, and the expression is: ,in, This indicates the embedding of the patient node. Indicates the number of symptoms. This indicates symptom embedding;

[0068] The process involves establishing connections between patient nodes and symptom nodes to represent the relationship between patients and related symptoms; establishing connections between symptom nodes and disease nodes to represent the relationship between symptoms and related diseases; and establishing connections between patient nodes and disease nodes to represent the relationship between patients and related diseases.

[0069] Step S3: Combining the relationships between patient nodes, symptom nodes, and disease nodes, perform hierarchical attention training on the heterogeneous graph to obtain a disease classification model.

[0070] In this embodiment, the hierarchical attention training includes a graph propagation process, which includes disease node propagation, symptom node propagation, and attention weight calculation.

[0071] Specifically, the calculation expressions for disease node transmission and symptom node transmission are as follows:

[0072] ;

[0073] ;

[0074] in, This indicates the embedding of disease nodes after transmission. This indicates the embedding of symptom nodes after propagation. This indicates the embedding of pre-spreading symptom nodes. This indicates the embedding of disease nodes before transmission. This indicates that the patient node was de-embedded before transmission. Represents a non-linear activation function. , , Both represent learnable linear transformation matrices. , , Let each represent the set of neighbors of the patient node, disease node, and symptom node under the relation. s , d , p These represent patient nodes, disease nodes, and symptom nodes, respectively.

[0075] Furthermore, the attention weight calculation includes node-level attention calculation, relation-level attention calculation, and result aggregation calculation;

[0076] The expression for calculating node-level attention is as follows:

[0077] ;

[0078] in, Indicates the attention weights of the node layer. express function, express function, This represents a learnable linear transformation matrix. and These represent the target node representation and the neighbor node representation, respectively. Represents the attention parameter vector. Indicates matrix transpose;

[0079] The expression for calculating relational layer attention is as follows:

[0080] ;

[0081] in, Indicates the attention weights of the relationship layer. Represents the query vector. This represents a learnable linear transformation matrix. Represents the set of all relations. Indicates a relationship;

[0082] The expression for the aggregate calculation is as follows:

[0083] ;

[0084] in, This represents the updated node representation. Represents a node In relation The set of neighbors below.

[0085] In this embodiment, hierarchical attention training further includes classification and consistency optimization, wherein the total loss includes classification loss and consistency loss, and the calculation expression is as follows:

[0086] ;

[0087] ;

[0088] ;

[0089] in, Indicates the total loss; The classification loss is expressed using cross-entropy. The consistency loss is represented by KL divergence.

[0090] Compared to existing graph neural network (HGT) methods, the method in this embodiment addresses the issues of propagation and attention weight calculation in medical scenarios by constructing a patient-symptom-disease heterogeneous graph and combining it with label consistency constraints for hierarchical attention training, thereby ensuring that the disease classification results conform to medical logic.

[0091] Step S4: Input the patient node data from the heterogeneous graph into the disease classification model, output the disease probability, and complete the disease classification.

[0092] To verify the effectiveness of the method in medical text classification, a comparative experiment was conducted under the same conditions. The comparative method included:

[0093] The first method: based on graph neural networks (HGT); the second method: Chinese biomedical language model (ERNIE-Health); the third method: BERT model.

[0094] The evaluation metrics used are accuracy, precision, recall, F1 score, and AUC. The formula for calculating accuracy is as follows:

[0095] ;

[0096] in, The total number of samples, The number of correctly classified samples.

[0097] A comparative experiment was conducted on 6808 medical texts from a tertiary hospital, and the results are shown in Table 1.

[0098] Table 1 Comparative test results

[0099]

[0100] As shown in Table 1, the method in this embodiment outperforms the comparison method in terms of accuracy, precision, recall, F1 score, and AUC, especially in rare disease classification, where it shows a significant improvement. This embodiment addresses the three major pain points of poor classification consistency of multiple records in medical texts, data imbalance, and unutilized physician knowledge by combining data augmentation, heterogeneous graphs, and hierarchical attention mechanisms, which significantly improves classification accuracy and generalization ability.

[0101] In addition, the present invention also provides a disease classification device, comprising:

[0102] The data preprocessing and data augmentation module is used to perform data preprocessing and data augmentation on medical text data.

[0103] The heterogeneous graph construction module is used to parse medical text data and construct a heterogeneous graph including patient nodes, symptom nodes, and disease nodes.

[0104] The hierarchical attention training module is used to perform hierarchical attention training on heterogeneous graphs to obtain a disease classification model.

[0105] The disease classification module is used to input patient node data from the heterogeneous graph into the disease classification model, output disease probabilities, and complete disease classification.

[0106] For example, the computer device may be a mobile phone, desktop computer, laptop, handheld computer, or cloud server. The computer device may include, but is not limited to, a processor and memory. For instance, the computer device may also include input / output devices, network access devices, and buses.

[0107] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the computer device, connecting various parts of the computer device via various interfaces and lines.

[0108] The memory can be used to store the computer program and / or modules. The processor implements the computer program by running or executing the computer program and / or modules stored in the memory, and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0109] Wherein, if the modules / units integrated into the computer device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0110] In addition, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described disease classification method.

[0111] This embodiment's method achieves disease classification of medical texts through data augmentation, constructing a heterogeneous graph of medical texts, and hierarchical attention training. This method prevents sparsity through data augmentation, and then prevents data fragmentation by constructing a heterogeneous graph of medical texts to achieve relationship modeling. Finally, hierarchical attention training is used for dynamic weight selection to ensure effective information dissemination and prevent noise. Compared to existing technologies, this embodiment's method uses data augmentation, constructing a heterogeneous graph of medical texts, and hierarchical attention training to achieve medical text classification through layer-by-layer dependencies, ensuring the robustness and interpretability of the medical text classification results.

[0112] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0113] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for classifying diseases, characterized in that, Includes the following steps: Step S1: Perform data preprocessing and data augmentation on the medical text dataset to obtain medical text data; the data augmentation expression is as follows: ; in, This indicates the enhanced medical text. This indicates a splicing operation. This indicates reverse translation. This indicates an expansion of the medical dictionary. This indicates the calculation of semantic similarity, used for filtering enhanced text; Step S2: Parse the medical text data and construct a heterogeneous graph including patient nodes, symptom nodes, and disease nodes; Step S3: Combining the relationships between patient nodes, symptom nodes, and disease nodes, perform hierarchical attention training on the heterogeneous graph to obtain a disease classification model; Step S4: Input the patient node data from the heterogeneous graph into the disease classification model, output the disease probability, and complete the disease classification; In step S2, the process of constructing the heterogeneous graph is as follows: Define patient nodes, symptom nodes, and disease nodes. A patient node represents a patient, a symptom node represents the patient's clinical symptoms, and a disease node represents the final diagnosis. Node initialization, obtaining the initial node embedding The expression is: ,in, Indicates medical text Perform BERT / ERNIE encoding; The patient node is embedded, and the expression is: ,in, This indicates the embedding of the patient node. Indicates the number of symptoms. This indicates symptom embedding; As the process is built, connections are established between patient nodes and symptom nodes to represent the relationship between patients and related symptoms; connections are established between symptom nodes and disease nodes to represent the relationship between symptoms and related diseases; and connections are established between patient nodes and disease nodes to represent the relationship between patients and related diseases. In step S3, the hierarchical attention training includes a graph propagation process, which includes disease node propagation, symptom node propagation, and attention weight calculation. The calculation expressions for disease node propagation and symptom node propagation are as follows: ; ; in, This indicates the embedding of disease nodes after transmission. This indicates the embedding of symptom nodes after propagation. This indicates the embedding of pre-spreading symptom nodes. This indicates the embedding of disease nodes before transmission. This indicates that the patient node was de-embedded before transmission. Represents a non-linear activation function. , , Both represent learnable linear transformation matrices. , , Let each represent the set of neighbors of the patient node, disease node, and symptom node under the relation. s , d , p These represent patient nodes, disease nodes, and symptom nodes, respectively.

2. The disease classification method according to claim 1, characterized in that, In step S1, data preprocessing includes data cleaning, text segmentation, and standardization.

3. The disease classification method according to claim 2, characterized in that, In step S3, the attention weight calculation includes node-level attention calculation, relation-level attention calculation, and result aggregation calculation; The expression for calculating node-level attention is as follows: ; in, Indicates the attention weights of the node layer. express function, express function, This represents a learnable linear transformation matrix. and These represent the target node representation and the neighbor node representation, respectively. Represents the attention parameter vector. Indicates matrix transpose; The expression for calculating relational layer attention is as follows: ; in, Indicates the attention weights of the relationship layer. Represents the query vector. This represents a learnable linear transformation matrix. Represents the set of all relations. Indicates a relationship; The expression for the aggregate calculation is as follows: ; in, This represents the updated node representation. Represents a node In relation The set of neighbors below.

4. The disease classification method according to claim 3, characterized in that, In step S3, the hierarchical attention training also includes classification and consistency optimization, where the total loss includes classification loss and consistency loss, calculated as follows: ; ; ; in, Indicates the total loss; The classification loss is expressed using cross-entropy. The consistency loss is represented by KL divergence.

5. A disease classification device, characterized in that, The apparatus for implementing the disease classification method as described in any one of claims 1 to 4, the apparatus comprising: The data preprocessing and data augmentation module is used to perform data preprocessing and data augmentation on medical text data. The heterogeneous graph construction module is used to parse medical text data and construct a heterogeneous graph including patient nodes, symptom nodes, and disease nodes. The hierarchical attention training module is used to perform hierarchical attention training on heterogeneous graphs to obtain a disease classification model. The disease classification module is used to input patient node data from the heterogeneous graph into the disease classification model, output disease probabilities, and complete disease classification.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the disease classification method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Medical text automatic ICD coding method and system based on graph attention

    CN117594246A

  • Intelligent coding method and device for infectious disease data, computer equipment and storage medium

    CN119153127A