Emergency intelligent triage method and system based on global attention and position attention
By combining global and location attention mechanisms with diffusion models and LLM, the problems of subjective dependence and insufficient data utilization in emergency triage are solved, achieving efficient and accurate triage decisions and improving the automation and timeliness of the triage system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING EMERGENCY MEDICAL CENT (CHONGQING FOURTH PEOPLES HOSPITAL CHONGQING INST OF EMERGENCY MEDICINE)
- Filing Date
- 2026-03-26
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies in emergency triage suffer from problems such as strong reliance on subjectivity, insufficient data utilization, weak automation capabilities, and insufficient timeliness, especially when dealing with unstructured text information and semantically complex scenarios, making it difficult to achieve efficient and accurate triage.
We employ a method based on global attention and location attention. We extract time information weights and symptom modification relationships from the chief complaint text through location attention, and combine global attention to obtain word combinations and their contextual associations. We use a diffusion model for semantic completion and introduce LLM for risk index prediction. Finally, we integrate the data with structured data for triage decision-making.
It improves the accuracy and efficiency of triage, reduces the risk of misdiagnosis and missed diagnosis, enhances the interpretability and credibility of decision-making, and lowers the application threshold and promotion costs.
Smart Images

Figure CN122290920A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent emergency triage technology, specifically to an intelligent emergency triage method and system based on global attention and location attention. Background Technology
[0002] In emergency medicine services, patient triage is a crucial link in ensuring the efficiency of emergency care and the rational allocation of medical resources. Traditional emergency triage methods usually rely on the subjective judgment of nurses or doctors to quickly assess unstructured and semi-structured information such as chief complaints and vital signs, and make decisions based on international standard scoring models such as ESI (Emergency Severity Index) or CTAS (Canadian Triage and Acuity Scale).
[0003] However, the following main problems currently exist:
[0004] 1. High reliance on subjectivity: The manual triage process depends on the experience of the personnel, and there are differences in judgment between different triage personnel, resulting in a lack of consistency; 2. Insufficient data utilization: Unstructured text information such as chief complaint and past medical history is usually not fully utilized, and triage based solely on limited structured information may be distorted; 3. Weak automation capability: Most intelligent triage systems are based only on rules, scoring tables, or shallow models, making it difficult to cope with real-world scenarios with complex semantics or ambiguous chief complaints; 4. Insufficient timeliness: Traditional triage processes have difficulty completing high-quality severity assessments in the early stages of a patient's arrival.
[0005] For example, the Chinese patent "An Intelligent Outpatient Triage Method and System Based on a Large Model" (Patent Application No.: CN202510446056.8, Publication No.: CN119964763A). This patented system acquires structured patient data (such as basic information, vital signs, etc.), extracts multi-standard features such as ESI, CTAS, MTS, and ATS through a built-in knowledge graph, scores the data after fusing multi-perspective features, and outputs the final triage priority through a weighted voting mechanism, which is suitable for standardized triage processes in outpatient environments; however, this patent lacks contextual learning capabilities, does not consider introducing semantic retrieval or contextual prompts, and cannot handle scenarios with diverse chief complaint semantics.
[0006] For example, the Chinese patent "An Emergency Patient Triage System Based on Artificial Intelligence" (Patent Application No.: CN202510275104.1, Publication No.: CN119785996A). This patent uses a convolutional neural network model combined with pathological feature matching, based on the patient's question responses and the judgment of the severity of the illness, to achieve rapid judgment of the probability of the disease, generation of consultation content, and optimization of triage results, thereby improving the accuracy and efficiency of triage and reducing misdiagnosis and missed diagnosis; however, it does not make sufficient use of the chief complaint text information, and the text feature extraction is relatively simple, making it unable to accurately capture the severity of the patient's condition.
[0007] It is evident that with the rapid development of LLM technology, the application of text understanding-based tasks (such as text classification, intent recognition, and reasoning) in the medical field is constantly expanding. However, how to apply LLM to clinical complaint analysis, establish an interpretable and quantifiable automated severity prediction mechanism, and further improve the accuracy and efficiency of emergency triage remains a problem that needs to be solved. Summary of the Invention
[0008] To address the problems existing in the prior art, this invention provides an emergency intelligent triage method and system based on global attention and positional attention, which solves the technical problem that the lack of sufficient analysis of clinical complaints in the prior art affects the accuracy and efficiency of emergency triage.
[0009] Emergency intelligent triage methods based on global attention and location attention include:
[0010] S1: Collect all data from patients during pre-hospital emergency care, including structured examination data and unstructured chief complaint texts, and standardize and preprocess the obtained data.
[0011] S2: Extract time information weights, symptom modification and primary and secondary relationships from the chief complaint text through positional attention. At the same time, obtain the correlation between all tokens in the standardized chief complaint text through a global attention mechanism, and further obtain the word combination of danger signals and their contextual relationships to generate the initial semantic vector of the chief complaint.
[0012] S3: To address the issues of short emergency complaint texts and frequent missing key information, a semantic completion mechanism based on a diffusion model is further introduced to generate a semantically completed complaint semantic vector.
[0013] S4: Retrieve the K historical complaints that are most similar to the semantic vector of the complaint within the vector space of the knowledge database, as contextual reference examples;
[0014] S5: Using the K most similar historical complaints as few-shot examples and combining them with the semantic vector of the complaints, assemble the keyword sequence according to a structured format;
[0015] S6: Input the keyword sequence into the LLM so that it selects only from the candidate set {A,B} when generating the first tag token of the answer, where A represents high risk / serious and B represents low risk / not serious; extract the logit of the LLM on A and B and construct the chief complaint risk index (CRI) for subsequent feature fusion.
[0016] S7: Concatenate the weighted Chief Complaint Risk Index (CRI) with the patient's structured feature vector. Import the concatenated vector with multimodal fusion features into the trained triage model and output the final triage level.
[0017] Furthermore, the time information weight refers to focusing on the time adverbs and corresponding time window lengths in the main complaint text through learnable positional encoding, thereby assigning corresponding urgency weights to the symptoms modified by the time adverbs; the modification and primary-secondary relationship of symptoms refers to the enhancement relationship between words representing degree and symptom words based on the position of lexical units, as well as the accompanying relationship between different symptom words.
[0018] Furthermore, the vocabulary combination of the danger signal refers to identifying vocabulary combinations that indicate the urgency of the condition from the reinforcing relationship between words indicating degree and symptom words, as well as the accompanying relationship between different symptom words; the context association refers to identifying information in historical information that is related to the current symptom, and further inferring the potential information of the current symptom.
[0019] Furthermore, the semantic completion mechanism based on the diffusion model specifically involves: constructing a diffusion model conditioned on the initial vector of the chief complaint semantics; training a denoising network with the goal of minimizing the difference between predicted noise and real noise; enabling the network to learn to recover semantics from the noisy complete medical record features; and using the trained denoising network to perform inverse iterative denoising on the standard Gaussian noise to generate the semantically completed chief complaint semantic vector.
[0020] Furthermore, LLM extracts the logit values of candidate tag A and candidate tag B at the first tag token position, which are respectively and Normalize its actions and map them to the chief complaint risk index .
[0021] Furthermore, the LLM described in S6 is deployed using a model distillation method, including: in offline mode, using the LLM as a teacher model to generate a large number of soft labels; training a lightweight student model to fit the output of the teacher model; and finally deploying the trained student model on the hospital terminal.
[0022] Furthermore, S7 uses a pre-trained triage model, mainly including logistic regression model, XGBoost model, etc., and outputs the final triage level by calculating the multi-class prediction probability and taking the maximum value.
[0023] Furthermore, the standardization of structured data in S1 includes: introducing a time decay coefficient for weighted time alignment of indicators; performing unit conversion and Z-score standardization on the aligned indicators; and performing outlier detection and missing value imputation based on preset thresholds, and concatenating the processed indicators into a structured feature vector. The standardization of the chief complaint text includes: segmenting continuous sentences into meaningful words or character units, and then standardizing colloquial or non-standard medical expressions into standard terminology.
[0024] An emergency intelligent triage system based on global attention and location attention includes: a chief complaint and vital signs data acquisition module, a chief complaint encoding module, a semantic completion module, a similar chief complaint retrieval module, a contextual prompt construction module, a severity scoring module, and a triage decision output module;
[0025] The chief complaint and vital signs data acquisition module is used to collect patients' chief complaints, past medical history, basic vital signs and basic demographic information during the emergency registration stage and to perform standardized processing.
[0026] The chief complaint encoding module is used to extract time information weights, symptom modifications and primary and secondary relationships from the chief complaint text through positional attention. At the same time, it obtains the correlation between all tokens in the standardized chief complaint text through a global attention mechanism, and further obtains the word combinations of danger signals and their contextual relationships to generate an initial vector of chief complaint semantics.
[0027] The semantic completion module is based on a semantic completion mechanism that incorporates a diffusion model to enhance the semantics of the initial statement semantic vector, thereby obtaining a semantically completed vector.
[0028] The similarity chief complaint retrieval module is used to retrieve the K historical chief complaints that are most similar to the semantic vector of the chief complaint in the database vector space, as contextual reference examples;
[0029] The context suggestion building module is used to assemble a keyword sequence in a structured format by combining the K most similar historical complaints as few-shot examples with the complaint semantic vector;
[0030] The severity scoring module is used to input keyword sequences into LLM and extract candidate label logit, construct the chief complaint risk index CRI, and output probabilistic results;
[0031] The triage decision output module is used to concatenate the weighted chief complaint risk index (CRI) with the patient's structured data features, and output the final triage level based on the concatenated features.
[0032] Furthermore, it also includes a text generation module for automatically generating triage suggestion texts for medical staff to refer to or directly push to the hospital triage system interface.
[0033] Furthermore, it also includes a resource integration module for automatically recommending early auxiliary examinations, including blood pressure, blood sugar, heart rate, respiration, and electrocardiogram, by combining pre-hospital and in-hospital testing resources.
[0034] The beneficial effects of this invention include:
[0035] 1. Improve the accuracy and safety of triage: Through in-depth and complete analysis of the chief complaint text and effective fusion of multimodal data, high-risk patients can be identified more accurately, significantly reducing the risk of misdiagnosis and missed diagnosis.
[0036] 2. Enhance the interpretability and credibility of decision-making: Constructing the Chief Complaint Risk Index (CRI) makes the triage decision-making process transparent and knowable, providing a reliable basis for secondary confirmation by medical staff and risk management.
[0037] 3. Improve triage efficiency and real-time performance: Through optimization methods such as model distillation, the system can achieve rapid response in emergency scenarios, assisting medical staff to make judgments in the first instance and shortening patients' waiting time.
[0038] 4. Reduced application threshold and promotion costs: No complex model fine-tuning is required, the knowledge base can be dynamically updated, and combined with a lightweight deployment solution, the technical and hardware costs for promotion and application in different hospitals and departments are greatly reduced. Attached Figure Description
[0039] Figure 1 This is a flowchart of an emergency intelligent triage method based on global attention and location attention, which is involved in the embodiments of this application.
[0040] Figure 2 This is a schematic diagram of steps S2-S5 involved in the embodiments of this application.
[0041] Figure 3 This is a schematic diagram illustrating the triage effect output of the emergency intelligent triage system based on global attention and location attention, as described in an embodiment of this application.
[0042] Figure 4 This is a schematic diagram of information input for an emergency intelligent triage system based on global attention and location attention, as described in an embodiment of this application. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0044] Example 1
[0045] The following is combined Figures 1-2 Specific embodiments of the present invention will be described in detail;
[0046] Emergency intelligent triage methods based on global attention and location attention include:
[0047] S1: Collect all data from patients during pre-hospital emergency care, including structured examination data (blood pressure, heart rate, etc.) and unstructured patient complaint texts, and standardize and preprocess the obtained data.
[0048] The structured data includes past medical history, basic vital signs (such as body temperature, pulse, blood pressure, respiration, and SpO2), and basic demographic information (age, gender). Real-time data entry and quality control are ensured, supporting multiple input methods (manual input, voice transcription, and mobile input). Specifically:
[0049] Structured data standardization includes: introducing a time decay coefficient to weight time alignment of indicators; performing unit conversion and Z-score standardization on the aligned indicators; outlier detection and missing value imputation based on preset thresholds; and finally, concatenating the processed indicators in a preset order to form a structured feature vector. Its construction method is shown in the following formula:
[0050]
[0051] The unstructured data includes patients' chief complaints (free text) during emergency room registration. Specifically:
[0052] To ensure accurate model comprehension of the original free text, preliminary standardization and preprocessing are performed, including:
[0053] Word segmentation: This involves dividing a continuous sentence into meaningful words or character units. For example, it can be segmented into: “patient”, “sudden onset”, “chest pain”, “2 hours”, “,”, “accompanied by”, “sweating profusely”, “、”, “nausea”, “.”, “past”, “has”, “coronary heart disease”, “medical history”, “,”, “3 years ago”, “implanted”, “stent”, “.”.
[0054] Terminology standardization: This involves unifying colloquial or non-standard medical expressions into standardized terminology. For example, if a patient says "heartburn," it is standardized to "chest pain," and "fever" or "high temperature" is standardized to "high fever." In this example, the chief complaint is already relatively standardized, and this step is likely mainly used for verification.
[0055] S2: Extract time information weights, symptom modifications, and primary / secondary relationships from the chief complaint text using positional attention. Simultaneously, utilize a global attention mechanism to obtain the correlation between all tokens in the standardized chief complaint text, and further extract the word combinations of warning signals and their contextual relationships to generate an initial semantic vector for the chief complaint; specifically:
[0056] This step constructs an encoder that includes both positional attention and global attention mechanisms to semantically represent the subject matter.
[0057] The positional attention mechanism includes: attaching a learnable positional vector to each token; influencing the global attention score through the positional correlation between positional vectors; and emphasizing time, location, and quantifiers with high weights during encoding. This allows the encoder to distinguish between acute and chronic common diseases and rare disease scenarios such as "sudden chest pain," "intermittent abdominal pain for 3 days," "profuse sweating," "little sweating," and "no sweating." In emergency room texts, the "chronological order of occurrence," "symptom location," and "relationship between modifiers and the primary cause" determine the severity of the condition. Dynamically learnable positional attention encoding is introduced into the embedding layer of the encoder, and positional correlation weights are incorporated into the attention calculation process to adjust the attention weight distribution among tokens, enabling the encoder to automatically capture the positional information of key elements in the chief complaint.
[0058] The time information weight refers to the use of learnable positional encoding to focus on time adverbs and corresponding time window lengths in the main complaint text, thereby assigning corresponding urgency weights to symptoms modified by time adverbs; the modification and hierarchy of symptoms refers to the reinforcement relationship between degree words and symptom words based on the position of word units, as well as the accompaniment relationship between different symptom words.
[0059] For example, time information weighting: through learnable location coding, it pays special attention to the time adverb "2 hours", accurately identifying it as a very short time window representing an acute onset and assigning it a very high weight. At the same time, it can also identify "3 years ago" as a distant time point describing past medical history, whose urgency weight is much lower than "2 hours".
[0060] Modification and hierarchy of symptoms: This mechanism can understand that "sudden onset" modifies "chest pain", while "profuse sweating and nausea" are "accompanying" chest pain, thus constructing the logical hierarchy and hierarchy of symptoms.
[0061] The global attention mechanism includes: feeding the segmented chief complaint text into a global attention encoder based on a Transformer architecture, where each token applies learnable weights to all other tokens; the output is a globally context-sensitive chief complaint text embedding vector; this embedding is used as input for subsequent knowledge base retrieval and triage models. For each chief complaint text, the encoder focuses on the correlation between all tokens in the chief complaint, emphasizing the capture of words describing warning signals such as sudden onset, severe, and aggravated, and their contextual relationships.
[0062] The danger signal word combination refers to identifying word combinations that indicate the urgency of the condition from the reinforcing relationship between words indicating severity and symptom words, as well as the accompanying relationship between different symptom words; the context association refers to identifying information in historical information that is related to the current symptom, and further inferring the potential information of the current symptom.
[0063] For example, the encoder can detect combinations of danger signals: the word "sudden" significantly amplifies the urgency of "chest pain." Simultaneously, it identifies "profuse sweating" and "nausea" as serious accompanying symptoms highly correlated with "chest pain." This combination not only represents typical signals of common emergencies like myocardial infarction but also encompasses complex conditions such as pheochromocytoma crisis, which, while clinically rare, have extremely high mortality rates. By capturing these atypical or long-tailed combinations of high-risk features and assigning them higher weights, the encoder ensures that risk level assessments cover various critical and severe illness scenarios.
[0064] Contextual association: By strongly associating the historical information of "coronary heart disease history" and "stent" with the current symptom of "sudden chest pain", it can be determined that this is an acute attack in a high-risk patient, rather than ordinary pain.
[0065] Through the global self-attention mechanism, each lexical unit can be "seen" and its relationship with all other lexical units in the sentence can be evaluated, thus forming a context vector with a deep understanding of the overall semantics.
[0066] Finally, the semantic association information captured by global attention and the temporal and positional information captured by location attention are fused together to output a fixed-dimensional initial vector of the main complaint semantics.
[0067] The unique feature of the semantic vector obtained through the above method is that each dimension contains complex information refined through a dual attention mechanism. It not only represents scattered keywords such as "chest pain" and "coronary heart disease", but more importantly, it forms a logical code in a machine-interpretable and understandable way: "a sudden chest pain event that occurred 2 hours ago, accompanied by severe physiological reactions, and with a relevant high-risk medical history", which lays a solid foundation for subsequent similar case retrieval and accurate severity judgment.
[0068] In this embodiment, the following steps are included:
[0069] (1) After the standardized main complaint text is segmented into words, a token sequence is obtained in order. Then, for each token Construct the corresponding word embedding vector As a semantic embedding of the token.
[0070] (2) Assign an absolute position index to the token sequence. And pre-construct a position vector embedding matrix This is used to store learnable position vectors corresponding to different locations. The maximum sequence length, This represents the dimension of the position vector. Based on the absolute position index. From the vector embedding matrix Extract the first Each vector serves as the position vector of the token. ,Right now .
[0071] (3) The position vector obtained in the above steps Word vectors corresponding to the token The token is then merged to form its initial representation:
[0072]
[0073] (4) Perform rule matching on the token sequence and attach a learnable position vector to each token. The positional correlation between position vectors affects the global attention score. Each token is labeled as: time words (e.g., "3 days", "2 hours", "last night"), location words ("chest pain", "right upper abdomen"), quantity or frequency words ("multiple times", "large amount", "3 times"), or other type words, and a type vector embedding matrix is pre-constructed. ,in, The number of types mentioned above, Let be the dimension of the type vector. For the th in the sequence Each token is labeled according to its type. From type vector embedding matrix Extract the corresponding vector as the type vector of the token. ,Right now .
[0074] (5) The above With corresponding position vector The embedding vectors are fused to obtain the position and type embedding vectors:
[0075]
[0076] In this way, the location information of each token, along with its type vectors such as time, location, and quantity, is encoded into a unified embedded system, providing a location signal containing type semantics for subsequent location attention calculations.
[0077] (6) Construct positional relevance weights, introduce dynamically learnable positional encoding and positional relevance weights into the embedding layer, and enable the encoder to automatically capture the positional information of key elements of the main statement. For any two tokens, the position of the key elements is determined by the position of the key elements. Calculate their relative positional distance:
[0078]
[0079] And pre-construct the relative position embedding matrix According to Article The, the Type label of each token Embedded from a pre-constructed type vector matrix The coefficients are obtained from This assigns higher positional relevance weights to key types such as time words, location words, and quantity words.
[0080] (7) The tokens obtained in steps (3) to (5) above are denoted as The query vector, key vector, and value vector are obtained through linear transformation:
[0081]
[0082] in , , Given a learnable parameter matrix, calculate the first... The token is paired with the first... Content similarity score for each token:
[0083]
[0084] in This is the hidden vector dimension.
[0085] (8) Based on the content similarity score, a time information weight relevance score is introduced. The time information weight refers to the attention paid to the time adverbs and corresponding time window lengths in the main complaint text through learnable positional encoding, thereby assigning corresponding urgency weights to the symptoms modified by the time adverbs. The modification and primary-secondary relationship of the symptoms refers to the enhancement relationship between the degree of words and the symptom words based on the positional identification of word units. The two are then fused to obtain the final attention score.
[0086]
[0087] in This is a learnable parameter vector. The content similarity score and the position score are weighted and summed to obtain the overall attention score:
[0088]
[0089] in A learnable balance coefficient to control the degree of influence of location-related terms.
[0090] (9) Normalize the total attention score to obtain the positional attention weight, and update the token representation accordingly. Specifically, for a fixed query position... For all key positions, use the following formula. Perform softmax normalization:
[0091]
[0092] Again The value vector is weighted and summed to obtain the output representation of global position and type information:
[0093]
[0094] (10) Use the above positional attention output to construct a global attention encoder, and denote the token output obtained in step (9) as And used as input to the global attention encoder, the 0th layer is denoted as:
[0095]
[0096] Based on this, several layers of encoding layers using the same attention calculation method as steps (7) to (9) are stacked to form a global attention encoder based on the Transformer architecture. For the first layer Output of the previous layer As input, the linear transformation of the query vector, key vector, and value vector as described in steps (7) to (9) and the overall attention score are used. With attention weight The calculation method involves performing self-attention calculation on all tokens within the same main complaint text, and based on:
[0097]
[0098] The token representation output by this layer is updated. Specifically, for any query position... Attention weight exist Softmax normalization is performed at all positions, so each token can apply learnable weights to all other tokens in the main complaint text, achieving global self-attention modeling. Through multi-layer stacking, the encoder can progressively fuse the global contextual information of the main complaint text, enabling warning signal words (such as "sudden onset," "severe," "worsening," etc.) and their combination patterns with symptom words and time words to be represented in multiple layers. This is repeatedly reinforced in the process.
[0099] (11) After completing the first After layer-wise global attention encoding, the final layer's token representation sequence is obtained. For all Pooling is performed to obtain the initial vector of the main complaint semantics. This serves as the input feature for subsequent retrieval and triage prediction models.
[0100] S3: To address the issues of short emergency room chief complaints and the frequent loss of key information (such as triggering factors and accompanying symptoms), a semantic completion mechanism based on a diffusion model is further introduced to generate a semantically completed chief complaint semantic vector. Specifically:
[0101] Data preparation: Constructing pairs of training samples , The original and complete medical record text, To select the chief complaint text corresponding to the same medical record.
[0102] Unified vectorization: Using the dual attention encoder described in step S2, feature extraction is performed on the above text to obtain the original complete semantic vector. This is represented as the gold standard feature; the main complaint text vector C (i.e., the initial semantic vector of the main complaint) is obtained. (as a conditional input to the diffusion model), represented as the information missing feature.
[0103] Forward diffusion model construction: original complete semantic feature vector After The state after the second forward diffusion Its mathematical expression satisfies:
[0104]
[0105] in, For preset noise parameters The cumulative multiplication factor at each time step, It is standard Gaussian noise.
[0106] Denoising network based on Transformer architecture As the specific implementation carrier for the inverse generation of the diffusion model, the input of this network includes: the noise vector at the current time. Time step embedding vector and condition vectors .
[0107] The time step embedding vector Since the diffusion process is a multi-step iterative process, the denoising network needs to sense the current denoising progress in order to adjust the denoising intensity.
[0108] To enable the network to effectively utilize conditional information for denoising, a cross-attention mechanism can be optionally employed: the noise vector at the current time step is used to perform denoising. The mapping is used as a query vector , condition vector The mapping as a key vector Sum value vector The formula for attention calculation is as follows:
[0109]
[0110] Through this mechanism, the denoising network queries the condition vector at each denoising step. The clues in the noise guide the denoising network to recover the complete semantic features related to the subject complaint from the noise.
[0111] along with As the noise increases, the feature information is gradually submerged. hour, Approximate Gaussian noise The mean squared error loss, in the form of noise prediction, is used to adjust the parameters of the denoising network. Training is performed to make the noise estimate output by the network approximate the actual noise injected during the forward diffusion process as closely as possible. Its loss function can be expressed as:
[0112]
[0113] Based on the aforementioned loss function, the backpropagation algorithm (such as the Adam optimizer) is used to minimize the difference between the predicted noise and the actual noise, and the parameters of the denoising network are iteratively updated. This continues until the denoising network converges. After several iterations, the final noise-free vector is denoted as the main semantic vector. :
[0114]
[0115] In practical applications, for new patients containing only the chief complaint, the system will sample from standard Gaussian noise as the initial state, using the patient's chief complaint semantic vector. Given the condition, the trained denoising network is used to iteratively denoise the content using the inverse formula described above. The final vector generated is the semantically complete subject matter semantic vector. .
[0116] S4: Retrieve the K historical complaints that are most similar to the semantic vector of the complaint within the vector space of the knowledge database, as contextual reference examples;
[0117] Specifically, a database containing a large number of historical chief complaints and binary triage labels is pre-constructed, where A represents "high risk / serious" and B represents "low risk / not serious". A semantic encoder using the dual attention mechanism described in step S2 is then used to process the... Feature extraction was performed on the complete text of each historical case to obtain historical semantic vectors. , build The vector space set of samples .
[0118] For new patient complaints, i.e., the semantic vector of the complaint obtained in step S3 The algorithm employs cosine similarity / KNN and other algorithms to retrieve the Top-K most similar historical chief complaints within the vector space, serving as contextual reference examples for this triage. The similarity score formula is as follows:
[0119]
[0120] Based on the calculated similarity score All historical cases are sorted in descending order, and the top-K indexes are extracted as context reference examples for constructing prompts in subsequent steps.
[0121] This retrieval method can dynamically adapt to newly reported cases and diverse expressions, and the knowledge base can be updated at any time without retraining any model parameters. Samples selected through semantic retrieval are closer to real-world scenarios, improving the accuracy and stability of LLM inference.
[0122] S5: Using the K most similar historical complaints as few-shot examples and combining them with the semantic vector of the complaints, assemble the keyword sequence according to a structured format;
[0123] Specifically, the top-K index sets are used as the set of most similar historical chief complaints. For each historical chief complaint in the set, keywords such as triage level, symptom location, time information, and warning signs are extracted from its corresponding structured tags, and then organized into a few-shot example in the form of chief complaint text + diagnosis / grading tag. The explanation is as follows:
[0124] Category tag explanation:
[0125] [A] The condition is high-risk or critical and requires immediate treatment;
[0126] [B] If the condition is not high-risk (including general or cases that can await treatment), it can be treated routinely or referred according to the hospital's procedures;
[0127] Example of a local corpus:
[0128] Example 1: Chief complaint: Chest pain accompanied by shortness of breath, coronary heart disease attack 2 years ago, suspected recurrence; Judgment: A
[0129] Example 2: Chief complaint: Sudden onset of chest tightness, which worsens over time; history of hypertension; Judgment: A
[0130] Example 3: Chief complaint: Dull pain in the right chest, no difficulty breathing, no relevant medical history; Judgment: B ...
[0132] Current patient complaint:
[0133] The patient experienced sudden chest pain for 2 hours, accompanied by profuse sweating and nausea;
[0134] Inquiry statement:
[0135] What is your judgment?
[0136] Note: This process is the internal execution process of this algorithm and not the user operation process. In the actual execution process, the user only needs to input "current statement" + "question statement (such as: What is your judgment? What do you think? etc.)". The algorithm internally converts the statement into a vector according to the encoder set above, and then matches it with the corpus built by S4 to obtain similar historical statements. Subsequently, it automatically extracts historical statements and forms a structured combination with the current statement according to the above format.
[0137] The above example template as a whole constitutes the input sequence. This serves as the text input for the LLM inference described in the next step, S6.
[0138] S6: Input the keyword sequence into the LLM, so that it selects only from the candidate set {A, B} when generating the first tag token of the response, where A represents "high risk / serious" and B represents "low risk / not serious"; extract the logit of the LLM on A and B and construct the chief complaint risk index. This is used for subsequent feature fusion.
[0139] Specifically, LLMs with medical Chinese comprehension capabilities are used for triage reasoning, such as ChatGLM3, DeepSeek, Aquila2, GLM, BayLing, Gemma, and LLama2. The few-shot text input sequence Q is fed into the LLM. At the moment of outputting the first tag token, the LLM provides unnormalized scores (logit) for candidate tags A and B, denoted as [logit value missing]. and This represents the degree of inclination towards the label at that output location. The obtained logit value is normalized and mapped to ensure that it can be fused with subsequent structured features on the same order of magnitude for multimodal processing. Specifically, the corresponding class probability is obtained through softmax normalization and defined as the chief complaint risk index. :
[0140]
[0141] in, , representing the corresponding "high risk / serious" probabilistic output. The closer a value is to 1, the more it indicates a bias towards A; conversely, The closer it is to 0, the more it leans towards B.
[0142] Logit extraction and CRI calculation are performed via a local API, compatible with various LLMs, and support deployment across multiple scenarios including GPU / CPU. It also supports automatic fine-tuning of keyword strategies to adapt to different hospital campuses and triage standards.
[0143] S7: To enhance the influence of CRI on triage level decisions, the CRI is first weighted and then concatenated with the patient's structured data features. The concatenated fused features are then imported into the trained triage model, and the final triage level is output. Specific triage levels include TL1-TL5, where TL1 represents the most critical level and TL5 represents the mildest level.
[0144] Specifically, the system first uses the chief complaint risk index output by LLM. The dimension is expanded to map it to a vector space, constructing a one-dimensional feature vector, which is then multiplied by a preset weight coefficient. Perform weighted processing, and then combine the weighted features with the structured feature vector obtained in step S1. splicing.
[0145]
[0146] Based on the joint feature vector Specifically, a combination of logistic regression, random forest, or lightweight neural network models can be used for decision-making. As input, the system outputs predicted probabilities for multiple triage levels TL1 to TL5, with the highest predicted probability used as the final triage level. This embodiment uses a logistic regression model for calculation.
[0147]
[0148] in, This is the weight matrix. For bias vectors, For corresponding triage levels The logarithmic probability output, In the joint features Subordinate The predicted probability of the level. The weighting parameters. , All samples are obtained from training samples. Preferably, a non-negativity constraint can be set on the weights, such that... The larger the value, the more the triage model tends to give a higher triage level (i.e., tends towards TL1), thus maintaining the monotonicity of the overall decision.
[0149] During the training phase, based on a large number of retrospective samples with real triage level labels, each sample was weighted by a coefficient. Post-treatment chief complaint risk index It is obtained by splicing with its structured features Construct a multi-class cross-entropy loss function using the actual triage level labels:
[0150]
[0151] in, For the first Each sample is at the level The true label indicates the variable. The parameters are optimized using gradient descent or other numerical optimization algorithms. , Training is performed to enable the triage model to learn automatically. The weighted contribution of each structured feature to the final triage result. After training convergence, the chief complaint risk index... As part of the joint features, together with the structured features, it determines the output triage level, realizing the organic integration of chief complaint text information and structured clinical information.
[0152] In other embodiments, the above-described triage fusion model can be replaced with a random forest, gradient boosting tree, or lightweight deep neural network model, still using joint feature vectors. As input, learn from supervised training Mapping relationship to triage level. Utilizing the chief complaint risk index. The free text's main claims are transformed into quantifiable continuous risk characteristics and modeled in a unified manner with multi-source structured indicators, rather than simply relying on a single indicator for classification, thereby achieving more accurate classification.
[0153] In another embodiment, the LLM described in S6 is deployed using a model distillation method, including: in offline mode, using the LLM as a teacher model to generate a chief complaint risk index. A lightweight student model is trained to fit the output of the teacher model. Finally, only the trained student model is deployed on the hospital terminal, achieving fast inference with low latency and low cost. A small Transformer can be used for the specific student model.
[0154] In another embodiment, an emergency intelligent triage system based on global attention and positional attention is involved, including: a chief complaint and vital signs data acquisition module, a chief complaint encoding module, a semantic completion module, a similar chief complaint retrieval module, a contextual prompt construction module, a severity scoring module, and a triage decision output module;
[0155] The chief complaint and vital signs data acquisition module is used to collect patients' chief complaints, past medical history, basic vital signs and basic demographic information during the emergency registration stage and to perform standardized processing.
[0156] The chief complaint encoding module is used to extract time information weights, symptom modifications and primary and secondary relationships from the chief complaint text through positional attention. At the same time, it obtains the correlation between all tokens in the standardized chief complaint text through a global attention mechanism, and further obtains the word combinations of danger signals and their contextual relationships to generate an initial vector of chief complaint semantics.
[0157] The semantic completion module is based on a semantic completion mechanism that incorporates a diffusion model to enhance the semantics of the initial statement semantic vector, thereby obtaining a semantically completed vector.
[0158] The similarity chief complaint retrieval module is used to retrieve the K historical chief complaints that are most similar to the semantic vector of the chief complaint in the database vector space, as contextual reference examples;
[0159] The context suggestion building module is used to assemble a keyword sequence in a structured format by combining the K most similar historical complaints as few-shot examples with the complaint semantic vector;
[0160] The severity scoring module is used to input keyword sequences into the LLM and extract candidate tag logits to construct a chief complaint risk index. Output the probabilistic results;
[0161] The triage decision output module is used to output the chief complaint risk index. The data is concatenated with the patient's structured data features, and the final triage level is output based on the concatenated features.
[0162] Specifically, the triage decision output module includes a structured data fusion module, used to integrate the chief complaint risk index. It is spliced with the patient's structured data features.
[0163] The specific user interface allows for information input and hierarchical output. Figures 3-4 As shown.
[0164] In another embodiment, a text generation module is also included to automatically generate triage suggestion text for medical staff to refer to or to be directly pushed to the hospital triage system interface.
[0165] In another embodiment, a resource integration module is also included to automatically recommend early auxiliary examinations, including blood pressure, blood glucose, heart rate, respiration, and electrocardiogram, by combining pre-hospital and in-hospital testing resources.
[0166] The embodiments described above merely illustrate specific implementation methods of this application, and while the descriptions are detailed and specific, they should not be construed as limiting the scope of protection of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the technical solution of this application, and these modifications and improvements all fall within the scope of protection of this application.
Claims
1. An emergency intelligent triage method based on global attention and positional attention, characterized in that, include: S1: Collect all data from patients during pre-hospital emergency care, including structured examination data and unstructured chief complaint texts, and standardize and preprocess the obtained data. S2: Extract time information weights, symptom modification and primary and secondary relationships from the chief complaint text through positional attention. At the same time, obtain the correlation between all tokens in the standardized chief complaint text through a global attention mechanism, and further obtain the word combination of danger signals and their contextual relationships to generate the initial semantic vector of the chief complaint. S3: Introduce a semantic completion mechanism based on a diffusion model to generate a semantically completed subject-complaint semantic vector. S4: Retrieve the K historical complaints that are most similar to the semantic vector of the complaint within the vector space of the knowledge database, as contextual reference examples; S5: Using the K most similar historical complaints as few-shot examples and combining them with the semantic vector of the complaints, assemble the keyword sequence according to a structured format; S6: Input the keyword sequence into the LLM so that it selects only from the candidate set {A,B} when generating the first tag token of the answer, where A and B represent two different emergency states; extract the logit of the LLM for A and B and construct the Chief Complaint Risk Index (CRI). S7: Concatenate the weighted chief complaint risk index (CRI) with the patient's structured feature vector, import the concatenated vector with multimodal fusion features into the trained triage model, and output the final triage level.
2. The emergency intelligent triage method based on global attention and location attention according to claim 1, characterized in that, The time information weight refers to focusing on the time adverbs and corresponding time window lengths in the main complaint text through learnable positional encoding, and assigning corresponding urgency weights to the symptoms modified by the time adverbs; the modification and primary-secondary relationship of symptoms refers to the enhancement relationship of degree words to symptom words based on the position of word units, as well as the accompanying relationship between different symptom words.
3. The emergency intelligent triage method based on global attention and positional attention according to claim 1, characterized in that, The danger signal word combination refers to identifying word combinations that indicate the urgency of the condition from the reinforcing relationship between words indicating severity and symptom words, as well as the accompanying relationship between different symptom words; the context association refers to identifying information in historical information that is related to the current symptom, and further inferring the potential information of the current symptom.
4. The emergency intelligent triage method based on global attention and location attention according to claim 1, characterized in that, The semantic completion mechanism based on the diffusion model is as follows: a diffusion model is constructed with the initial vector of the chief complaint semantics as a condition, and a denoising network is trained with the goal of minimizing the difference between the predicted noise and the real noise, so that it learns to recover the semantics from the noisy complete medical record features. The trained denoising network is then used to perform inverse iterative denoising on the standard Gaussian noise to generate the semantically completed chief complaint semantic vector.
5. The method according to claim 1, characterized in that, The Chief Complaint Risk Index (CRI) is constructed as follows: LLM extracts the logit values of candidate label A and candidate label B at the first label token position, which are respectively... and Normalize it and map it to the main complaint risk index .
6. The emergency intelligent triage method based on global attention and positional attention according to claim 1, characterized in that, The LLM described in S6 is deployed using a model distillation method, which includes: in offline mode, using the LLM as a teacher model to generate a large number of soft labels; training a lightweight student model to fit the output of the teacher model; and finally deploying the trained student model on the hospital terminal.
7. The emergency intelligent triage method based on global attention and location attention according to claim 1, characterized in that, S7 uses a logistic regression model to calculate the multi-class prediction probability and take the maximum value to output the final triage level.
8. The emergency intelligent triage method based on global attention and location attention according to claim 1, characterized in that, S1 standardizes structured data by introducing a time decay coefficient for weighted time alignment of indicators; performs unit conversion and Z-score standardization on the aligned indicators; performs outlier detection and missing value filling based on a preset threshold, and concatenates the processed indicators into a structured feature vector. Standardizes unstructured complaint text by segmenting continuous sentences into meaningful words or character units; and standardizes colloquial or non-standard medical expressions into standard terminology.
9. An emergency intelligent triage system based on global attention and location attention, including: The system includes modules for collecting chief complaint and physical signs data, encoding chief complaint, semantic completion, searching for similar chief complaints, constructing contextual prompts, scoring severity, and outputting triage decisions. The chief complaint and vital signs data acquisition module is used to collect patients' chief complaints, past medical history, basic vital signs and basic demographic information during the emergency registration stage and to perform standardized processing. The chief complaint encoding module is used to extract time information weights, symptom modifications and primary and secondary relationships from the chief complaint text through positional attention. At the same time, it obtains the correlation between all tokens in the standardized chief complaint text through a global attention mechanism, and further obtains the word combinations of danger signals and their contextual relationships to generate an initial semantic vector for the chief complaint. The semantic completion module is based on a semantic completion mechanism that incorporates a diffusion model to enhance the semantics of the initial statement semantic vector, thereby obtaining a semantically completed vector. The similarity chief complaint retrieval module is used to retrieve the K historical chief complaints that are most similar to the semantic vector of the chief complaint in the database vector space, as contextual reference examples; The context suggestion building module is used to assemble a keyword sequence in a structured format by combining the K most similar historical complaints as few-shot examples with the complaint semantic vector; The severity scoring module is used to input keyword sequences into LLM and extract candidate label logit, construct the chief complaint risk index CRI, and output probabilistic results; The triage decision output module is used to combine the weighted chief complaint risk index (CRI) with the patient's structured data features into a fusion feature vector, import the vector into the trained triage model, and output the final triage level.
10. The emergency intelligent triage system based on global attention and positional attention according to claim 9, characterized in that, It also includes a text generation module and a resource integration module. The text generation module is used to automatically generate triage suggestion text for medical staff to refer to or directly push to the hospital triage system interface. The resource integration module is used to combine pre-hospital and in-hospital testing resources to automatically recommend early auxiliary examinations, including blood pressure, blood sugar, heart rate, respiration, and electrocardiogram.