Medical data classification method based on machine learning
By using multi-source medical semantic modeling and adaptive training mechanisms, a unified latent space feature vector is generated and medical constraint classification is performed. This solves the problems of cross-modal feature fusion and medical logic consistency of multi-source heterogeneous medical data, improves the accuracy and robustness of medical data classification, and adapts to the medical knowledge systems of different hospitals.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-03-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing medical data analysis methods struggle to effectively integrate the semantic and temporal features of multi-source heterogeneous medical data, lack cross-modal feature fusion capabilities, fail to accurately extract medical semantic relationships, and perform poorly when dealing with imbalanced category distributions and diseases with few samples. Furthermore, the models lack reliance on and logical constraints from medical knowledge graphs, leading to conflicts between prediction results and medical logic.
By integrating multi-source medical semantic modeling and adaptive training mechanisms, multiple types of medical semantic features are extracted to generate a unified latent space feature vector. An online sequential extreme learning machine is then used for medical constraint and logical correction classification. By combining the dependency and stage relationships of the medical knowledge graph, the sampling probability and category weights are dynamically adjusted to achieve medical consistency classification.
It enhances the model's ability to understand multi-source heterogeneous medical data, improves classification accuracy and robustness, strengthens the model's interpretability and clinical applicability, improves the ability to identify diseases with few samples, and adapts to the medical knowledge systems of different hospitals.
Smart Images

