An electronic medical record quality control method, device and medium based on multi-model cooperation

By constructing a lightweight quality control model pair through a multi-model collaborative approach, the problems of low efficiency and insufficient accuracy in electronic medical record quality control are solved, and efficient and accurate medical record quality control is achieved.

CN123182884APending Publication Date: 2026-11-27SINGULARITY INTELLIGENCE (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611633708.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-21
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies are inefficient and lack accuracy in electronic medical record quality control, making it difficult to effectively identify complex semantic and logical errors. Furthermore, lightweight models are at risk of degrading detection accuracy.

Method used

A multi-model collaborative approach is adopted. By constructing fused feature vectors and clustering, core sample sets are selected and input into large models in parallel to generate lightweight quality control model pairs. Combined with error risk index and distillation technology, lightweight quality control model pairs are generated to achieve efficient inference and accurate detection.

Benefits of technology

While ensuring the accuracy of medical record error detection, the model is lightweight and efficient inference is achieved, reducing the consumption of computing resources and improving the efficiency and accuracy of medical record quality control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123182884A_ABST
    Figure CN123182884A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of large model processing, in particular to an electronic medical record quality control method and device based on multi-model cooperation and a medium, the method comprises: acquiring historical electronic medical records and extracting multi-modal data to construct a fusion feature vector, thereby calculating the processing complexity coefficient of the historical electronic medical records and clustering to generate multiple historical electronic medical record clusters, screening a core sample set from each electronic medical record cluster, inputting a double large model in parallel to obtain the detection confidence of each medical record error type, determining the error risk index of the core sample set, distilling the knowledge of the double large model to the corresponding student model based on the error risk index, generating a pair of lightweight quality control models, performing performance evaluation on the pair of lightweight quality control models, and when the evaluation result meets the preset condition, determining the current pair of lightweight quality control models as the target quality control model combination and outputting; the present application realizes the lightweight and efficient reasoning of the model under the premise of ensuring the accuracy of medical record error detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of large model processing technology, and in particular to a method, device and medium for quality control of electronic medical records based on multi-model collaboration. Background Technology

[0002] Electronic medical records (EMRs) are the core data foundation for medical data governance and health insurance payment. Their data quality directly affects the accuracy of DRG / DIP payment and the credibility of clinical decision support. Currently, EMR quality control mainly relies on manual sampling and rule verification: manual methods are inefficient and costly, and cannot handle massive amounts of medical record data; rule verification can only detect explicit problems such as missing fields and format errors, and lacks the ability to identify factual errors such as drug dosage conflicts and diagnostic coding mismatches, as well as semantic and logical errors such as contradictions between the chief complaint and diagnosis, and conflicts in the timeline of disease progression.

[0003] In recent years, large language models have been attempted for medical record quality control, but their large number of parameters, high inference latency, and high resource consumption make them difficult to meet the needs of large-scale real-time processing. Directly training lightweight models also faces the risk of significant accuracy degradation. At the same time, the number of texts and images in different medical records varies greatly, resulting in different processing complexities and resource consumption, which can easily lead to uneven distribution of computing resources and low overall processing efficiency.

[0004] Therefore, how to achieve efficient reasoning of medical record quality control models while ensuring detection accuracy is a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention provides a method, device, and medium for electronic medical record quality control based on multi-model collaboration. By constructing a quality control model for electronic medical records, it achieves lightweight model and efficient reasoning while ensuring the accuracy of medical record error detection, thus solving the problems of low efficiency in manual quality control and accuracy degradation after model compression.

[0006] According to a first aspect of the present invention, a method for quality control of electronic medical records based on multi-model collaboration is provided, comprising the following steps:

[0007] S1. Obtain the historical electronic medical record set, extract multimodal data for each historical electronic medical record, and construct a fused feature vector.

[0008] S2, determine the processing complexity coefficient of each historical electronic medical record based on the fused feature vector, and cluster the historical electronic medical record set based on the fused feature vector and the processing complexity coefficient to generate multiple historical electronic medical record clusters.

[0009] S3. For each historical electronic medical record cluster, a core sample set is selected and input into the trained first-class large model and second-class large model in parallel. Based on the preset medical record error types, the detection confidence of the first-class large model and second-class large model for each medical record error type is obtained, and the error risk index of the core sample set is determined according to the detection confidence.

[0010] S4, based on the error risk index and the preset distillation loss category, distills the knowledge of the first type of large model and the second type of large model into the corresponding pre-built first student model and second student model, respectively, to generate lightweight quality control model pairs.

[0011] S5 evaluates the performance of lightweight quality control model pairs. When the evaluation results meet the preset conditions, the current lightweight quality control model pair is determined as the target quality control model combination and output for use in electronic medical record quality control.

[0012] According to a second aspect of the present invention, a non-transitory computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the above-described multi-model collaborative electronic medical record quality control method.

[0013] According to a third aspect of the present invention, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0014] The present invention has at least the following beneficial effects:

[0015] This invention provides a multi-model collaborative electronic medical record (EMR) quality control method. First, historical EMRs are acquired and multimodal data is extracted to construct a fusion feature vector, achieving a unified representation of heterogeneous multimodal data and providing a rich data foundation for subsequent clustering and quality control analysis. Then, the processing complexity coefficient of historical EMRs is calculated based on the fusion feature vector, and multiple historical EMR clusters are generated by clustering using the fusion feature vector. This clustering method considers both the content features and processing efficiency features of the medical records, ensuring that medical records within the same cluster are both semantically similar and have similar processing efficiency. Finally, a core sample set is selected from each EMR cluster and input into two large models in parallel to obtain error data for each medical record. The detection confidence of error types is used to achieve cross-validation of error detection and improve the rationality of the error risk index of the core sample set. Then, based on the error risk index, the knowledge of the two major models is distilled into the corresponding student models to generate lightweight quality control model pairs. While retaining the core detection capabilities of the original major models, this significantly reduces inference latency and memory usage. Finally, the performance of the lightweight quality control model pairs is evaluated. When the evaluation results meet the preset conditions, the current lightweight quality control model pairs are determined as the target quality control model combination and output. This ensures that the lightweight quality control model pairs achieve both lightweight design and efficient inference while maintaining the accuracy of medical record error detection. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0017] Figure 1 A flowchart of an electronic medical record quality control method based on multi-model collaboration provided in an embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only 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.

[0019] This invention provides a multi-model collaborative method for electronic medical record quality control, such as... Figure 1 As shown, the method includes the following steps:

[0020] S1. Obtain the historical electronic medical record set, extract multimodal data for each historical electronic medical record, and construct a fused feature vector.

[0021] Specifically, the multimodal data includes structured data, unstructured text data, and image data. For example, structured data includes, but is not limited to, patient basic information, test results, diagnostic codes, medication records, surgical codes, and other data with fixed fields and formats; unstructured data includes, but is not limited to, medical records, admission records, discharge summaries, surgical records, examination report text, medical images, pathological slide images, and other data in free text or image format.

[0022] Furthermore, the construction of the fused feature vector includes:

[0023] S101, extract the numerical features, categorical features, and coded features from the structured data and represent them as vectors to obtain a structured feature vector. For example, numerical features include age and test values, categorical features include gender and department, and coded features are ICD-10 codes.

[0024] S102, the text data is segmented, medical entity recognized, lexical denoising is performed, and vectorized representation is obtained to obtain text feature vectors. The Word2Vec model can be used for vectorization.

[0025] S103, after filtering the image data by size, the image feature vector is extracted using a convolutional neural network. In a specific implementation, irrelevant images smaller than a preset size threshold, such as logos and icons, are filtered out, retaining only valid medical image information. Then, a convolutional neural network, such as a CNN network, is used to extract the image feature vector.

[0026] S104, the structured feature vector, text feature vector, and image feature vector are concatenated to generate a fused feature vector. During concatenation, the weighting coefficients can be dynamically adjusted based on the contribution of various data types to the clustering effect in practical applications.

[0027] As described above, by adopting appropriate feature extraction methods for different types of data and constructing fused feature vectors, a unified representation of heterogeneous multimodal data is achieved. This can comprehensively cover the multidimensional information of electronic medical records, providing a rich data foundation for subsequent clustering and quality control analysis, and avoiding processing biases caused by the lack of information in a single modality.

[0028] S2, determine the processing complexity coefficient of each historical electronic medical record based on the fused feature vector, and cluster the historical electronic medical record set based on the fused feature vector and the processing complexity coefficient to generate multiple historical electronic medical record clusters.

[0029] Specifically, step S2 includes the following steps:

[0030] S201: Based on the number of texts, images, tables, and total data volume of each historical electronic medical record, calculate the contribution values ​​for text complexity, image complexity, table complexity, and total data volume complexity, respectively. Then, weighted summation of these complexity contributions yields the processing complexity coefficient for each historical electronic medical record. This can be understood as the processing complexity coefficient characterizing the processing time and memory usage of historical electronic medical records, where the weights of each complexity contribution are pre-set. In specific implementations, the number of texts can be the number of paragraphs in the medical record, the number of examination report texts, etc.; the number of images can be the number of images after size filtering; the number of tables is the number of structured tables included in the electronic medical record; and the total data volume is the total storage size of a single electronic medical record file, in KB or MB.