Figure CN121659050A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent processing of medical data, and in particular to a medical data classification method based on machine learning. Background Technology
[0002] Current medical data analysis typically relies on rule-based classification methods or traditional machine learning models, which lack the ability to structurally process multi-source, heterogeneous medical data such as electronic medical record texts, laboratory indicators, and time-series monitoring data. It also struggles to simultaneously integrate semantic, numerical, and temporal features. In real-world clinical scenarios, medical record information is characterized by unstructured nature, semantic ambiguity, and complex cross-time-period relationships. Traditional methods struggle to accurately extract medical semantic relationships and establish stable, complete medical semantic representations. Furthermore, existing methods often lack unified cross-modal feature fusion capabilities to address the dynamic changes in laboratory and monitoring data, resulting in insufficient sensitivity of classification models to changes in patient status.
[0003] On the other hand, existing classification models are significantly inadequate when dealing with imbalanced class distributions, diseases with few samples, and rare diseases. Their training processes lack targeted sampling mechanisms and class weight adjustment strategies. Furthermore, these models generally do not incorporate dependencies, taboos, and stage relationships from medical knowledge graphs, failing to enforce medical rationality constraints during inference and potentially leading to predictions that conflict with medical logic.
[0004] Therefore, how to provide a machine learning-based method for classifying medical data is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a medical data classification method based on machine learning. This invention integrates multi-source medical semantic modeling and adaptive training mechanisms to achieve consistent medical classification, which has the advantages of high accuracy, strong robustness and friendliness to small sample sizes.
[0006] A machine learning-based medical data classification method according to an embodiment of the present invention includes the following steps: Acquire heterogeneous medical data from multiple sources, including electronic medical record systems, laboratory testing systems, and monitoring devices; preprocess the data; and generate standardized medical datasets. Multiple medical semantic features are extracted from standardized medical datasets and aggregated to generate a medical semantic feature set. Encode, align, and fuse various features in the medical semantic feature set to generate a unified latent space feature vector. The unified latent space feature vector is input into an online sequential extreme learning machine for medical constraint and logical correction classification processing to generate medical consistency category prediction results. A training sample set is constructed based on historical medical data to identify disease categories with few samples and rare diseases, and sampling probabilities and category weights are generated according to the sample proportions. The training loop is driven by sampling probability and class weights. The model parameters of the online sequential extreme learning machine are updated. The updated online sequential extreme learning machine is then used to perform forward inference on the medical data to be classified and output the corresponding class prediction results.
[0007] Optionally, the multi-source heterogeneous medical data includes medical record text data, test indicator data, and time-series monitoring data, and the preprocessing includes format standardization, encoding unification, noise removal, and missing value imputation.
[0008] Optionally, the generation of the medical semantic feature set specifically includes: Sentence segmentation, word segmentation and medical named entity recognition are performed on medical record text data in standardized medical datasets. Text fragments corresponding to symptoms, signs, examination items, diagnosis conclusions and medication records are extracted, and each text fragment is labeled with field type, time information and body part information. The extracted fields are matched with a medical terminology database, and the fields are standardized according to synonym and hierarchical relationships to generate structured field records. Based on structured field records, the sequential and relational relationships of symptoms, signs, examination items, diagnostic conclusions, and medication records are extracted and generated into a structured semantic chain according to patient identification and consultation time. The statistical results of various fields are statistically analyzed based on the structured semantic chain. The statistical results are combined according to a preset structural format, and the combined statistical attributes are used as structured medical semantic features. The statistical results include the number of times the field appears in the structured semantic chain, the duration of the field in the time series, and the time association features between the field and its predecessor and successor fields based on the time interval and order relationship. Based on the test index data in the standardized medical dataset, the difference between the measured value and the upper and lower limits of the reference range and the proportion of the measured value deviating from the reference range are calculated. The above differences and proportions are combined according to the test index categories to obtain high-order medical semantic features. Based on time-series monitoring data in a standardized medical dataset, the data is divided into multiple time segments along the time axis. The trend increase / decrease, fluctuation amplitude, rate of change, and rhythm cycle are calculated for each time segment, and the status label of each time segment is determined. The above attributes and status labels are connected in chronological order to obtain time-series semantic features. Structured medical semantic features, higher-order medical semantic features, and temporal semantic features are aligned and concatenated according to patient identification and consultation time to generate a set of medical semantic features.
[0009] Optionally, the generation of the unified latent space feature vector specifically includes: The structured medical semantic features, higher-order medical semantic features, and temporal semantic features in the medical semantic feature set are divided according to feature source and feature type, and the discrete features and continuous features in each type of feature are distinguished. Discrete features are mapped to integer index values according to a preset category coding rule. Integer index values are mapped to fixed-length numerical feature vectors according to a preset lookup table. Continuous features are subjected to interval scaling and scale normalization according to a preset numerical scaling rule. The normalized continuous features are then appended to the corresponding numerical feature vectors to generate an initial encoded feature vector sequence. The initial encoded feature vector sequence is aligned according to a preset target dimension to obtain aligned encoded feature vectors; The aligned coding feature vectors are aggregated according to medical semantic records. The coding feature vectors in the same record are connected in order of feature type to form a continuous feature vector. The feature components in the continuous feature vector are weighted and summed with their corresponding weight coefficients to generate a multi-source fusion coding result. The multi-source fusion encoding results are subjected to element-wise transformation and overall mapping according to a preset nonlinear mapping rule to generate a unified latent space feature vector.
[0010] Optionally, the generation of the category prediction results for medical consistency specifically includes: The input vector is constructed based on the feature component order of the unified latent space feature vector and associated with the sample identifier; The input vector is weighted by the random connection weight coefficients of the hidden layer of the online sequential extreme learning machine, and the result is biased by a preset bias coefficient to generate the original output vector of the hidden layer. Based on the medical knowledge graph, the dependencies, prohibitions and stage relationships between medical entities are classified. The numerical fields, applicable field ranges and relationship identifiers of each relationship are extracted in sequence and combined according to a preset structure format to generate the knowledge constraint parameters of the corresponding relationship. Based on the index of each feature component in the unified latent space feature vector, the knowledge constraint parameters are mapped to the corresponding feature components in the original output vector of the hidden layer to form a constraint mask structure. The feature components of the original output vector of the hidden layer are subjected to numerical scaling, suppression and stage numerical adjustment according to the constraint mask structure to obtain the hidden layer constraint output vector. The hidden layer constraint output vector is input into the incremental update module of the online sequential extreme learning machine. According to the incremental update rule, the output weight matrix of the previous time step is updated by matrix inversion, the weight statistics are updated according to the input records, and the output layer parameter statistics are updated according to the class target vector to obtain the updated output weight matrix. The hidden layer constraint output vector is weighted and the updated output weight matrix is weighted. The output components corresponding to each category are read in order of category index according to the output layer mapping rule and combined into the original category distribution vector. Based on the dependency, prohibition and stage relationships between medical categories in the medical knowledge graph, medical logic correction rules are constructed, and each rule is represented as a medical logic correction parameter including a logical weight coefficient, applicable category range and logical type identifier; Based on the medical logic correction parameters, the class probabilities of the original class distribution vector are sequentially subjected to numerical attenuation and amplification processing according to the logical weight coefficients, and the adjusted class probabilities are then normalized. The normalized category probabilities are read according to the category index order, the probability values corresponding to each category are determined, the category index with the largest probability value is determined, the corresponding category label is retrieved from the preset category mapping table as the output, and the category prediction result of medical consistency is generated.
[0011] Optionally, the generation of the sampling probability and class weight specifically includes: Extract heterogeneous medical data from multiple sources from historical medical data with real category labels, and perform field organization and standardization according to a preset format to generate training sample records; Features are extracted from each training sample record and mapped to generate a unified latent space feature vector. The unified latent space feature vector is then bound to the corresponding real class label to generate training sample entries. All training sample items are categorized according to the true category labels, the number of samples in each category is counted, and the proportion of each category in all samples is calculated. The sample proportions of each category are compared according to a preset sample proportion threshold. When the sample proportion is lower than the low sample proportion threshold, it is marked as a low sample category. When the true category label of the sample belongs to the preset rare disease list and the sample proportion is lower than the rare disease proportion threshold, it is marked as a rare disease category. The sampling intensity is calculated based on the sample ratio and the sampling probability is generated by normalizing it according to the total amount. Initial class weights are generated based on the sampling probability, and numerical amplification is performed on the weights of classes with few samples and rare diseases to generate class weights.
[0012] Optionally, the generation of the corresponding category prediction result specifically includes: Load the sampling probabilities and class weights of each category into the parameter storage structure of the training loop, and initialize the training round index to the starting round; In the current training round, random sampling of training sample items by category is performed according to the sampling probability recorded in the training cycle to generate a subset of training samples for the current training round, and training feature batch and training label batch are constructed. The training feature batch is input into the online sequential extreme learning machine. Forward inference is performed on each unified latent space feature vector in the training feature batch to obtain the corresponding original class distribution vector. The original class distribution vector is then aligned with the true class labels in the training label batch to obtain the training inference result set. For each record in the training inference result set, calculate the sample-level prediction uncertainty index, and aggregate the uncertainty indices of each category to obtain the category-level prediction uncertainty index; For each record in the training inference result set, calculate the sample-level loss value, and perform weighted processing according to the class weights of the records in the training loop to generate the weighted loss value of the current training round. Then, update the parameters of the online sequential extreme learning machine model based on the weighted total loss value. After updating the model parameters for the current training round, the class weights and sampling probabilities are dynamically updated based on the category-level prediction uncertainty index. The updated class weights and sampling probabilities are then written into the training loop for use in the next training round. After completing the preset training rounds or meeting the training termination conditions, the updated online sequential extreme learning machine is used to perform forward inference processing on the medical data to be classified, and output the category prediction results corresponding to the medical data to be classified.
[0013] The beneficial effects of this invention are: This invention constructs a unified medical semantic feature system and a unified latent space feature representation, enabling heterogeneous medical data from multiple sources, such as medical records, laboratory indicators, and time-series monitoring sequences, to be expressed in the same vector space. This significantly improves the model's ability to understand cross-modal and cross-time-time medical information. Through systematic extraction of medical semantics from text, calculation of differential features in laboratory data, and modeling of temporal state changes, this invention achieves a deep fusion expression of patient symptom evolution, abnormal trends in laboratory tests, and dynamic changes in vital signs, allowing the classification model to capture more comprehensive medical semantic relationships. Furthermore, by integrating nonlinear mapping and dimension alignment feature processing mechanisms, this invention generates a stable and unified latent space representation, effectively improving the inference accuracy and robustness of online sequential extreme learning machines in complex feature scenarios.
[0014] This invention further incorporates dependency, prohibition, and stage relationships from medical knowledge graphs. Through constraint masking structures and medical logic correction mechanisms, it directly intervenes in the model's reasoning process, achieving medically consistent classification outputs. This mechanism not only avoids predictive results with contradictory medical logic due to statistical bias or training noise, but also provides outputs that better align with clinical diagnostic logic in scenarios such as disease stage determination and risk level prediction, effectively enhancing the model's interpretability and clinical applicability. Furthermore, by setting knowledge constraint parameters and logic correction rules, this invention can be adapted to the medical knowledge systems of different hospitals or departments, exhibiting good scalability and domain transferability.
[0015] To address the common class imbalance problem in existing technologies, this invention proposes a sampling probability generation and class weight adjustment strategy based on sample ratios. During training, it incorporates prediction uncertainty to achieve dynamic adjustments, enabling the model to maintain high recognition capabilities in scenarios with few samples and rare diseases. Through dynamic sampling and weight update mechanisms, the training loop continuously improves the model's focus on difficult-to-identify classes, significantly mitigating the bias problem caused by class imbalance. Simultaneously, this invention leverages the structural characteristics of online sequential extreme learning machines to achieve rapid incremental updates of model parameters, allowing the system to learn instantly upon receiving new samples, effectively enhancing the model's adaptability to the long-term evolution of medical data. Overall, this invention significantly improves the accuracy, stability, medical consistency, and recognition capability for classes with few samples in medical data classification tasks, demonstrating significant practical application value. Attached Figure Description
[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0017] Figure 1 This is a flowchart of a machine learning-based medical data classification method proposed in this invention; Figure 2 This is a schematic diagram illustrating the process of constructing a medical semantic feature set for a machine learning-based medical data classification method proposed in this invention. Figure 3 This is a data flow graph showing the generation of category prediction results for medical consistency using a machine learning-based medical data classification method proposed in this invention. Detailed Implementation
[0018] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0019] refer to Figure 1-3A machine learning-based method for classifying medical data includes the following steps: Acquire heterogeneous medical data from multiple sources, including electronic medical record systems, laboratory testing systems, and monitoring devices; preprocess the data; and generate standardized medical datasets. Multiple medical semantic features are extracted from standardized medical datasets and aggregated to generate a medical semantic feature set. Encode, align, and fuse various features in the medical semantic feature set to generate a unified latent space feature vector. The unified latent space feature vector is input into an online sequential extreme learning machine for medical constraint and logical correction classification processing to generate medical consistency category prediction results. A training sample set is constructed based on historical medical data to identify disease categories with few samples and rare diseases, and sampling probabilities and category weights are generated according to the sample proportions. The training loop is driven by sampling probability and class weights. The model parameters of the online sequential extreme learning machine are updated. The updated online sequential extreme learning machine is then used to perform forward inference on the medical data to be classified and output the corresponding class prediction results.
[0020] In this embodiment, the multi-source heterogeneous medical data includes medical record text data, test indicator data, and time-series monitoring data. The test indicator data includes blood test indicators, biochemical test indicators, immune test indicators, and microbiological test indicators. The time-series monitoring data includes vital sign monitoring sequences, electrocardiogram monitoring sequences, continuous blood glucose monitoring data, and ambulatory blood pressure monitoring data. The preprocessing includes format standardization, encoding unification, noise removal, and missing value imputation.
[0021] In this embodiment, the generation of the medical semantic feature set specifically includes: Sentence segmentation, word segmentation and medical named entity recognition are performed on medical record text data in standardized medical datasets. Text fragments corresponding to symptoms, signs, examination items, diagnosis conclusions and medication records are extracted, and each text fragment is labeled with field type, time information and body part information. The extracted fields are matched with a medical terminology database, and the fields are standardized according to synonym and hierarchical relationships to generate structured field records. The generation of the structured field record includes: matching the extracted text content of the field with standard terms in the medical terminology database word by word, and determining the closest standard term through the list of matched candidate terms; when there are multiple candidate terms, using a preset thesaurus to aggregate the candidate terms, performing word-by-word replacement on the field content containing synonyms, and using the aggregated standard term as the normalized term; when the field content includes hierarchical terms, locating the corresponding hierarchical terms and subordinate terms in the field content according to the hierarchical structure table in the terminology database, and using the standard hierarchical nodes in the hierarchical table as the hierarchical semantic identifier of the field; extracting the corresponding original value, field type, time information, and body part information from the field content after completing the terminology normalization and hierarchical relationship determination, and binding the normalized term, hierarchical semantic identifier, original value, field type, time information, and body part information according to the field mapping rules; verifying the bound fields according to terminology validity, field type consistency, time information completeness, and body part information matching, and arranging the verified fields in a preset structure format to generate a structured field record; Based on structured field records, the sequential and relational relationships of symptoms, signs, examination items, diagnostic conclusions, and medication records are extracted and generated into a structured semantic chain according to patient identification and consultation time. The generation of the structured semantic chain includes: aggregating all structured field records of the same patient according to the patient identifier, and sorting the aggregated field records according to the consultation time and the order in which the fields appear in the medical record text; in the sorted field records, extracting the sequential relationship of adjacent or time-continuous field records according to the logical flow order of the field types, and performing relationship matching and annotation on the association between symptoms and signs, symptoms and examination items, examination items and diagnostic conclusions, and diagnostic conclusions and medication records based on the temporal relationship between fields, the content inclusion relationship between fields, and the dependency relationship of the medical process to which the fields belong; after completing the relationship annotation, using each structured field record as a semantic chain node. Based on the labeled sequence and association relationships, the predecessor and successor nodes of each node are determined. By connecting the predecessor and successor relationships of each node one by one, the nodes are arranged in a chain according to the time order and field dependency order. During the chain arrangement process, the nodes connected to the same chain segment are checked for field consistency, including the detection of field time conflicts, field duplication, and field association conflicts. The time conflict nodes are reordered according to the time information, duplicate nodes are merged, and the association conflict nodes are filtered according to the field type priority and the time of consultation. The checked nodes are linked, and all successfully linked nodes and their connection types are arranged into chain segments in sequence. The chain segments are then formed into a structured semantic chain according to the patient identifier. The statistical results of various fields are statistically analyzed based on the structured semantic chain. The statistical results are combined according to a preset structural format, and the combined statistical attributes are used as structured medical semantic features. The statistical results include the number of times the field appears in the structured semantic chain, the duration of the field in the time series, and the time association features between the field and its predecessor and successor fields based on the time interval and order relationship. Based on the test index data in the standardized medical dataset, the difference between the measured value and the upper and lower limits of the reference range and the proportion of the measured value deviating from the reference range are calculated. The above differences and proportions are combined according to the test index categories to obtain high-order medical semantic features. Based on time-series monitoring data in a standardized medical dataset, the data is divided into multiple time segments along the time axis. The trend increase / decrease, fluctuation amplitude, rate of change, and rhythm cycle are calculated for each time segment, and the status label of each time segment is determined. The above attributes and status labels are connected in chronological order to obtain time-series semantic features. Structured medical semantic features, higher-order medical semantic features, and temporal semantic features are aligned and concatenated according to patient identification and consultation time to generate a set of medical semantic features.
[0022] In this embodiment, the generation of the unified latent space feature vector specifically includes: The structured medical semantic features, higher-order medical semantic features, and temporal semantic features in the medical semantic feature set are divided according to feature source and feature type, and the discrete features and continuous features in each type of feature are distinguished. Discrete features are mapped to integer index values according to a preset category coding rule. Integer index values are mapped to fixed-length numerical feature vectors according to a preset lookup table. Continuous features are subjected to interval scaling and scale normalization according to a preset numerical scaling rule. The normalized continuous features are then appended to the corresponding numerical feature vectors to generate an initial encoded feature vector sequence. The initial encoded feature vector sequence is subjected to dimension alignment processing according to a preset target dimension to obtain aligned encoded feature vectors. The dimension alignment processing includes expanding to the target dimension by padding with zero values when the dimension of the initial encoded feature vector is smaller than the target dimension, and compressing to the target dimension by truncating the feature components at the beginning of the sequence when the dimension of the initial encoded feature vector is larger than the target dimension. The aligned coding feature vectors are aggregated according to medical semantic records. The coding feature vectors in the same record are connected in order of feature type to form a continuous feature vector. The feature components in the continuous feature vector are weighted and summed with their corresponding weight coefficients to generate a multi-source fusion coding result. The multi-source fusion encoding results are subjected to element-wise transformation and overall mapping according to a preset nonlinear mapping rule to generate a unified latent space feature vector. The element-wise transformation includes: processing each feature component in the multi-source fusion coding result one by one according to a preset nonlinear transformation rule; performing a fixed threshold pruning operation, a numerical scaling operation according to a proportional coefficient, and a numerical replacement operation based on a nonlinear activation function on each feature component in sequence; and arranging the processed feature components in the original order to form a feature component sequence after element-wise transformation. The overall mapping includes: after completing the element-wise transformation, performing a linear combination operation of a fixed weight matrix, a dimension compression operation of taking the first few components according to the target dimension, and a feature rearrangement operation of rearranging the feature components according to the given index order on the feature component sequence after the element-wise transformation, thereby generating a unified latent space feature vector.
[0023] In this embodiment, the generation of the category prediction result for medical consistency specifically includes: The input vector is constructed based on the feature component order of the unified latent space feature vector and associated with the sample identifier; The input vector is weighted by the random connection weight coefficients of the hidden layer of the online sequential extreme learning machine, and the result is biased by a preset bias coefficient to generate the original output vector of the hidden layer. The hidden layer random connection weight coefficients are connection coefficients generated by the online sequential extreme learning machine during the initialization phase when establishing connections between each feature component of the input vector and the hidden layer nodes. They are generated one by one within a given value range according to a preset random distribution rule and remain fixed after generation. Based on the medical knowledge graph, the dependencies, prohibitions and stage relationships between medical entities are classified. The numerical fields, applicable field ranges and relationship identifiers of each relationship are extracted in sequence and combined according to a preset structure format to generate the knowledge constraint parameters of the corresponding relationship. The dependencies include prior dependencies, coexistence dependencies, and outcome dependencies between medical entities or medical categories; The prohibited relationships include mutually exclusive, taboo, and exclusionary relationships between medical entities or medical categories; The stage relationships include disease progression relationships, state progression relationships, and hierarchical relationships between medical entities or medical categories; Based on the index of each feature component in the unified latent space feature vector, the knowledge constraint parameters are mapped to the corresponding feature components in the original output vector of the hidden layer to form a constraint mask structure. The feature components of the original output vector of the hidden layer are subjected to numerical scaling, suppression and stage numerical adjustment according to the constraint mask structure to obtain the hidden layer constraint output vector. The formation of the constraint mask structure includes: according to the index of each feature component in the unified latent space feature vector, comparing the applicable field range in each knowledge constraint parameter with the feature component position of the original output vector of the hidden layer one by one, establishing constraint mapping entries for the matched feature component positions, and recording the corresponding constraint coefficient, constraint type identifier and feature component index for each constraint mapping entry; after completing the mapping of all knowledge constraint parameters, arranging all constraint mapping entries in the order of feature component index, generating corresponding mask attributes for each feature component according to the constraint type identifier, combining the mask attributes with the constraint coefficients to form feature component level mask units, and arranging all mask units in the order of feature components to form a constraint mask structure; The constraint coefficients include dependency strength, prohibition strength, and phase process coefficients; The mask attribute is obtained by: setting a scaling processing flag for constraint type flags belonging to dependency relationships, setting a suppression processing flag for constraint type flags belonging to prohibition relationships, setting a stage processing flag for constraint type flags belonging to stage relationships, and binding the above processing flags to the corresponding feature component indexes to form a mask attribute; The stage numerical adjustment process includes: reading the original values of the matching feature components in the original output vector of the hidden layer according to the stage processing mark corresponding to the feature component index in the mask structure; reading the corresponding constraint coefficient from the mask structure as the stage adjustment coefficient; performing a numerical offset operation on the original values according to the stage adjustment coefficient; and after the offset operation, segmenting the values according to the stage interval boundary corresponding to the stage adjustment coefficient; and writing the segmented values into the position indicated by the feature component index. The hidden layer constraint output vector is input into the incremental update module of the online sequential extreme learning machine. According to the incremental update rule, the output weight matrix of the previous time step is updated by matrix inversion, the weight statistics are updated according to the input records, and the output layer parameter statistics are updated according to the class target vector to obtain the updated output weight matrix. The process of obtaining the class target vector includes: reading the real category label corresponding to the current medical semantic record; assigning a preset target value to the vector dimension corresponding to the index position of the category in the set of all categories, assigning preset non-target values to the other vector dimensions, and arranging the values of each dimension in the order of the category index to generate the class target vector. The step of updating the weight statistics according to the input record includes: after completing the matrix inversion update at the current time, reading the hidden layer constraint output vector and the class target vector, converting the hidden layer constraint output vector into column vector form according to a preset format, and performing vector multiplication operation on the column vector and the class target vector to generate the weight statistics increment; performing vector addition operation on the weight statistics increment and the weight statistics at the previous time to generate the weight statistics at the current time, and writing them into the statistics storage unit of the incremental update module according to the statistics storage order; The step of updating the output layer parameter statistics by target vector includes: after updating the weight statistics at the current time, reading the output layer parameter statistics at the previous time and the target vector of the current input record, converting the target vector into a column vector according to a preset format, and performing numerical scaling on the column vector to generate parameter statistics increment; performing vector addition on the parameter statistics increment and the output layer parameter statistics at the previous time to generate the output layer parameter statistics at the current time, and writing the updated output layer parameter statistics into the output layer parameter statistics storage unit; The hidden layer constraint output vector is weighted and the updated output weight matrix is weighted. The output components corresponding to each category are read in the order of category index according to the output layer mapping rule and combined into the original category distribution vector. The categories include disease category, disease stage category, clinical status category, abnormal examination category, medication reaction category and risk level category. Based on the dependency, prohibition and stage relationships between medical categories in the medical knowledge graph, medical logic correction rules are constructed, and each rule is represented as a medical logic correction parameter including a logical weight coefficient, applicable category range and logical type identifier; Based on the medical logic correction parameters, the class probabilities of the original class distribution vector are sequentially subjected to numerical attenuation and amplification processing according to the logical weight coefficients, and the adjusted class probabilities are then normalized. The normalized category probabilities are read according to the category index order, the probability values corresponding to each category are determined, the category index with the largest probability value is determined, the corresponding category label is retrieved from the preset category mapping table as the output, and the category prediction result of medical consistency is generated.
[0024] In this embodiment, the generation of the sampling probability and class weight specifically includes: Extract heterogeneous medical data from multiple sources from historical medical data with real category labels, and perform field organization and standardization according to a preset format to generate training sample records; Features are extracted from each training sample record and mapped to generate a unified latent space feature vector. The unified latent space feature vector is then bound to the corresponding real class label to generate training sample entries. All training sample items are categorized according to the true category labels, the number of samples in each category is counted, and the proportion of each category in all samples is calculated. The sample proportions of each category are compared according to a preset sample proportion threshold. When the sample proportion is lower than the low sample proportion threshold, it is marked as a low sample category. When the true category label of the sample belongs to the preset rare disease list and the sample proportion is lower than the rare disease proportion threshold, it is marked as a rare disease category. The sampling intensity is calculated based on the sample ratio and the sampling probability is generated by normalization according to the total amount. The initial class weights are generated based on the sampling probability, and the weights of the low-sample class and the rare disease class are numerically amplified to generate the class weights. The calculation of the sampling intensity includes: reading the sample proportion for each category, reading the basic sampling coefficient from the preset basic sampling intensity parameter, and performing a numerical multiplication operation on the basic sampling coefficient according to the reciprocal of the sample proportion to obtain the sampling intensity value of the corresponding category. The generation of the initial category weights includes: reading the sampling probability for each category, reading the category weight benchmark coefficient from the preset category weight benchmark parameters, and performing a numerical multiplication operation on the sampling probability according to the category weight benchmark coefficient to obtain the initial category weight of the corresponding category; The numerical amplification process includes: reading the initial category weight for each category; reading the preset amplification coefficient for the initial category weights that are marked as low-sample categories or rare disease categories; performing a numerical multiplication operation on the initial category weights according to the amplification coefficient to generate amplified category weights; writing the amplified category weights into the category weight record position according to the category index order; and keeping the original initial category weights unchanged for unmarked categories.
[0025] In this embodiment, the generation of the corresponding category prediction result specifically includes: Load the sampling probabilities and class weights of each category into the parameter storage structure of the training loop, and initialize the training round index to the starting round; In the current training round, random sampling of training sample items by category is performed according to the sampling probability recorded in the training cycle to generate a subset of training samples for the current training round, and training feature batch and training label batch are constructed. The training feature batch is input into the online sequential extreme learning machine. Forward inference is performed on each unified latent space feature vector in the training feature batch to obtain the corresponding original class distribution vector. The original class distribution vector is then aligned with the true class labels in the training label batch to obtain the training inference result set. For each record in the training inference result set, calculate the sample-level prediction uncertainty index, and aggregate the uncertainty indices of each category to obtain the category-level prediction uncertainty index; The calculation of the sample-level prediction uncertainty index includes: reading the corresponding original category distribution vector for each record in the training inference result set, and reading the corresponding probability value in the original category distribution vector according to the real category label; performing a numerical inverse transformation on the probability value according to a preset probability inverse scaling coefficient to obtain the first uncertainty component; reading all category probability values in the original category distribution vector except for the real category label position, calculating the difference between each category probability value and the real category label probability according to a preset probability difference coefficient, and performing numerical scaling processing according to a preset difference scaling coefficient; performing numerical aggregation of all scaled differences according to a preset aggregation rule to obtain the second uncertainty component; performing numerical combination processing on the first uncertainty component and the second uncertainty component according to a preset uncertainty combination coefficient to generate the sample-level prediction uncertainty index for the corresponding training record; For each record in the training inference result set, calculate the sample-level loss value, and perform weighted processing according to the class weights of the records in the training loop to generate the weighted loss value of the current training round. Then, update the parameters of the online sequential extreme learning machine model based on the weighted total loss value. The calculation of the sample-level loss value includes: reading the corresponding original category distribution vector for each record in the training inference result set, and reading the corresponding probability value in the original category distribution vector according to the real category label, performing a numerical transformation on the probability value according to a preset logarithmic transformation rule to generate a first loss component; reading the values of all category probabilities in the original category distribution vector except for the real category label position, performing numerical scaling on each category probability according to a preset competition coefficient, and performing numerical aggregation on the scaled values according to a preset aggregation rule to generate a second loss component; performing numerical combination processing on the first loss component and the second loss component according to a preset loss combination coefficient, and using the combined value as the sample-level loss value of the corresponding training record; The update of the online sequential extreme learning machine model parameters includes: after obtaining the weighted total loss value of the current training round, reading the output weight matrix and hidden layer constraint output vector recorded in the previous time step from the training loop, converting the hidden layer constraint output vector into column vector form, and performing numerical multiplication operation on the column vector and the weighted total loss value according to the preset weight update coefficient to generate the output weight update increment; performing matrix addition operation on the output weight matrix and the output weight update increment of the previous time step to generate the updated output weight matrix, and writing the updated output weight matrix into the model parameter storage structure of the online sequential extreme learning machine; performing element-wise numerical adjustment on the matrix inversion auxiliary variable associated with the output weight matrix according to the preset inverse matrix update rule, writing the adjusted matrix inversion auxiliary variable into the model parameter storage structure, and using the above-mentioned updated output weight matrix and matrix inversion auxiliary variable as the model parameter input for the next training round; After updating the model parameters for the current training round, the class weights and sampling probabilities are dynamically updated based on the class-level prediction uncertainty index. The updated class weights and sampling probabilities are then written into the training loop for use in the next training round. The dynamic update includes: reading the class weights and sampling probabilities recorded at the end of the previous training round for each class; performing a numerical scaling operation on the class-level prediction uncertainty index according to a preset uncertainty scaling factor to obtain an uncertainty adjustment amount; performing a numerical superposition operation on the uncertainty adjustment amount and the original class weights to generate updated initial values for the class weights; performing normalization processing on the updated initial values for the class weights of all classes according to the sum of the weights to obtain updated class weights; performing a numerical adjustment on the current sampling probabilities of each class according to the updated class weights; converting the updated class weights into sampling intensities according to a preset mapping rule; and performing total normalization processing on the sampling intensities of all classes to obtain updated sampling probabilities. After completing the preset training rounds or meeting the training termination conditions, the updated online sequential extreme learning machine is used to perform forward inference processing on the medical data to be classified, and output the category prediction results corresponding to the medical data to be classified.
[0026] Example 1: To verify the feasibility of this invention in practice, it was applied to the real medical data environment of a large, comprehensive tertiary hospital in a certain city. This hospital has accumulated multi-source, heterogeneous medical data from electronic medical record systems, laboratory testing systems, and long-term monitoring systems during its daily clinical practice. However, due to inconsistent data structures, significant differences in semantic expression, and extremely uneven distribution of category samples, the hospital has long faced problems such as significant classification bias, insufficient ability to identify rare diseases, and frequent logical errors when using artificial intelligence tools for disease classification assistance. Especially in scenarios involving multi-source data fusion and complex medical relationship reasoning, traditional classification models often struggle to maintain consistency in medical logic, leading to some output results contradicting clinical knowledge and limiting their use in assisting clinical practice.
[0027] With the collaboration of the hospital's information center, multi-source heterogeneous medical data from inpatient and outpatient departments over a continuous period of time were uniformly preprocessed to generate a standardized medical dataset. Natural language processing methods were used to extract symptoms, signs, diagnoses, examination items, and medication information from medical record texts, and structured semantic chains were automatically generated, enabling the data to be input into the classification framework proposed in this invention in a form consistent with medical logic. Simultaneously, laboratory test data and long-term monitoring data were also mapped into medical semantic features, which, together with textual semantic features, constitute a unified latent space feature vector.
[0028] In this scenario, the present invention inputs the aforementioned feature vectors into an online sequential extreme learning machine. Through implicit layer medical knowledge constraints, it automatically processes dependencies, prohibitions, and stage relationships, ensuring that the model's internal reasoning behavior conforms to the medical knowledge structure. Subsequently, a sampling probability and class weight generation mechanism based on rare diseases and few-sample categories drives the training loop, improving the model's learning ability under extremely imbalanced data conditions. Historical hospital data is used as training samples input into the model. The model gradually corrects its weights during continuous updates, increasing attention to rare categories and reducing overfitting to high-frequency categories. As the training rounds progress, the application of medical logic correction rules within the model gradually stabilizes, and the output category distribution no longer exhibits medically unreasonable combinations, making the prediction results more consistent with clinical knowledge.
[0029] To further evaluate the practical effectiveness of this invention, monitoring data from continuous use in the hospital was selected, and the model's classification results were compared and analyzed. During this process, doctors manually reviewed some of the system's output results, focusing on assessing whether the model could maintain medical logical consistency under complex data conditions, identify low-frequency disease categories, and reduce erroneous inferences. Feedback collected from different departments and time periods at the hospital shows that this invention can significantly reduce classification bias caused by semantic inconsistencies, improve the recognition quality of imbalanced categories, and enhance the alignment of output results with clinical knowledge. Furthermore, during actual use, this invention did not impose any additional burden on the hospital's information platform; the training and inference processes could run stably in the production environment, meeting the timeliness requirements for clinical auxiliary use.
[0030] As can be seen from the above application scenarios, this invention not only improves the accuracy and medical consistency of medical data classification, but also effectively solves the technical problem that traditional models are difficult to work stably under conditions of complex semantic structure, class imbalance and lack of medical logic constraints, and has good practical application value.
[0031] Table 1. Comparison of classification performance between the method of this invention and traditional methods.
[0032] As can be clearly seen from Table 1, the method of the present invention is superior to the traditional method in many indicators.
[0033] In terms of accuracy, the method of this invention achieves 93.47%, which is 7.26% higher than the 86.21% of the traditional method. This improvement is mainly due to the fact that this invention uses unified latent space fusion of text, verification, and time-series monitoring of multi-source medical features, making the model input expression more stable, thereby reducing the classification bias caused by heterogeneous feature differences and significantly enhancing the overall recognition ability.
[0034] In terms of the combined precision and recall, the method of this invention achieved 92.08%, significantly higher than the 82.15% of the traditional method, representing an improvement of 9.93%. The key reason for this result lies in the introduction of a dynamic update mechanism for class weights and sampling probabilities into the training system of this invention. This mechanism continuously strengthens the model's ability to identify low-frequency classes during training, while suppressing overfitting to high-frequency classes, thus simultaneously improving both precision and recall, resulting in a significant improvement in the overall performance.
[0035] In terms of rare category recall, the method of this invention achieved 78.92%, a 24.59% improvement compared to the traditional method's 54.33%, demonstrating a significant performance increase. This effect is mainly attributed to the few-sample identification mechanism and rare disease category weight amplification strategy established in this invention, combined with the incremental update characteristics of online sequential extreme learning machines. This allows the model to focus more fully on rare disease samples during training, thereby significantly improving the ability to identify rare categories.
[0036] From the perspective of medical logical consistency index, the method of this invention achieves 97.35%, which is significantly higher than the 88.42% of the traditional method, representing an improvement of 8.93%. This advantage is mainly due to the fact that this invention introduces medical knowledge graph constraints into both the hidden layer and the output layer, enabling the model to avoid logically conflicting outputs, thereby ensuring that the output results are more consistent with medical logic.
[0037] In terms of the rare category error rate, the method of this invention reduces it to 9.86%, a decrease of 11.88% compared to the traditional method's 21.74%. The main reason for the significant reduction in error rate is the dual correction effect of the dynamic category weight mechanism and the knowledge graph, which prevents the model from generating a large amount of confusion when dealing with rare categories with few samples, thereby greatly reducing the probability of misclassification.
[0038] Regarding single-sample inference latency, the method of this invention achieves 39.4ms, a reduction of 3.3ms compared to the traditional method's 42.7ms. This invention leverages an online sequential extreme learning machine structure, resulting in lower computational load during the inference phase. Furthermore, the medical knowledge constraints employ a fixed mapping method, incurring no additional computational overhead, thus improving inference efficiency.
[0039] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A machine learning-based method for classifying medical data, characterized in that, Includes the following steps: Acquire heterogeneous medical data from multiple sources, including electronic medical record systems, laboratory testing systems, and monitoring devices; preprocess the data; and generate standardized medical datasets. Multiple types of medical semantic features are extracted from standardized medical datasets and aggregated to generate a medical semantic feature set; Encode, align, and fuse various features in the medical semantic feature set to generate a unified latent space feature vector. The unified latent space feature vector is input into an online sequential extreme learning machine for medical constraint and logical correction classification processing to generate medical consistency category prediction results. A training sample set is constructed based on historical medical data to identify disease categories with few samples and rare diseases, and sampling probabilities and category weights are generated according to the sample proportions. The training loop is driven by sampling probability and class weights. The model parameters of the online sequential extreme learning machine are updated. The updated online sequential extreme learning machine is used to perform forward inference on the medical data to be classified and output the corresponding class prediction results.
2. The medical data classification method based on machine learning according to claim 1, characterized in that, The multi-source heterogeneous medical data includes medical record text data, test indicator data, and time-series monitoring data. The preprocessing includes format standardization, encoding unification, noise removal, and missing value imputation.
3. The medical data classification method based on machine learning according to claim 1, characterized in that, The generation of the medical semantic feature set specifically includes: Sentence segmentation, word segmentation and medical named entity recognition are performed on medical record text data in standardized medical datasets. Text fragments corresponding to symptoms, signs, examination items, diagnosis conclusions and medication records are extracted, and each text fragment is labeled with field type, time information and body part information. The extracted fields are matched with a medical terminology database, and the fields are standardized according to synonym and hierarchical relationships to generate structured field records. Based on structured field records, the sequential and relational relationships of symptoms, signs, examination items, diagnostic conclusions, and medication records are extracted and generated into a structured semantic chain according to patient identification and consultation time. The statistical results of various fields are statistically analyzed based on the structured semantic chain. The statistical results are combined according to a preset structural format, and the combined statistical attributes are used as structured medical semantic features. The statistical results include the number of times the field appears in the structured semantic chain, the duration of the field in the time series, and the time association features between the field and its predecessor and successor fields based on the time interval and order relationship. Based on the test index data in the standardized medical dataset, the difference between the measured value and the upper and lower limits of the reference range and the proportion of the measured value deviating from the reference range are calculated. The above differences and proportions are combined according to the test index categories to obtain high-order medical semantic features. Based on time-series monitoring data in a standardized medical dataset, the data is divided into multiple time segments along the time axis. The trend increase / decrease, fluctuation amplitude, rate of change, and rhythm cycle are calculated for each time segment, and the status label of each time segment is determined. The above attributes and status labels are connected in chronological order to obtain time-series semantic features. Structured medical semantic features, higher-order medical semantic features, and temporal semantic features are aligned and concatenated according to patient identification and consultation time to generate a set of medical semantic features.
4. The medical data classification method based on machine learning according to claim 1, characterized in that, The generation of the unified latent space feature vector specifically includes: The structured medical semantic features, higher-order medical semantic features, and temporal semantic features in the medical semantic feature set are divided according to feature source and feature type, and the discrete features and continuous features in each type of feature are distinguished. Discrete features are mapped to integer index values according to a preset category coding rule. Integer index values are mapped to fixed-length numerical feature vectors according to a preset lookup table. Continuous features are subjected to interval scaling and scale normalization according to a preset numerical scaling rule. The normalized continuous features are then appended to the corresponding numerical feature vectors to generate an initial encoded feature vector sequence. The initial encoded feature vector sequence is aligned according to a preset target dimension to obtain aligned encoded feature vectors; The aligned coding feature vectors are aggregated according to medical semantic records. The coding feature vectors in the same record are connected in order of feature type to form a continuous feature vector. The feature components in the continuous feature vector are weighted and summed with their corresponding weight coefficients to generate a multi-source fusion coding result. The multi-source fusion encoding results are subjected to element-wise transformation and overall mapping according to a preset nonlinear mapping rule to generate a unified latent space feature vector.
5. The medical data classification method based on machine learning according to claim 1, characterized in that, The generation of the category prediction results for medical consistency specifically includes: The input vector is constructed based on the feature component order of the unified latent space feature vector and associated with the sample identifier; The input vector is weighted by the random connection weight coefficients of the hidden layer of the online sequential extreme learning machine, and the result is biased by a preset bias coefficient to generate the original output vector of the hidden layer. Based on the medical knowledge graph, the dependencies, prohibitions and stage relationships between medical entities are classified. The numerical fields, applicable field ranges and relationship identifiers of each relationship are extracted in sequence and combined according to a preset structure format to generate the knowledge constraint parameters of the corresponding relationship. Based on the index of each feature component in the unified latent space feature vector, the knowledge constraint parameters are mapped to the corresponding feature components in the original output vector of the hidden layer to form a constraint mask structure. The feature components of the original output vector of the hidden layer are subjected to numerical scaling, suppression and stage numerical adjustment according to the constraint mask structure to obtain the hidden layer constraint output vector. The hidden layer constraint output vector is input into the incremental update module of the online sequential extreme learning machine. According to the incremental update rule, the output weight matrix of the previous time step is updated by matrix inversion, the weight statistics are updated according to the input records, and the output layer parameter statistics are updated according to the class target vector to obtain the updated output weight matrix. The hidden layer constraint output vector is weighted and the updated output weight matrix is weighted. The output components corresponding to each category are read in order of category index according to the output layer mapping rule and combined into the original category distribution vector. Based on the dependency, prohibition and stage relationships between medical categories in the medical knowledge graph, medical logic correction rules are constructed, and each rule is represented as a medical logic correction parameter including a logical weight coefficient, applicable category range and logical type identifier; Based on the medical logic correction parameters, the class probabilities of the original class distribution vector are sequentially subjected to numerical attenuation and amplification processing according to the logical weight coefficients, and the adjusted class probabilities are then normalized. The normalized category probabilities are read according to the category index order, the probability values corresponding to each category are determined, the category index with the largest probability value is determined, the corresponding category label is retrieved from the preset category mapping table as the output, and the category prediction result of medical consistency is generated.
6. The medical data classification method based on machine learning according to claim 1, characterized in that, The generation of the sampling probability and class weight specifically includes: Extract heterogeneous medical data from multiple sources from historical medical data with real category labels, and perform field organization and standardization according to a preset format to generate training sample records; Features are extracted from each training sample record and mapped to generate a unified latent space feature vector. The unified latent space feature vector is then bound to the corresponding real class label to generate training sample entries. All training sample items are categorized according to the true category labels, the number of samples in each category is counted, and the proportion of each category in all samples is calculated. The sample proportions of each category are compared according to a preset sample proportion threshold. When the sample proportion is lower than the low sample proportion threshold, it is marked as a low sample category. When the true category label of the sample belongs to the preset rare disease list and the sample proportion is lower than the rare disease proportion threshold, it is marked as a rare disease category. The sampling intensity is calculated based on the sample ratio and the sampling probability is generated by normalizing it according to the total amount. Initial class weights are generated based on the sampling probability, and numerical amplification is performed on the weights of classes with few samples and rare diseases to generate class weights.
7. The medical data classification method based on machine learning according to claim 1, characterized in that, The generation of the corresponding category prediction results specifically includes: Load the sampling probabilities and class weights of each category into the parameter storage structure of the training loop, and initialize the training round index to the starting round; In the current training round, random sampling of training sample items by category is performed according to the sampling probability recorded in the training cycle to generate a subset of training samples for the current training round, and training feature batch and training label batch are constructed. The training feature batch is input into the online sequential extreme learning machine. Forward inference is performed on each unified latent space feature vector in the training feature batch to obtain the corresponding original class distribution vector. The original class distribution vector is then aligned with the true class labels in the training label batch to obtain the training inference result set. For each record in the training inference result set, calculate the sample-level prediction uncertainty index, and aggregate the uncertainty indices of each category to obtain the category-level prediction uncertainty index; For each record in the training inference result set, calculate the sample-level loss value, and perform weighted processing according to the class weights of the records in the training loop to generate the weighted loss value of the current training round. Then, update the parameters of the online sequential extreme learning machine model based on the weighted total loss value. After updating the model parameters for the current training round, the class weights and sampling probabilities are dynamically updated based on the category-level prediction uncertainty index. The updated class weights and sampling probabilities are then written into the training loop for use in the next training round. After completing the preset training rounds or meeting the training termination conditions, the updated online sequential extreme learning machine is used to perform forward inference processing on the medical data to be classified, and output the category prediction results corresponding to the medical data to be classified.