[0031] Preferably, the text complexity contribution value y1 = log2(H1+1), where H1 is the number of texts; the image complexity contribution value y2 = θH2, where θ is a preset processing coefficient with a value greater than 1, and H2 is the number of images; the table complexity contribution value y3 = log2(H3+1), where H3 is the number of tables; and the total data complexity contribution value y4 = log2(H4+1), where H4 is the total data volume.

[0032] S202, sort all historical electronic medical records according to the processing complexity coefficient and select N historical electronic medical records as the initial cluster centers; this can be understood as: selecting the medical records at the N quantiles in the sorting results as the initial cluster centers.

[0033] Specifically, minimizing the differences in processing efficiency and resource consumption among core samples within the same historical electronic medical record cluster as the clustering objective means making the processing complexity coefficients of each medical record within the same cluster as close as possible, thereby ensuring that electronic medical records within the cluster can be processed using uniform rules without creating efficiency bottlenecks.

[0034] S203, with the clustering objective of minimizing the differences in fusion features, processing efficiency, and resource consumption among core samples within the same historical electronic medical record cluster, calculates the weighted distance from each historical electronic medical record to each cluster center based on the fusion feature vector of each historical electronic medical record. Based on the weighted distance, each historical electronic medical record is assigned to the nearest cluster, and the cluster centers are updated. The weighted distance is obtained by weighting and correcting the initial distance between any two historical electronic medical records using a processing complexity coefficient, so that medical records with similar processing complexity are preferentially clustered into the same cluster. The Gower distance algorithm can be used to calculate the initial distance between two historical electronic medical records; that is, the initial distance is used to characterize the matching degree of the fusion feature vectors of the two historical electronic medical records.

[0035] Specifically, the formula for calculating the weighted distance is as follows:

[0036] D = D0 × (1 + μ × |C1 - C2| / (C max -C min In this context, D is the weighted distance, D0 is the initial distance, μ is the preset complexity difference penalty coefficient (ranging from 0 to 1), C1 and C2 are the processing complexity coefficients of the two historical electronic medical records, and C... max C min These represent the maximum and minimum processing complexity coefficients across all historical electronic medical records.

[0037] S204, iteratively execute step S203 until the center of each cluster no longer changes or the preset maximum number of iterations is reached, generating N historical electronic medical record clusters.

[0038] The above-mentioned data is used to calculate the processing complexity coefficient by weighting the data volume of multiple dimensions such as text, images, and tables, and then clustering them. This ensures that the clustering criteria take into account both the content characteristics and processing efficiency characteristics of the medical records, so that the medical records in the same cluster are both semantically similar and have similar processing efficiency. This facilitates the use of a unified model and rules for batch quality control in the future, while ensuring the balanced allocation of processing resources.

[0039] S3. For each historical electronic medical record cluster, a core sample set is selected and input into the trained first-class large model and second-class large model in parallel. Based on the preset medical record error types, the detection confidence of the first-class large model and second-class large model for each medical record error type is obtained, and the error risk index of the core sample set is determined according to the detection confidence, so as to characterize the overall error risk level of the corresponding historical electronic medical record cluster.

[0040] Preferably, a core sample set is selected for each historical electronic medical record cluster, including the following steps:

[0041] For each historical electronic medical record cluster, a composite centroid is obtained; the composite centroid is determined by the mean of the fused feature vectors of all samples within the historical electronic medical record cluster and the mean of the processing complexity coefficient.

[0042] Furthermore, the composite centroid is obtained by calculating the distance from the sample to the center of the semantic feature space and the distance from the sample to the center of the complexity feature space, respectively, and then performing a weighted fusion. Here, the center of the semantic feature space refers to the mean of the fused feature vectors, and the center of the complexity feature space refers to the mean of the processing complexity coefficients.

[0043] For each historical electronic medical record within each historical electronic medical record cluster, calculate the mixed representativeness distance B from the historical electronic medical record to the composite centroid. ,in, Let C be the squared Euclidean distance between the i-th historical electronic medical record in the historical electronic medical record cluster and the composite centroid on the fused feature vector, used to characterize the semantic dimension fit, where ε is the balance coefficient, 0 < ε < 1. i Let be the processing complexity coefficient of the i-th historical electronic medical record within the historical electronic medical record cluster. σ represents the mean processing complexity coefficient of historical electronic medical records within the historical electronic medical record cluster, and σ represents the standard deviation of the processing complexity coefficient of historical electronic medical records within the historical electronic medical record cluster.

[0044] The mixed representative distances are sorted from smallest to largest, and the top K historical electronic medical records are selected as the core samples of the corresponding historical electronic medical record clusters to form the core sample set.

[0045] The above approach comprehensively considers both semantic features and processing efficiency by using hybrid representativeness distance to ensure that the selected core samples can represent the semantic theme of the cluster and reflect the overall processing complexity level of the cluster. Furthermore, by selecting a core sample set instead of using all medical records within the cluster for dual-model inference, the consumption of computing resources and inference time are significantly reduced.

[0046] Specifically, the preset medical record error types include objective fact types and semantic logic types. In specific implementations, a unified tag benchmark library is constructed for comparison. The tag benchmark library includes, but is not limited to, disease tags, treatment behavior tags, cost classification tags, and medical service item tags, and is equipped with standardized dictionaries, value ranges, logical constraint rules, and other information. Those skilled in the art can use this information to set several medical record error types.

[0047] The objective fact category includes at least the following types of medical record errors: drug dosage conflict, discrepancy between medication and allergy history, mismatch between diagnostic codes and patient condition, non-compliant treatment procedures, and drug incompatibilities. For example, a doctor's order for "potassium chloride injection 15ml / h intravenous bolus" may be incorrect if the drug's instructions specify a maximum safe bolus rate of 10ml / h, constituting a drug dosage conflict. Similarly, a historical electronic medical record may show a positive penicillin allergy history, but the doctor's order still includes amoxicillin, constituting a discrepancy between medication and allergy history.

[0048] The semantic logic categories include medical record errors of at least the following types: contradiction between the chief complaint and diagnosis, conflict in the timeline of the medical record, missing key clinical indicators, and inconsistencies in the diagnosis and treatment logic. For example, the chief complaint may state "recurrent chest pain for 1 year, worsening with profuse sweating for 1 hour," but the preliminary diagnosis may state upper respiratory tract infection. The clinical correlation between chest pain and upper respiratory tract infection is extremely weak, constituting a contradiction between the chief complaint and diagnosis. Similarly, the admission record may state "20-year history of hypertension," but the initial medical record may state "previously healthy, no history of hypertension," constituting a conflict in the timeline of the medical record.

[0049] Furthermore, the step of obtaining the detection confidence scores of the first and second large-scale models for each type of medical record error based on preset medical record error types, and determining the error risk index of the core sample set based on the detection confidence scores, includes the following steps:

[0050] S301, for the same core sample, obtain the first detection confidence of each medical record error type output by the first type of large model and the second detection confidence of each medical record error type output by the second type of large model, and calculate the consistency index characterizing the degree of consistency between the first type of large model and the second type of large model in judging the medical record error type; wherein, each medical record error type corresponds to a first detection confidence and a second detection confidence.

[0051] Specifically, for any type of medical record error, the consistency index is the ratio of the minimum to the maximum value of the first and second detection confidence scores corresponding to that type of medical record error.

[0052] Specifically, the first and second major models are based on different architectures. The first major model is a rule-enhanced model, which relies on a professional medical knowledge graph and a standardized medical rule base, including a drug incompatibilities database, ICD disease coding rules, and treatment guidelines database, and has undergone fine-tuning and optimization. Its output head focuses on evaluating objective factual errors, but also covers the evaluation of semantic logic errors. The second major model is a generative semantic reasoning model, built on a Transformer decoder architecture. Its output head focuses on deep semantic understanding and clinical logic deduction, identifying implicit and non-rule-based errors, and also covers the semantic understanding of objective factual errors. The detection confidence scores output by the two major models are used for cross-validation and complementary enhancement.

[0053] S302, determine the sample confidence level of each core sample based on the distance from each core sample to the composite centroid of its corresponding historical electronic medical record cluster. That is, the distance from each core sample to the composite centroid of its corresponding historical electronic medical record cluster refers to the mixed representativeness distance B from the core sample to the composite centroid.

[0054] Specifically, for any core sample, the formula for calculating the sample confidence ρ of the core sample is as follows:

[0055] ρ=exp(-B 2 / (2×ξ 2 )), where ξ is the kernel bandwidth parameter of the historical electronic medical record cluster where the core sample is located, and its value is the standard deviation of the mixed representative distance of all samples in the cluster.

[0056] S303, based on the first detection confidence level, the second detection confidence level, the consistency index, and the sample confidence level, and combined with the preset error severity weighting coefficient used to characterize the risk level of each medical record error type, a weighted fusion is performed to obtain the error risk score of each core sample.

[0057] Specifically, the calculation process for the error risk score Q of the core sample is as follows:

[0058] When either the first detection confidence level or the second detection confidence level exceeds the preset confidence threshold, ,otherwise, Where M is the number of medical record error types corresponding to the core sample itself, and E m1 and E m2 α, β, and γ are the first and second detection confidence levels for the m-th error type in the medical record, respectively, and the preset weighting coefficients are α, β, and γ.

[0059] S304, the error risk scores of each core sample are weighted and averaged to obtain the error risk index of the corresponding core sample set.

[0060] As described above, by using a differentiated dual-model architecture to output detection confidence and calculate consistency index for each error type in medical records, cross-validation of error detection is achieved, improving the accuracy and reliability of error identification. At the same time, the introduction of sample confidence and error severity weighting coefficients ensures that highly representative samples and high-risk errors have higher weights in the cluster-level error risk index, ensuring that the evaluation results focus on key samples and key errors, and improving the rationality of the error risk index.

[0061] S4, based on the error risk index and preset distillation loss categories, distills the knowledge of the first and second major models into corresponding pre-built first and second student models, respectively, generating lightweight quality control model pairs. That is, through these lightweight quality control model pairs, objective factual errors and semantic logic errors are detected in electronic medical records to achieve quality control. The student model refers to a lightweight neural network model compressed from the teacher model using knowledge distillation technology. Its parameter count is much smaller than the teacher model, resulting in faster inference speed and lower resource consumption. Simultaneously, the core detection capabilities of the teacher model are preserved through distillation training; it can be understood that the teacher models are the first and second major models. In specific implementation, the first student model adopts a streamlined Transformer Encoder architecture, retaining the same multi-label classification output head as the first major model to ensure that the discrimination dimension for objective factual error types is not lost. The second student model adopts a streamlined Transformer Decoder architecture, retaining the same text generation and anomaly probability prediction dual output heads as the second major model to ensure that the deep reasoning ability for semantic logic errors is not affected. The number of parameters in the student model is set to 1 / 10 to 1 / 5 of the number of parameters in the corresponding teacher model. The specific compression ratio can be adaptively adjusted according to the hardware computing power and memory resource constraints of the deployment environment. During initialization, the original weights of the corresponding teacher model can be directly used for pruning or dimensionality reduction initialization, preserving the medical semantic representations already learned by the teacher model.

[0062] Specifically, the process of distilling the knowledge from the first type of large model and the second type of large model into the corresponding pre-constructed first student model and second student model, respectively, includes the following steps:

[0063] S410, determine the distillation weight coefficient for each core sample set based on its error risk index; the higher the error risk index, the larger the corresponding distillation weight coefficient. For example, the ratio of the error risk index of any core sample set to the sum of the error risk indices of all core sample sets is used as the distillation weight coefficient for that core sample set. That is, the higher the error risk index, the greater the error risk of the historical electronic medical record cluster corresponding to that core sample set, and the higher the optimization weight should be assigned during the distillation process to ensure that the error detection capability of high-risk areas is preferentially retained during model lightweighting.

[0064] S420 calculates the soft-label distillation loss and hard-label distillation loss during the distillation process. The soft-label distillation loss is used to constrain the difference in error class probability distribution between each student model and the corresponding large model; the hard-label distillation loss is used to constrain the difference between the prediction results of each student model and the true labels. The soft-label and hard-label distillation losses are loss functions commonly used by those skilled in the art, and will not be elaborated further here.

[0065] S430, calculate the collaborative consistency distillation loss; the collaborative consistency distillation loss is used to constrain the collaborative decision consistency between the first student model and the second student model to approach the collaborative decision consistency between the first type of large model and the second type of large model.

[0066] Specifically, for each core sample in the core sample set, the similarity between the detection confidence scores of the two large models belonging to the teacher model on various types of errors is calculated, as well as the similarity between the detection confidence scores of the two student models. Then, the difference between the two is constrained to be minimized. That is, the difference in similarity before and after distillation is used as the loss term, so that the student model learns the knowledge of the single large model while also learning the collaborative pattern between the two models.

[0067] S440, calculate the difference-preserving regularization term among the core sample sets; the difference-preserving regularization term is used to constrain the differences between the student model prediction distributions corresponding to different core sample sets. Specifically, for each core sample set, calculate the average prediction distribution of that core sample set on the student model, representing the overall decision characteristics of that core sample set; then calculate the KL divergence between the current core sample set and the average prediction distributions of all other core sample sets, and add its negative value as a regularization term to the total distillation loss. By maximizing the difference in prediction distributions among different core sample sets, the discriminative power of each cluster's decision patterns on the student model is maintained, thereby avoiding model degradation caused by mutual interference of multi-cluster knowledge during the distillation process.

[0068] S450: For any core sample set, the distillation weight coefficients of the core sample set are used as global basic weights. The soft label distillation loss, hard label distillation loss, collaborative consistency distillation loss, and difference preservation regularization term are weighted and summed to obtain the total distillation loss of the core sample set. The parameters of each student model are then updated based on the total distillation loss of each core sample set. This can be understood as: updating the parameters of the first and second student models through backpropagation algorithm based on the total distillation loss to complete one round of knowledge distillation.

[0069] Specifically, the expression for the total distillation loss L of the core sample set is as follows:

[0070] L = ω × [η1 × L1 + η2 × L2 + η3 × L3 + η4 × L4], where ω is the distillation weight coefficient, L1, L2, L3 and L4 are the soft-label distillation loss, hard-label distillation loss, coherent consistency distillation loss and difference preservation regularization term, respectively, and η1, η2, η3 and η4 are the preset weight coefficients of each loss term.

[0071] As described above, by performing differentiated distillation based on the error risk index, the key error detection capabilities are ensured to be retained first during the model lightweighting process. Through multi-dimensional loss constraints, the complementary synergistic mechanism of the two models and the differentiation of the decision patterns of each cluster are preserved. Furthermore, through knowledge distillation, the two large models with a large number of parameters are compressed into a lightweight student model pair, which significantly reduces inference latency and memory usage while retaining the core detection capabilities of the original large model.

[0072] S5 performs performance evaluation on the lightweight quality control model pair. When the evaluation results meet preset conditions, the current lightweight quality control model pair is determined as the target quality control model combination and output for use in electronic medical record quality control. That is, during detection, error type labels for medical records are identified.

[0073] Specifically, the performance evaluation of the lightweight quality control model includes the following steps when the evaluation results meet preset conditions:

[0074] S501, input each core sample set into the lightweight quality control model pair, and calculate the internal stability index corresponding to the first student model and the second student model on each core sample set respectively; the internal stability index is used to characterize the degree of dispersion of the prediction results of the first student model or the second student model on each core sample within the same core sample set.

[0075] Specifically, for any core sample set, the formula for calculating the internal stability index P1 of the first learning model is:

[0076] Where Z is the number of samples in the core sample set, f j This represents the feature representation output by the first student model for the j-th core sample. Let be the mean of the feature representations output by the first student model for N core samples within the core sample set. This is the L2 norm. Similarly, the calculation method for the internal stability index of the second learning model is the same as that of the first learning model, and will not be repeated here.

[0077] S502, calculate the accuracy degradation coefficients corresponding to the first student model and the second student model on each core sample set; the accuracy degradation coefficients are used to characterize the decrease in accuracy of the first student model or the second student model compared to the corresponding large model in terms of detection accuracy.

[0078] Specifically, the accuracy degradation coefficient ΔA1 for the first student model is calculated as (A0 - A) / A0, where A0 is the detection accuracy of the first model on the core sample set, and A is the detection accuracy of the first student model on the same core sample set. Detection accuracy refers to the proportion of correctly detected samples to the total number of samples, calculated by comparing the incorrect detection results output by the corresponding model with the true labels for each core sample in the core sample set. Similarly, the accuracy degradation coefficient for the second learning model is calculated in the same way as that for the first learning model, and will not be repeated here.

[0079] S503, when the internal stability index of all core sample sets is higher than the first preset threshold, and the accuracy degradation coefficient of all core sample sets is lower than the second preset threshold, the evaluation result is determined to meet the preset conditions. Those skilled in the art can set the first and second preset thresholds according to actual needs.

[0080] The above-mentioned multi-dimensional performance evaluation of the lightweight model through internal stability indicators and accuracy degradation coefficients verifies the quality control capability of the lightweight model, ensuring that the distilled model meets the business accuracy requirements. By outputting a target quality control model combination containing two complementary student models, the lightweight quality control model ensures that it has reliable automated medical record quality control performance and generalization ability while maintaining efficient inference.

[0081] Furthermore, the method further includes the following steps:

[0082] S10, when the evaluation results do not meet the preset conditions, obtain the measured inference time and measured memory usage of the lightweight quality control model for processing each core sample set, and calculate the efficiency gain coefficient. The measured memory usage is the peak memory usage of the lightweight quality control model for processing a single core sample set.

[0083] Specifically, the formula for calculating the efficiency gain coefficient G1 corresponding to the first student model in the lightweight quality control model pair is as follows:

[0084] G1 = (T / T0)·(U / U0), where T and U are the average inference time and average memory usage of the first large model for processing any core sample set, respectively, and T0 and U0 are the measured average inference time and measured average memory usage of the first student model for processing any core sample set, respectively. Similarly, the efficiency gain coefficient G2 corresponding to the second learning model is calculated in the same way as the efficiency gain coefficient G1 corresponding to the first learning model, and will not be repeated here.

[0085] S20 generates an accuracy adjustment factor based on the comparison between the accuracy degradation coefficient of each core sample set and the preset maximum tolerance threshold.

[0086] Specifically, the formula for calculating the precision adjustment factor ζ is as follows: Where δ1 is a preset precision influence weighting coefficient. A is the average of the two accuracy degradation coefficients corresponding to the core sample set. max This is the preset maximum tolerance threshold. Its core logic is: the more severe the accuracy degradation after the current distillation round, the lower the tolerance threshold. The larger the value, the greater the processing complexity coefficient in the next iteration, making the clustering more refined and rigorous. This reduces the range of differences the model needs to adapt to during distillation, thus suppressing the tendency to sacrifice accuracy for excessive efficiency and achieving a dynamic trade-off between efficiency and accuracy.

[0087] S30 generates a stability adjustment factor based on the standard deviation of the processing complexity coefficients of core samples within each core sample set.

[0088] Specifically, the stability adjustment factor τ for any core sample set is calculated as follows: τ = 1 - δ² × (φ - φ max ), where δ2 is the preset stability influence weight coefficient, and φ is the standard deviation of the processing complexity coefficient of the core samples in the core sample set. max This represents the maximum value among the standard deviations of the processing complexity coefficients corresponding to each core sample set.

[0089] S40, integrate the efficiency gain coefficient, accuracy adjustment factor and stability adjustment factor, update the processing complexity coefficient and return to step S2, until the evaluation result meets the preset conditions or reaches the upper limit of the number of iterations.

[0090] Specifically, for any core sample set, the update formula for the corresponding processing complexity coefficient C is:

[0091] C = C0 × G × ζ × τ, where C0 is the current processing complexity coefficient before correction, and G is the mean of G1 and G2.

[0092] As mentioned above, when the evaluation fails to meet the standard, the efficiency gain coefficient is calculated by measuring the inference time and memory usage in actual tests. The accuracy adjustment factor and stability adjustment factor are generated by combining the degree of accuracy degradation and the fluctuation of intra-cluster complexity. The complexity coefficient is updated by combining the three factors and then the clustering is re-iterated to achieve adaptive optimization of the model efficiency and accuracy trade-off until the performance requirements are met.

[0093] Embodiments of the present invention also provide a non-transitory computer-readable storage medium that can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a method in the method embodiments, wherein the at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiments.

[0094] Embodiments of the present invention also provide an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0095] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of the invention. It should also be understood that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.

Claims

1. A quality control method for electronic medical records based on multi-model collaboration, characterized in that, The method includes the following steps: S1, Obtain the historical electronic medical record set, extract multimodal data of each historical electronic medical record and construct a fusion feature vector; S2, determine the processing complexity coefficient of each historical electronic medical record based on the fused feature vector, and cluster the historical electronic medical record set based on the fused feature vector and the processing complexity coefficient to generate multiple historical electronic medical record clusters; S3. For each historical electronic medical record cluster, a core sample set is selected and input into the trained first-class large model and second-class large model in parallel. Based on the preset medical record error types, the detection confidence of the first-class large model and second-class large model for each medical record error type is obtained, and the error risk index of the core sample set is determined according to the detection confidence. S4, based on the error risk index and the preset distillation loss category, distills the knowledge of the first type of large model and the second type of large model into the corresponding pre-built first student model and second student model, respectively, to generate lightweight quality control model pairs; S5 evaluates the performance of lightweight quality control model pairs. When the evaluation results meet the preset conditions, the current lightweight quality control model pair is determined as the target quality control model combination and output for use in electronic medical record quality control.

2. The electronic medical record quality control method based on multi-model collaboration according to claim 1, characterized in that, The multimodal data includes structured data, unstructured text data, and image data; the construction of the fused feature vector includes: S101, extract numerical features, categorical features and coded features from the structured data and represent them in a vectorized form to obtain a structured feature vector; S102, the text data is segmented into words, medical entity recognition is performed, vocabulary denoising is performed and vectorized representation is performed to obtain text feature vectors; S103, After filtering the image data by size, the image feature vector is extracted by a convolutional neural network; S104, the structured feature vector, text feature vector and image feature vector are concatenated to generate a fused feature vector.

3. The electronic medical record quality control method based on multi-model collaboration according to claim 1, characterized in that, Step S2 includes the following steps: S201. Based on the number of texts, images, tables, and total data volume of each historical electronic medical record, calculate the text complexity contribution value, image complexity contribution value, table complexity contribution value, and total data volume complexity contribution value respectively, and perform a weighted summation of each complexity contribution value to obtain the processing complexity coefficient of each historical electronic medical record. S202, Sort all historical electronic medical records according to the processing complexity coefficient and select N historical electronic medical records as the initial cluster centers; S203, with the clustering objective of minimizing the differences in fusion features, processing efficiency, and resource consumption among core samples within the same historical electronic medical record cluster, calculates the weighted distance from each historical electronic medical record to each cluster center based on the fusion feature vector of each historical electronic medical record, assigns each historical electronic medical record to the nearest cluster according to the weighted distance, and updates each cluster center; the weighted distance is obtained by weighting and correcting the initial distance between any two historical electronic medical records using a processing complexity coefficient; S204, iteratively execute step S203 until the center of each cluster no longer changes or the preset maximum number of iterations is reached, generating N historical electronic medical record clusters.

4. The electronic medical record quality control method based on multi-model collaboration according to claim 1, characterized in that, The preset medical record error types include objective fact types and semantic logic types; among them, The objective fact category includes at least the following types of medical record errors: drug dosage conflict, discrepancy between medication and allergy history, mismatch between diagnostic code and condition, non-compliance of treatment process, and drug incompatibility. The semantic logic class includes medical record error types, including at least contradictions between the chief complaint and the diagnosis, conflicts in the timeline of the medical record, missing key clinical indicators, and contradictory diagnostic and treatment logic.

5. The electronic medical record quality control method based on multi-model collaboration according to claim 1, characterized in that, In step S3, the step of obtaining the detection confidence scores of the first and second large-scale models for each type of medical record error based on preset error types, and determining the error risk index of the core sample set based on the detection confidence scores, includes the following steps: S301, for the same core sample, obtain the first detection confidence of each medical record error type output by the first type of large model and the second detection confidence of each medical record error type output by the second type of large model, and calculate the consistency index characterizing the degree of consistency between the first type of large model and the second type of large model in judging the medical record error type; wherein, each medical record error type corresponds to a first detection confidence and a second detection confidence. S302, determine the sample confidence level of each core sample based on the distance of each core sample to the composite centroid of its respective historical electronic medical record cluster; the composite centroid is determined by the mean of the fused feature vectors of all samples in the historical electronic medical record cluster and the mean of the processing complexity coefficient. S303, based on the first detection confidence level, the second detection confidence level, the consistency index, and the sample confidence level, and combined with the preset error severity weighting coefficient used to characterize the risk level of each medical record error type, a weighted fusion is performed to obtain the error risk score of each core sample; S304, the error risk scores of each core sample are weighted and averaged to obtain the error risk index of the corresponding core sample set.

6. The electronic medical record quality control method based on multi-model collaboration according to claim 1, characterized in that, In step S4, the distillation of the knowledge from the first type of large model and the second type of large model into the corresponding pre-constructed first student model and second student model, respectively, includes the following steps: S410, Determine the distillation weight coefficient of each core sample set based on the error risk index of each core sample set; the higher the error risk index, the larger the corresponding distillation weight coefficient. S420, calculates the soft-label distillation loss and hard-label distillation loss during the distillation process; S430, Calculate the collaborative consistency distillation loss; the collaborative consistency distillation loss is used to constrain the collaborative decision consistency between the first student model and the second student model to approach the collaborative decision consistency between the first type of large model and the second type of large model. S440, Calculate the difference preservation regularization term among the core sample sets; the difference preservation regularization term is used to constrain the differences between the student model prediction distributions corresponding to different core sample sets; S450, for any core sample set, the distillation weight coefficient of the core sample set is used as the global basic weight. The soft label distillation loss, hard label distillation loss, collaborative consistency distillation loss and difference preservation regularization term are weighted and summed to obtain the total distillation loss of the core sample set. The parameters of each student model are updated according to the total distillation loss of each core sample set.

7. The electronic medical record quality control method based on multi-model collaboration according to claim 1, characterized in that, In step S5, the lightweight quality control model is subjected to performance evaluation. When the evaluation results meet preset conditions, the following steps are included: S501, Input each core sample set into the lightweight quality control model pair, and calculate the internal stability index corresponding to the first student model and the second student model on each core sample set respectively; The internal stability index is used to characterize the degree of dispersion of the prediction results of the first student model or the second student model on each core sample within the same core sample set. S502, calculate the accuracy degradation coefficients corresponding to the first student model and the second student model on each core sample set; the accuracy degradation coefficient is used to characterize the decrease in accuracy of the first student model or the second student model compared with the corresponding large model in detection accuracy; S503, when the internal stability index of all core sample sets is higher than the first preset threshold and the accuracy degradation coefficient of all core sample sets is lower than the second preset threshold, the evaluation result is determined to meet the preset conditions.

8. The electronic medical record quality control method based on multi-model collaboration according to claim 7, characterized in that, The method further includes the following steps: S10, when the evaluation result does not meet the preset conditions, obtain the measured inference time and measured memory usage of the lightweight quality control model for processing each core sample set, and calculate the efficiency gain coefficient. S20, generate an accuracy adjustment factor based on the comparison between the accuracy degradation coefficient of each core sample set and the preset maximum tolerance threshold; S30, generate a stability adjustment factor based on the standard deviation of the processing complexity coefficient of the core samples in each core sample set; S40, integrate the efficiency gain coefficient, accuracy adjustment factor and stability adjustment factor, update the processing complexity coefficient and return to step S2, until the evaluation result meets the preset conditions or reaches the upper limit of the number of iterations.

9. A non-transitory computer-readable storage medium, wherein the storage medium stores at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the multi-model collaborative electronic medical record quality control method as described in any one of claims 1-8.

10. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 9.