Emergency treatment suggestion generation method based on klebsiella pneumoniae classification prediction

By using artificial intelligence technology and a two-level classification model, homology and transmission route analysis were performed on Klebsiella pneumoniae case data to generate emergency treatment recommendations. This addressed the shortcomings in Klebsiella pneumoniae typing research and improved emergency response capabilities and treatment outcomes.

CN122177490APending Publication Date: 2026-06-09JIAXING NO 1 HOSPITAL

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIAXING NO 1 HOSPITAL
Filing Date
2026-03-04
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Current technologies have systematic deficiencies in the typing of Klebsiella pneumoniae, making it difficult to effectively monitor highly virulent, highly infectious, and highly drug-resistant strains, and lacking rapid response emergency treatment recommendations, which increases the difficulty of clinical treatment.

Method used

Using artificial intelligence technology, this study collects Klebsiella pneumoniae case data, performs homology analysis and feature vector extraction, and combines this with transmission route analysis to construct a two-level classification model (primary classification module and homology group-level classification module) to generate emergency treatment recommendations for dealing with highly virulent, highly infectious, and highly drug-resistant strains.

Benefits of technology

It enables efficient classification and prediction of Klebsiella pneumoniae, provides timely emergency treatment recommendations, improves clinical response capabilities, and reduces infection risk and treatment difficulty.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122177490A_ABST
    Figure CN122177490A_ABST
Patent Text Reader

Abstract

This application provides a method for generating emergency treatment recommendations based on Klebsiella pneumoniae classification prediction, including: acquiring Klebsiella pneumoniae case data for a set time period; identifying homologous Klebsiella pneumoniae case data based on mass spectrometry data in the Klebsiella pneumoniae case data, and integrating the homologous Klebsiella pneumoniae case data to obtain Klebsiella pneumoniae case data groups; determining the feature vector of each Klebsiella pneumoniae case data based on the Klebsiella pneumoniae case data group; inputting the feature vector of each Klebsiella pneumoniae case data into a Klebsiella pneumoniae classification model to determine the classification corresponding to each Klebsiella pneumoniae case data; and generating emergency treatment recommendations based on the classification corresponding to each Klebsiella pneumoniae case data. This solution can provide emergency recommendations during the transition period, so as to promptly attract the attention of medical staff and take appropriate measures.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of infectious disease medicine, and more specifically, to a method for generating emergency treatment recommendations based on Klebsiella pneumoniae classification prediction. Background Technology

[0002] Klebsiella pneumoniae, belonging to the Enterobacteriaceae family, is ubiquitous on animal mucosal surfaces and in the environment (such as water and soil). It is a common cause of drug-resistant opportunistic infections in hospitalized patients, causing a variety of infectious diseases, including urinary tract infections, bacteremia, pneumonia, and liver abscesses. Over the past decade, Klebsiella pneumoniae has become a major clinical and public health threat due to the increasing prevalence of healthcare-associated infections caused by multidrug-resistant strains producing broad-spectrum β-lactamases and / or carbapenemases. In China, Klebsiella pneumoniae accounts for 11.9% of pathogens isolated from ventilator-associated pneumonia (VAP) and intensive care unit (ICU)-acquired pneumonia. Furthermore, in a multicenter clinical study covering 25 "AAA" hospitals in 14 provinces of China, carbapenem-resistant Enterobacteriaceae (CRE) bacteria caused by Klebsiella pneumoniae accounted for 73.9% of 664 clinical samples. The high incidence of Klebsiella pneumoniae infection is placing significant pressure on my country's healthcare system.

[0003] The 2021 China Antimicrobial Resistance Surveillance Report shows that Klebsiella pneumoniae ranks second in detection rate among Enterobacteriaceae, second only to Escherichia coli, and its resistance to carbapenems is becoming increasingly serious. From 2005 to 2018, the resistance rate of Klebsiella pneumoniae to imipenem surged from 3.0% to 25.0%, and the resistance rate to meropenem climbed from 2.9% to 26.3%, an increase of more than eight times. The detection rate of carbapenem-resistant Klebsiella pneumoniae (CRKP) in traditional Chinese medicine hospitals nationwide also showed an upward trend, rising from 10.4% in 2018 to 13.3% in 2021. The continuous increase in the drug resistance rate of Klebsiella pneumoniae greatly increases the difficulty of clinical anti-infective treatment and seriously threatens patients' lives. Therefore, conducting drug resistance, especially multidrug resistance, surveillance of Klebsiella pneumoniae is of great significance.

[0004] When highly virulent Klebsiella pneumoniae colonies are picked up with an inoculation loop on blood agar plates, those that form mucus filaments longer than 5 mm exhibit a unique high-mucosa phenotype. Some reports have used the high-mucosa phenotype as a key indicator for screening highly virulent Klebsiella pneumoniae; however, with further research, it has been clarified that highly virulent Klebsiella pneumoniae and highly mucus-producing Klebsiella pneumoniae are not the same concept. The presence of a high-mucosa phenotype does not necessarily mean the strain is highly virulent; conversely, the absence of a high-mucosa phenotype does not directly indicate weak virulence. However, the presence or absence of a high-mucosa phenotype can reflect the virulence of a strain to some extent.

[0005] Molecular typing techniques (such as MLST and PFGE) play an irreplaceable role in elucidating bacterial transmission patterns and epidemiological lineages. Multiple-site sequence typing (MLST), a nucleotide-sequence-based method, is sufficient to characterize genetic relationships between bacterial isolates. It provides well-defined and portable data, allowing for the implementation of multi-user international databases. Combined with precise epidemiological information and characteristics of antibiotic resistance mechanisms, MLST analysis of large sample sets should significantly improve our understanding of the evolutionary origin and transmission of Klebsiella pneumoniae. Through precise strain typing, MLST technology plays an irreplaceable role in the epidemiological tracking, resistance control, clinical prognosis assessment, and research collaboration of Klebsiella pneumoniae infection. It is an important tool bridging microbiological research and clinical practice, and is of great significance for improving the efficiency of diagnosis and treatment and the level of control of Klebsiella pneumoniae infection.

[0006] MLST (Multiple Housekeeping Strains Test) amplifies the nucleotide sequences of multiple housekeeping genes by PCR and determines the corresponding ST type based on the amplification results. It is often used to determine the correlation and epidemiological characteristics among Klebsiella pneumoniae strains. Different ST types of highly virulent Klebsiella pneumoniae are closely related to capsular polysaccharide serotypes. Clinically common highly virulent Klebsiella pneumoniae strains are mostly classified as ST23, ST86, and ST65. Studies indicate that the capsular polysaccharide serotypes of highly virulent Klebsiella pneumoniae mainly cover K1 and K2 types. Specifically, the ST23 sequence type mainly corresponds to the K1 capsular serotype, while ST65 and ST86 types mainly correspond to the K2 capsular serotype.

[0007] However, in China, systematic typing studies of Klebsiella pneumoniae in specific hospital settings are still significantly insufficient. Furthermore, research cannot be accomplished overnight; it requires long-term data collection, gene sequencing and molecular typing, and further research to establish a systematic medical support system. During this transition period, a technology that can provide transitional functions and reference value is needed to guide clinical practice.

[0008] Artificial intelligence (AI) technology has matured and is widely used in various fields. Therefore, this invention applies AI technology to existing sample analysis and classification prediction, efficiently utilizing existing case data that has undergone molecular typing to provide reference suggestions for clinical cases. In the event of potentially highly virulent, highly infectious, or highly drug-resistant strains, it can provide corresponding emergency reference suggestions to promptly draw the attention of medical personnel and prompt appropriate measures. Summary of the Invention

[0009] The purpose of this application is to provide a method for generating emergency treatment recommendations based on the classification prediction of Klebsiella pneumoniae. This method involves collecting Klebsiella pneumoniae case data over a set time period, performing homology analysis, grouping and extracting feature vectors, and in addition to basic feature components, incorporating transmission route analysis to extract transmission feature components. After integration, classification prediction is performed, including preliminary prediction at the case level and calibration at the group level. Finally, the classification of each Klebsiella pneumoniae case data is determined, and appropriate emergency treatment recommendations are generated. This provides emergency recommendations during the transition period, enabling medical personnel to promptly take notice and implement appropriate measures.

[0010] To achieve the above objectives, the embodiments of this application are implemented in the following manner: In a first aspect, embodiments of this application provide a method for generating emergency treatment recommendations based on Klebsiella pneumoniae classification prediction, comprising: acquiring Klebsiella pneumoniae case data for a set time period, wherein each Klebsiella pneumoniae case data includes sampling time, case location, phenotypic characteristics, patient basic data, department origin, department sample type, department infection type, medication data, diagnosis and treatment operation data, inpatient transfer records, treatment outcome, and mass spectrometry; identifying homologous Klebsiella pneumoniae case data based on the mass spectrometry in the Klebsiella pneumoniae case data, and integrating the homologous Klebsiella pneumoniae case data to obtain Klebsiella pneumoniae case data groups; determining the feature vector of each Klebsiella pneumoniae case data based on the Klebsiella pneumoniae case data groups; inputting the feature vector of each Klebsiella pneumoniae case data into a Klebsiella pneumoniae classification model to determine the classification corresponding to each Klebsiella pneumoniae case data; and generating emergency treatment recommendations based on the classification corresponding to each Klebsiella pneumoniae case data.

[0011] In conjunction with the first aspect, in the first possible implementation of the first aspect, based on the grouping of Klebsiella pneumoniae case data, the feature vector of each Klebsiella pneumoniae case data is determined, including: for each group of Klebsiella pneumoniae case data: preprocessing each Klebsiella pneumoniae case data within the group; extracting features from the sampling time, case location, phenotypic characteristics, patient basic data, department origin, department sample type, department infection type, medication data, diagnosis and treatment operation data, inpatient transfer records, and treatment outcomes of each Klebsiella pneumoniae case data within the group to obtain the basic feature components of each Klebsiella pneumoniae case data within the group; performing transmission route analysis based on the basic feature components of each Klebsiella pneumoniae case data within the group to determine the transmission route analysis results as the transmission feature components; concatenating the basic feature components and the transmission feature components to determine the feature vector of each Klebsiella pneumoniae case data within the group, wherein the dimension of the feature vector of each Klebsiella pneumoniae case data remains uniform and is associated with a unique case number.

[0012] In conjunction with the first possible implementation of the first aspect, in the second possible implementation of the first aspect, feature extraction is performed on the sampling time, case location, phenotypic characteristics, basic patient data, department origin, department sample type, department infection type, medication data, diagnostic and treatment operation data, inpatient transfer records, and treatment outcomes of each Klebsiella pneumoniae case data within the group. This yields the basic feature components of each Klebsiella pneumoniae case data within the group, including: Regarding sampling time: The sampling time is processed into year, month, day, hour, minute, the number of quarters within the year, the number of days between the data of the previous Klebsiella pneumoniae case in the group, and the number of days between the data of the previous Klebsiella pneumoniae case in the same department, to obtain the time component; Regarding the location of the case: the hospital number of the hospital where the case was admitted is used as the location component; Based on the patient's basic data: the underlying diseases are processed using unique hot coding, and concatenated with the patient's age to obtain the patient's weight. The underlying diseases include diabetes, chronic lung disease, chronic liver disease, chronic kidney disease, and malignant tumors. Based on phenotypic characteristics: The drug resistance spectrum and virulence phenotype of Klebsiella pneumoniae case data were processed by unique heat coding to obtain phenotypic components. Among them, the virulence phenotype includes whether there is a high mucin phenotype, serum resistance, and hemolysis. The drug resistance spectrum includes resistance to imipenem, meropenem, ceftazidime, cefotaxime, cefepime, piperacillin, ampicillin, aztreonam, gentamicin, amikacin, ciprofloxacin, levofloxacin, tigecycline, polymyxin E, and trimethoprim-sulfamethoxazole. For department sources: The department sources are processed using unique hot coding to obtain source components. Among them, the department sources include ICU, respiratory department, pediatrics, urology, and other departments. For departmental sample types: the departmental sample types are processed by unique hot coding to obtain sample components, where the departmental sample types include sputum, blood, urine, and others; For departmental infection types: departmental sample types are processed using unique thermal coding to obtain infection components, where departmental infection types include hospital-acquired and community-acquired; Regarding medication data: The medication data is processed using unique thermal coding to obtain the dosage. The medication data includes the usage of imipenem, meropenem, ceftazidime, cefotaxime, cefepime, piperacillin, ampicillin, aztreonam, gentamicin, amikacin, ciprofloxacin, levofloxacin, tigecycline, polymyxin E, and trimethoprim-sulfamethoxazole. For diagnostic and treatment operation data: the diagnostic and treatment operation data is processed by unique thermal encoding to obtain operation components, which include the use of ventilators and the use of central venous catheters; For inpatient transfer records: The inpatient transfer records are processed by one-hot encoding to obtain transfer components. The transfer components are assigned 4 dimensions: no transfer record is represented by 1, ICU to general ward is represented by 2, general ward to ICU is represented by 3, and any part that is not long enough is filled with 0. Regarding treatment outcomes: The treatment outcomes are processed using unique heat encoding to obtain treatment components, which include treatment in progress, cured, and transferred to another hospital; By sequentially splicing the time component, location component, patient component, phenotype component, source component, sample component, infection component, medication component, operation component, transport component, and treatment component, the basic characteristic components of each Klebsiella pneumoniae case data within the group are obtained.

[0013] In conjunction with the first possible implementation of the first aspect, in the third possible implementation of the first aspect, transmission pathway analysis is performed based on the basic feature components of each Klebsiella pneumoniae case data within the group. The results of the transmission pathway analysis are determined as transmission feature components, including: constructing directed edges with each Klebsiella pneumoniae case within the group as a node, wherein the construction of directed edges between nodes follows location association and the direction of the directed edges follows time order; calculating the transmission index for each pair of nodes, wherein the calculation of the transmission index includes time decay term, department association term, and diagnosis and treatment operation association term; calculating the node centrality of each node, wherein node centrality includes in-degree, out-degree, betweenness centrality, and proximity centrality; and determining and outputting the transmission feature components based on the node centrality of each node.

[0014] Combining the third possible implementation of the first aspect, in the fourth possible implementation of the first aspect, for any pair of nodes: nodes With nodes , And sampling time Less than sampling time The propagation index is calculated using the following method: , , , , in, Represents a node With nodes The propagation index between nodes The sampling time is earlier than the node Sampling time, , and The weights are positive, and , For nodes With nodes The number of days between them To set a period, For nodes With nodes The degree of overlap between the locations For nodes With nodes The degree of overlap between departments For nodes With nodes The degree of overlap in operations between them and Representing nodes respectively and nodes Hospital number, and Representing nodes respectively and nodes The source of the department, and Representing nodes respectively and nodes There are ICU transfer records. and Representing nodes respectively and nodes The use of ventilators, Represents a node and nodes At least one of the patients was not on a ventilator. Represents a node and nodes Both were on ventilators. and Representing nodes respectively and nodes The use of central venous catheters, Represents a node and nodes At least one of the partners was not using a central venous catheter. Represents a node and nodes Both parties used central venous catheters.

[0015] In conjunction with the third possible implementation of the first aspect, the fifth possible implementation of the first aspect calculates the node centrality of each node, including: compute nodes in-degree: , in, For nodes in-degree, node For a set of nodes Middle pointer node The node, For nodes With nodes The transmission index between them; compute nodes Out-degree: , in, For nodes Out-degree, node For a set of nodes Middle node The node it points to For nodes With nodes The transmission index between them; compute nodes Betweenness centrality: , in, Represents a node betweenness centrality, Indicates from node To the node The total number of shortest paths, At that time, take , Indicates from node To the node The shortest path passes through the nodes The number of paths, where the shortest path represents the path with the highest overall propagation index among the propagation paths; compute nodes The ingress centrality is close to: , in, For nodes The ingress is close to centrality. Indicates reachable nodes The set of nodes, For a set of nodes The number of nodes in For nodes To the node The shortest path distance, At that time, take ,and satisfy: , in, Represents a node To the node The shortest path propagation index is the overall propagation index of the path, which is the number of nodes in the shortest path that propagate the path. propagation to nodes The product of the propagation exponents of each segment along the directed edge, and ; compute nodes Approximate centrality: , in, For nodes The centrality is close to that of the target. Represents a node The set of reachable nodes For a set of nodes The number of nodes in For nodes To the node The shortest path distance, At that time, take ,and satisfy: , in, Represents a node To the node The shortest path propagation index is the overall propagation index of the path, which is the number of nodes in the shortest path that propagate the path. propagation to nodes The product of the propagation exponents of each segment along the directed edge, and .

[0016] In conjunction with the fifth possible implementation of the first aspect, the sixth possible implementation of the first aspect determines and outputs the propagation feature components based on the node centrality of each node, including: Collect the node set originating from each department and calculate the departmental transmission risk index corresponding to each node set originating from the department: , in, For the department The department outputs a transmission risk index. Belonging to the department The set of nodes, For a set of nodes Middle node The degree of exit, For a set of nodes The number of nodes in, and At that time, take ; In addition, calculate the departmental transmission risk index corresponding to the set of nodes originating from each department: , in, For the department Departmental transmission risk index Belonging to the department The set of nodes, For a set of nodes Middle node in-degree, For a set of nodes The number of nodes in, and At that time, take ; For nodes Integration of propagation feature components: , in, For nodes The propagation feature component is a 15-dimensional feature component.

[0017] In conjunction with the second possible implementation of the first aspect, in the seventh possible implementation of the first aspect, the Klebsiella pneumoniae classification model includes a primary classification module and a homology group-level classification module. The primary classification module adopts a random forest model to determine the classification probability vector corresponding to each Klebsiella pneumoniae case data based on the feature vector of each Klebsiella pneumoniae case data. Each element in the classification probability vector is used to reveal the probability that the Klebsiella pneumoniae case data belongs to the corresponding category. For each group of Klebsiella pneumoniae case data: the homology group-level classification module is used to determine the deviation of each Klebsiella pneumoniae case data in the group from its corresponding Klebsiella pneumoniae case data group. Based on the deviation and classification probability vector corresponding to each Klebsiella pneumoniae case data, the module determines the classification probability vector of this Klebsiella pneumoniae case data group. Finally, the classification with the highest probability in the classification probability vector is determined as the classification of each Klebsiella pneumoniae case data in the group.

[0018] In conjunction with the seventh possible implementation of the first aspect, in the eighth possible implementation of the first aspect, the homologous group-level classification module determines the deviation of each Klebsiella pneumoniae case data within a group from its corresponding Klebsiella pneumoniae case data group as follows: The distribution of location, phenotypic, source, sample, infection, medication, manipulation, transport, and treatment components in the basic characteristic components corresponding to each Klebsiella pneumoniae case data within the group is statistically analyzed to determine the dominant distribution characteristic components of this group of Klebsiella pneumoniae case data groups; the overlap between the basic characteristic components of each Klebsiella pneumoniae case data within the group and the dominant distribution characteristic components of this group of Klebsiella pneumoniae case data groups is calculated as the deviation of each Klebsiella pneumoniae case data from its corresponding Klebsiella pneumoniae case data group, wherein the time and patient components in the basic characteristic components of each Klebsiella pneumoniae case data are not included in the calculation.

[0019] In conjunction with the seventh possible implementation of the first aspect, in the ninth possible implementation of the first aspect, the homology group-level classification module determines the classification probability vector to which the Klebsiella pneumoniae case data belongs based on the deviation and classification probability vector corresponding to each Klebsiella pneumoniae case data group: , in, For the first The probability vector of the classification of each group of Klebsiella pneumoniae case data. For the first A Klebsiella pneumoniae case data set grouped into individual Klebsiella pneumoniae case data sets. For the first The total number of Klebsiella pneumoniae case data in each Klebsiella pneumoniae case data group. , For the first In the data group of Klebsiella pneumoniae cases, the first Deviation corresponding to individual Klebsiella pneumoniae case data For the first In the data group of Klebsiella pneumoniae cases, the first The classification probability vector corresponding to each Klebsiella pneumoniae case data.

[0020] Beneficial effects: The emergency treatment suggestion generation method based on Klebsiella pneumoniae classification prediction provided in this application integrates basic features and transmission features in feature extraction. Traditional pathogen classification or drug resistance prediction models based on machine learning usually rely on the phenotypic data of the strain itself (such as drug susceptibility test results) or the static clinical information of individual patients (such as underlying diseases, infection type, etc.), and the feature vector is often a simple concatenation of these independent data points. However, hospital-acquired infections, especially opportunistic pathogens such as Klebsiella pneumoniae commonly found in high-risk environments such as ICUs, exhibit clear spatiotemporal clustering and complex human-object-environment interactions. Therefore, this solution innovatively introduces two core steps: "homologous grouping" and "transmission route analysis," changing the logic of feature construction. First, homology is determined and data groups are formed using mass spectrometry. This step initially links isolated case data points into possible transmission chains, laying the foundation for subsequent analysis. Second, in the feature extraction stage, the scheme not only extracts basic feature components covering dimensions such as time, location, patient, strain phenotype, and treatment procedures, but also quantifies potential transmission feature components by constructing a directed transmission network based on the basic data within the groups. Using cases as nodes and the calculated transmission index as directed edge weights, multiple dimensions such as time decay, location overlap, departmental association, and overlapping treatment procedures are integrated, enabling the model to infer possible sources of infection and quantify transmission risk. Indicators such as in-degree, out-degree, betweenness centrality, and proximity centrality of each case node are aggregated at the departmental level to form a departmental-level entry and exit transmission risk index. The final determined transmission feature components constitute a highly condensed and dynamic epidemiological risk profile, quantifying the source, bridging, and susceptibility of the case in the potential transmission network, as well as the output and input risk levels of its department. This allows the final classification prediction model to utilize not only the individual status of the strain and the patient (basic feature components), but also the ecological niche information of infection transmission, thereby ensuring the reliability and accuracy of the model in identifying highly infectious and outbreak-prone strains.

[0021] This scheme employs a two-level classification mechanism in the classification prediction stage. Instead of the traditional single-model structure of input feature-output classification, it sets up a two-level architecture: a primary classification module (random forest model) and a homology group-level classification module (integrating homology case groups). The primary classification module predicts each case independently, outputting a classification probability vector. The homology group-level classification module integrates homology data for consistency calibration. First, it calculates the deviation of each case's features within the group from the group's dominant distribution features (which can be understood as the overall characteristics of homology cases), aiming to assess the typicality of individual cases within the group. When summarizing the prediction results of all cases within the group, it does not simply average, but uses a weighted average with deviation as the weight. This means that cases that are more consistent with the mainstream features within the group and are more typical contribute more to the final group classification decision. This mechanism effectively mitigates misjudgments caused by noise or outliers in individual case data. Through mutual verification and calibration of information within the group, it helps improve the robustness and reliability of the classification results.

[0022] Based on the classification results (such as being identified as highly virulent, highly drug-resistant, highly infectious, or a combination thereof), combined with pre-set emergency response recommendations (for example, for strains predicted to be highly virulent and with a high risk of transmission, recommendations may include "immediately implementing contact isolation, strengthening environmental disinfection, screening close contacts, and prioritizing the use of specific antibiotics such as tigecycline"; for highly drug-resistant strains, such as carbapenem-resistant strains, recommendations emphasize stopping the use of empirical carbapenems, initiating drug susceptibility testing, considering combination therapy, and reporting to the hospital infection control department), a complete closed loop is formed from data input to prediction and classification to emergency response recommendations, meeting the urgent need for rapid response tools during the transition period.

[0023] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0024] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 A flowchart illustrating the emergency response recommendation generation method based on Klebsiella pneumoniae classification prediction provided in this application embodiment.

[0026] Figure 2 This is a schematic diagram of the MLST typing test for a certain Klebsiella pneumoniae.

[0027] Figure 3 This is a schematic diagram of the virulence gene detection of this Klebsiella pneumoniae.

[0028] Figure 4 This is a schematic diagram of the drug resistance gene detection for this Klebsiella pneumoniae. Detailed Implementation

[0029] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0030] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for generating emergency response recommendations based on Klebsiella pneumoniae classification prediction, as provided in an embodiment of this application. The method may include steps S10, S20, S30, S40, and S50.

[0031] In this embodiment, step S10 can be executed.

[0032] Step S10: Obtain Klebsiella pneumoniae case data for a set time period. Each Klebsiella pneumoniae case data includes sampling time, case location, phenotypic characteristics, patient basic data, department origin, department sample type, department infection type, medication data, diagnosis and treatment operation data, inpatient transfer records, treatment outcome, and mass spectrometry.

[0033] First, Klebsiella pneumoniae case data for a set time period is obtained. In this embodiment, the collection cycle is 1 week, that is, the collection frequency is once a week. Therefore, the set time period is set to 2 weeks (that is, the latest data of this week needs to be combined with the historical data of the previous week for analysis) to ensure data continuity.

[0034] Each Klebsiella pneumoniae case data includes sampling time (accurate to the minute), case location (specific to the hospital name), phenotypic characteristics (including resistance spectrum and virulence phenotype; virulence phenotype includes whether there is a high mucin phenotype, serum resistance, hemolysis, etc., while the resistance spectrum includes resistance to imipenem, meropenem, ceftazidime, cefotaxime, cefepime, piperacillin, ampicillin, aztreonam, gentamicin, amikacin, ciprofloxacin, levofloxacin, tigecycline, polymyxin E, and trimethoprim-sulfamethoxazole), basic patient data (mainly including patient age and underlying diseases, including diabetes, chronic lung disease, chronic liver disease, chronic kidney disease, malignant tumors, etc.), department (ICU, respiratory department, pediatrics, urology, other departments), and department sample type (sputum, blood). Data includes: urine, other fluids such as drainage fluid and secretions; type of infection (hospital-acquired, community-acquired); medication data (use of imipenem, meropenem, ceftazidime, cefotaxime, cefepime, piperacillin, ampicillin, aztreonam, gentamicin, amikacin, ciprofloxacin, levofloxacin, tigecycline, polymyxin E, and sulfamethoxazole, covering carbapenems, third-generation cephalosporins, fluoroquinolones, aminoglycosides, tigecycline, and polymyxin); clinical data (including ventilator use and central venous catheter use); inpatient transfer records (ICU to general ward, general ward to ICU, none); treatment outcomes (under treatment, cured, transferred to another hospital, etc.); and mass spectrometry (obtained using a MALDI-TOF MS instrument).

[0035] After obtaining Klebsiella pneumoniae case data, step S20 can be executed.

[0036] Step S20: Based on the mass spectrometry data of Klebsiella pneumoniae cases, identify homologous Klebsiella pneumoniae cases and integrate the homologous Klebsiella pneumoniae cases to obtain Klebsiella pneumoniae case data groups.

[0037] In this embodiment, homology analysis can be performed on the mass spectra. The mass spectrum of Klebsiella pneumoniae is mainly composed of ribosomal proteins and other high-abundance proteins. These proteins have slight differences (such as amino acid substitutions or modifications) among different strains, which are reflected in the shift or presence of mass spectra peaks. If the strains come from the same clone or a recent common ancestor, their mass spectra are highly similar, with almost identical characteristic peak patterns. If the strains are distantly related, the mass spectra will show significantly different peak patterns or intensity differences. Homology analysis using mass spectra is a well-established technique in the field and will not be elaborated upon here.

[0038] After completing the homology analysis, the Klebsiella pneumoniae case data of homologous strains can be integrated to obtain Klebsiella pneumoniae case data groups. The number of Klebsiella pneumoniae case data in a Klebsiella pneumoniae case data group can be single or multiple.

[0039] After grouping is complete, step S30 can be run.

[0040] Step S30: Based on the Klebsiella pneumoniae case data grouping, determine the feature vector of each Klebsiella pneumoniae case data.

[0041] Data was grouped for each Klebsiella pneumoniae case: Preprocessing (e.g., outlier handling, deduplication) can be performed on the Klebsiella pneumoniae case data within each group. Then, feature extraction can be performed on the sampling time, case location, phenotypic characteristics, patient basic data, department origin, department sample type, department infection type, medication data, diagnosis and treatment operation data, inpatient transfer records, and treatment outcomes of each Klebsiella pneumoniae case data within the group to obtain the basic feature components of each Klebsiella pneumoniae case data within the group.

[0042] For example, data on a single Klebsiella pneumoniae case: Regarding sampling time: The sampling time is processed into year, month, day, hour, and minute (e.g., 2025-05-08-14:30, occupying 5 dimensions), the number of quarters within the year (e.g., the 2nd quarter, occupying 1 dimension), the number of days between the sampling time and the previous Klebsiella pneumoniae case data in the group (e.g., 3 days, occupying 1 dimension), and the number of days between the sampling time and the previous Klebsiella pneumoniae case data in the same department (e.g., 1 day, occupying 1 dimension), resulting in a total of 8 dimensions.

[0043] Regarding the location of the case: the hospital number of the hospital where the case was admitted is used as the location component, occupying 1 dimension.

[0044] For the patient's basic data: the underlying diseases are processed using unique hot coding and concatenated with the patient's age to obtain the patient component. The underlying diseases include diabetes (1 for having diabetes, 0 for not having diabetes, occupying 1 dimension), chronic lung disease (1 for having chronic lung disease, 0 for not having chronic lung disease, occupying 1 dimension), chronic liver disease (1 for having chronic liver disease, 0 for not having chronic liver disease, occupying 1 dimension), chronic kidney disease (1 for having chronic kidney disease, 0 for not having chronic kidney disease, occupying 1 dimension), and malignant tumor (1 for having malignant tumor, 0 for not having malignant tumor, occupying 1 dimension). Age occupies 1 dimension, for a total of 6 dimensions.

[0045] Regarding phenotypic characteristics: The drug resistance spectrum and virulence phenotype of Klebsiella pneumoniae case data were processed using one-heat encoding to obtain phenotypic components. The virulence phenotype includes whether or not there is a high-mucus phenotype (represented by 1 for high-mucus phenotype and 0 for non-high-mucus phenotype, occupying 1 dimension) and serum resistance (serum resistance level, reflected by calculating strain survival rate through serum bactericidal tests; this dimension can retain numerical values ​​or be compared according to a threshold; values ​​above the threshold indicate high serum resistance, recorded as 1, and values ​​below the threshold indicate low serum resistance, recorded as 0. This embodiment uses the latter, occupying 1 dimension). (1 dimension), hemolysis (observed by the presence of a transparent hemolytic zone around the colony in a blood agar plate culture test; data is recorded as whether hemolysis is present, 1 for hemolysis and 0 for non-hemolysis, occupying 1 dimension), resistance spectrum includes imipenem (sensitive 0, intermediate 1, resistant 2, occupying 1 dimension), meropenem (sensitive 0, intermediate 1, resistant 2, occupying 1 dimension), ceftazidime (sensitive 0, intermediate 1, resistant 2, occupying 1 dimension), cefotaxime (sensitive 0, intermediate 1, resistant 2, occupying 1 dimension), cefotaxime (sensitive 0, intermediate 1, resistant 2, occupying 1 dimension). The following drugs are listed: * **Cefepime (sensitivity 0, intermediate 1, resistance 2, occupying 1 dimension):** * **Piperacillin (sensitivity 0, intermediate 1, resistance 2, occupying 1 dimension):** * **Ampicillin (sensitivity 0, intermediate 1, resistance 2, occupying 1 dimension):** * **Aztreonam (sensitivity 0, intermediate 1, resistance 2, occupying 1 dimension):** * **Gentamicin (sensitivity 0, intermediate 1, resistance 2, occupying 1 dimension):** * **Amika ... 1. Resistance is recorded as 2, occupying 1 dimension), ciprofloxacin (susceptibility is recorded as 0, intermediate as 1, resistance as 2, occupying 1 dimension), levofloxacin (susceptibility is recorded as 0, intermediate as 1, resistance as 2, occupying 1 dimension), tigecycline (susceptibility is recorded as 0, intermediate as 1, resistance as 2, occupying 1 dimension), polymyxin E (susceptibility is recorded as 0, intermediate as 1, resistance as 2, occupying 1 dimension), and trimethoprim-sulfamethoxazole (susceptibility is recorded as 0, intermediate as 1, resistance as 2, occupying 1 dimension), totaling 18 dimensions for phenotypic components.

[0046] For department source: The department source (the first department recorded as the department source) is processed by one-hot encoding to obtain the source component. The department source includes ICU (represented by 1), respiratory department (represented by 2), pediatrics (represented by 3), urology (represented by 4), and other departments (represented by 5), occupying 1 dimension.

[0047] For department sample types: The department sample types are processed by one-hot encoding to obtain sample components. The department sample types include sputum (represented by 1), blood (represented by 2), urine (represented by 3), and others (represented by 4), occupying 1 dimension.

[0048] For departmental infection types: The departmental sample types are processed by one-hot encoding to obtain infection components. Among them, the departmental infection type includes hospital-acquired (represented by 1) and community-acquired (represented by 2), occupying 1 dimension.

[0049] For medication data: The medication data is processed using unique heat encoding to obtain medication components. These components include the usage of imipenem, meropenem, ceftazidime, cefotaxime, cefepime, piperacillin, ampicillin, aztreonam, gentamicin, amikacin, ciprofloxacin, levofloxacin, tigecycline, polymyxin E, and trimethoprim-sulfamethoxazole. Medication usage statistics use a simple dimension: whether or not the drug was used, without considering complex factors such as dosage, cycle, or combination therapy. Therefore, for each medication usage, if the drug was used, it is recorded as 1; if not, it is recorded as 0, for a total of 15 dimensions.

[0050] For the diagnostic and treatment operation data: The diagnostic and treatment operation data is processed by unique heat encoding to obtain operation components. The diagnostic and treatment operation data includes the usage status of ventilators (used is recorded as 1, not used is recorded as 0) and the usage status of central venous catheters (used is recorded as 1, not used is recorded as 0), for a total of 2 dimensions.

[0051] For inpatient transfer records: The inpatient transfer records are processed by one-hot encoding to obtain the transfer component. The transfer component is assigned 4 dimensions: no transfer record is represented by 1, ICU to general ward is represented by 2, general ward to ICU is represented by 3, and any part that is not long enough is filled with 0.

[0052] Regarding treatment outcomes: The treatment outcomes are processed using one-hot encoding to obtain treatment components, where treatment outcomes include treatment in progress (represented by 1), cure (represented by 2), and transfer to another hospital (represented by 3), occupying 1 dimension.

[0053] Then, the following components were sequentially concatenated: time component (8 dimensions), location component (1 dimension), patient component (6 dimensions), phenotype component (18 dimensions), source component (1 dimension), sample component (1 dimension), infection component (1 dimension), medication component (15 dimensions), operation component (2 dimensions), transport component (4 dimensions), and treatment component (1 dimension). This yielded the basic characteristic components (a total of 58 dimensions) for each Klebsiella pneumoniae case within the group. The basic characteristic components for each Klebsiella pneumoniae case are denoted as follows: This refers to the transmission characteristic component of Klebsiella pneumoniae case data.

[0054] Subsequently, transmission route analysis can be performed based on the basic characteristic components of each Klebsiella pneumoniae case data within the group to determine the transmission route analysis results as transmission characteristic components.

[0055] For example, each Klebsiella pneumoniae case in the group is used as a node to construct directed edges. The directed edges between nodes are constructed according to location association (i.e., the cases are located in hospitals in the same region, and the region size is measured in districts and counties). The direction of the directed edges follows the time order, from the node with the earlier sampling time to the node with the later sampling time.

[0056] Then, a propagation index can be calculated for each pair of nodes. The propagation index calculation includes a time decay term, a department association term, and a diagnosis and treatment operation association term.

[0057] For example, for any pair of nodes (a pair of nodes with a directed edge relationship): Node With nodes , And sampling time Less than sampling time The propagation index is calculated using the following method: , , , , in, Represents a node With nodes The propagation index between nodes The sampling time is earlier than the node Sampling time, , and The weights are positive, and , For nodes With nodes The number of days between them To set a period, For nodes With nodes The degree of overlap between the locations For nodes With nodes The degree of overlap between departments For nodes With nodes The degree of overlap in operations between them and Representing nodes respectively and nodes Hospital number, and Representing nodes respectively and nodes The source of the department, and Representing nodes respectively and nodes There are ICU transfer records. and Representing nodes respectively and nodes The use of ventilators, Represents a node and nodes At least one of the patients was not on a ventilator. Represents a node and nodes Both were on ventilators. and Representing nodes respectively and nodes The use of central venous catheters, Represents a node and nodes At least one of the partners was not using a central venous catheter. Represents a node and nodes Both parties used central venous catheters.

[0058] After calculating the propagation index for each pair of nodes, the node centrality of each node can be calculated. Node centrality includes in-degree, out-degree, betweenness centrality, and proximity centrality.

[0059] For example, for each node: compute nodes in-degree: , in, For nodes in-degree, node For a set of nodes Middle pointer node The node, For nodes With nodes The transmission index between them; compute nodes Out-degree: , in, For nodes Out-degree, node For a set of nodes Middle node The node it points to For nodes With nodes The transmission index between them; compute nodes Betweenness centrality: , in, Represents a node betweenness centrality, Indicates from node To the node The total number of shortest paths, At that time, take , Indicates from node To the node The shortest path passes through the nodes The number of paths, where the shortest path represents the path with the highest overall propagation index among the propagation paths; compute nodes The ingress centrality is close to: , in, For nodes The ingress is close to centrality. Indicates reachable nodes The set of nodes, For a set of nodes The number of nodes in For nodes To the node The shortest path distance, At that time, take ,and satisfy: , in, Represents a node To the node The shortest path propagation index is the overall propagation index of the path, which is the number of nodes in the shortest path that propagate the path. propagation to nodes The product of the propagation exponents of each segment along the directed edge, and ; compute nodes Approximate centrality: , in, For nodes The centrality is close to that of the target. Represents a node The set of reachable nodes For a set of nodes The number of nodes in For nodes To the node The shortest path distance, At that time, take ,and satisfy: , in, Represents a node To the node The shortest path propagation index is the overall propagation index of the path, which is the number of nodes in the shortest path that propagate the path. propagation to nodes The product of the propagation exponents of each segment along the directed edge, and .

[0060] After calculating the node centrality of each node, the propagation feature components of the node can be determined and output based on the node centrality of each node.

[0061] For example, we can count the set of nodes originating from each department and calculate the departmental transmission risk index corresponding to each set of nodes originating from each department: , in, For the department Departmental transmission risk index Belonging to the department The set of nodes, For a set of nodes Middle node in-degree, For a set of nodes The number of nodes in, and At that time, take ; For nodes Integration of propagation feature components: , in, For nodes The propagation feature component is a 15-dimensional feature component.

[0062] After determining the propagation feature components of each node, the basic feature components and the propagation feature components can be concatenated to obtain the feature vector of each Klebsiella pneumoniae case data within the group. The processing method for each Klebsiella pneumoniae case data group is similar, which allows for the extraction of feature vectors from all Klebsiella pneumoniae case data. The feature vectors for each Klebsiella pneumoniae case data group maintain a uniform dimension and are associated with a unique case number (the unique case number is not included in the model calculation and is therefore not reflected).

[0063] Then, step S40 can be run.

[0064] Step S40: Input the feature vector of each Klebsiella pneumoniae case data into the Klebsiella pneumoniae classification model to determine the category to which each Klebsiella pneumoniae case data belongs.

[0065] The Klebsiella pneumoniae classification model is designed to include a primary classification module and a homology-level classification module.

[0066] The primary classification module uses a random forest model to determine the classification probability vector corresponding to each Klebsiella pneumoniae case based on the feature vector of each case. Each element in the classification probability vector is used to reveal the probability that the Klebsiella pneumoniae case belongs to the corresponding category.

[0067] In the primary classification module here, the random forest model is chosen because it takes into account factors such as the number of samples, sample balance, and data dimensionality. The random forest model is more suitable for this situation. Of course, other models can also be used, such as support vector machines or other machine learning models, but they need to have non-linear capabilities. Models that can only handle linear relationships, such as linear regression models, are not suitable.

[0068] First, a sample set needs to be constructed (e.g., collecting 500 samples). This sample set is also obtained by collecting historical Klebsiella pneumoniae case data (which requires MLST typing, virulence gene testing, and drug resistance gene testing to have been completed, such as...). Figures 2-4 As shown in the figure, feature vectors are extracted according to the previous feature extraction steps, and then sample labels are associated. The sample labels are determined by the staff by comprehensively considering factors such as MLST typing, virulence, drug resistance and infectivity. The label types are: low infectivity-low virulence-low drug resistance, low infectivity-low virulence-high drug resistance, low infectivity-high virulence-low drug resistance, low infectivity-high virulence-high drug resistance, high infectivity-low virulence-low drug resistance, high infectivity-low virulence-high drug resistance, high infectivity-high virulence-low drug resistance, high infectivity-high virulence-low drug resistance, high infectivity-high virulence-high drug resistance, and high infectivity-high virulence-high drug resistance, for a total of 8 sample labels.

[0069] Random forest models can be built using Python, with scikit-learn as the core library, providing a highly optimized and easy-to-use RandomForestClassifier module. The parameters for building the model are set as follows: n_estimators: The number of decision trees in the forest, taking 150 as an example (it can also be less, such as 100, to reduce the training time, or more, such as 200, to improve model performance).

[0070] max_depth: The maximum depth allowed for each decision tree, with a limit of 15.

[0071] max_features: The number of features randomly considered when each tree is searching for the best split point. It is set to sqrt, which is the square root.

[0072] min_samples_split: The minimum number of samples a node must contain before it can be split further. Setting it to 5 prevents the tree from learning strange rules from a very small number of samples.

[0073] min_samples_leaf: The minimum number of samples a leaf node must contain; the value is set to 3.

[0074] Criterion: The criterion for selecting the best splitting feature in a decision tree. We choose Gini impurity.

[0075] class_weight: Setting this parameter to balanced allows the model to automatically adjust the weights, reducing the impact of sample imbalance.

[0076] Bootstrap: Sample with replacement, set to True.

[0077] random_state: Random seed, set to 42 to ensure repeatability of results.

[0078] After the model is built, the sample set can be divided into training, validation, and test sets in a 7:2:1 ratio. Accuracy, precision, recall, and F1 score are used for evaluation, as shown in Table 1 below. Table 1. Model evaluation results for the test set Class label Precision Recall F1 Support Low infectiousness - low virulence - low drug resistance 0.857 0.750 0.800 8 Low infectiousness - low virulence - high drug resistance 0.714 0.714 0.714 7 Low infectiousness - high virulence - low drug resistance 0.800 0.667 0.727 6 Low infectiousness - high virulence - high drug resistance 0.625 0.600 0.612 5 High infectiousness - low virulence - low drug resistance 0.875 0.875 0.875 8 High infectiousness - low virulence - high drug resistance 0.750 0.750 0.750 6 High infectiousness - high virulence - low drug resistance 0.700 0.600 0.646 5 High infectiousness - high virulence - high drug resistance 0.667 0.600 0.632 5 The calculation accuracy is: 38 / 50 = 0.76.

[0079] After training, the primary classification module can determine the classification probability vector (an 8-dimensional vector, where the value of each element in the vector is between 0 and 1, and the sum of the elements is 1) for each Klebsiella pneumoniae case data based on the feature vector of each Klebsiella pneumoniae case data. Each element in the classification probability vector is used to reveal the probability that the Klebsiella pneumoniae case data belongs to the corresponding category.

[0080] Primary classification is a case-level classification. Although the classification of cases in the homologous group level is generally consistent, there are also cases of inconsistency. However, the classification of cases in the homologous group level is basically of the same type. Therefore, after observation, the applicant found that the classification of typical cases in the group was almost correct. Therefore, a homologous group level classification module was designed to perform classification calibration.

[0081] For each Klebsiella pneumoniae case data group: the homology group classification module can be used to determine the deviation of each Klebsiella pneumoniae case data within a group from its corresponding Klebsiella pneumoniae case data group.

[0082] The deviation is determined by analyzing the distribution of location, phenotype, source, sample, infection, medication, operation, transport, and treatment components in the basic characteristic components corresponding to each Klebsiella pneumoniae case data within the statistical group. This identifies the dominant distribution characteristic components for this group of Klebsiella pneumoniae case data. The dominant distribution characteristic components represent the distribution of most Klebsiella pneumoniae case data in their respective components. The time and patient components in the basic characteristic components of each Klebsiella pneumoniae case data are not included in the calculation because they are not very meaningful and would introduce errors.

[0083] Of course, when there are few samples in a group, it is inevitable that the distribution will be uniform. For example, in the operation components, there are 3 (1,1), 3 (1,0), 1 (0,0), and 0 (0,1). Then, the operation components (1,1) and (1,0) belong to the strong distribution. When calculating the basic feature components of a case, whether the operation component is (1,1) or (1,0), it is consistent with the operation component in the strong distribution feature components, while (0,0) and (0,1) are inconsistent with the operation component in the strong distribution feature components.

[0084] Accordingly, the degree of overlap between the basic characteristic components of each Klebsiella pneumoniae case data within a group and the dominant distribution characteristic components of the Klebsiella pneumoniae case data group can be calculated (e.g., complete consistency, 100% overlap; if eight of the location, phenotypic, source, sample, infection, medication, operation, transport, and treatment components of the Klebsiella pneumoniae case data overlap with the dominant distribution characteristic components of the Klebsiella pneumoniae case data group, then the overlap is 8 / 9 = 88.9%). This is used as the deviation of each Klebsiella pneumoniae case data from its respective Klebsiella pneumoniae case data group. The time and patient components in the basic characteristic components of each Klebsiella pneumoniae case data are not included in the calculation.

[0085] Subsequently, the homologous group-level classification module can determine the classification probability vector to which each Klebsiella pneumoniae case data group belongs based on the deviation and classification probability vector corresponding to each Klebsiella pneumoniae case data.

[0086] Specifically, the deviation corresponding to each Klebsiella pneumoniae case data can be used as a weight to calculate the weighted average of the classification probability vectors of this Klebsiella pneumoniae case data group, which is then used as the classification probability vector of this Klebsiella pneumoniae case data group.

[0087] For example, the method for determining the classification probability vector to which this group of Klebsiella pneumoniae case data belongs is as follows: , in, For the first The probability vector of the classification of each group of Klebsiella pneumoniae case data. For the first A Klebsiella pneumoniae case data set grouped into individual Klebsiella pneumoniae case data sets. For the first The total number of Klebsiella pneumoniae case data in each Klebsiella pneumoniae case data group. , For the first In the data group of Klebsiella pneumoniae cases, the first Deviation corresponding to individual Klebsiella pneumoniae case data For the first In the data group of Klebsiella pneumoniae cases, the first The classification probability vector corresponding to each Klebsiella pneumoniae case data.

[0088] Accordingly, the homologous group-level classification module can determine the classification with the highest probability in the classification probability vector as the classification of each Klebsiella pneumoniae case data in the group, thereby realizing the calibration of the classification of each Klebsiella pneumoniae case data in the group.

[0089] Once the classification (calibrated classification) of each Klebsiella pneumoniae case data is determined, step S50 can be run.

[0090] Step S50: Generate emergency treatment recommendations based on the classification corresponding to each Klebsiella pneumoniae case data.

[0091] In this embodiment, based on the classification of Klebsiella pneumoniae case data, emergency treatment recommendations associated with the category can be determined to alert staff to potentially high-risk bacterial species, enabling them to take appropriate measures promptly. Of course, more detailed recommendations are also possible. For example, based on the classification and dominant distribution characteristic components of the Klebsiella pneumoniae case data, corresponding recommendations can be generated (e.g., if the strain is highly resistant to certain drugs but sensitive to others, then the use of drugs that the strain is sensitive to is recommended). This is not limited here.

[0092] In summary, this application provides a method for generating emergency treatment recommendations based on Klebsiella pneumoniae classification prediction. In terms of feature extraction, it integrates basic features and transmission features. Traditional machine learning-based pathogen classification or drug resistance prediction models typically rely on the phenotypic data of the strain itself (such as drug susceptibility test results) or the static clinical information of individual patients (such as underlying diseases, infection type, etc.), and the feature vector is often a simple concatenation of these independent data points. However, hospital-acquired infections, especially opportunistic pathogens like Klebsiella pneumoniae commonly found in high-risk environments such as ICUs, exhibit clear spatiotemporal clustering and complex human-object-environment interactions. Therefore, this solution innovatively introduces two core components: "homologous grouping" and "transmission route analysis," changing the logic of feature construction. First, homology is determined and data groups are formed using mass spectrometry. This step initially links isolated case data points into possible transmission chains, laying the foundation for subsequent analysis. Second, in the feature extraction stage, the scheme not only extracts basic feature components covering dimensions such as time, location, patient, strain phenotype, and treatment procedures, but also quantifies potential transmission feature components by constructing a directed transmission network based on the basic data within the groups. Using cases as nodes and the calculated transmission index as directed edge weights, multiple dimensions such as time decay, location overlap, departmental association, and overlapping treatment procedures are integrated, enabling the model to infer possible sources of infection and quantify transmission risk. Indicators such as in-degree, out-degree, betweenness centrality, and proximity centrality of each case node are aggregated at the departmental level to form a departmental-level entry and exit transmission risk index. The final determined transmission feature components constitute a highly condensed and dynamic epidemiological risk profile, quantifying the source, bridging, and susceptibility of the case in the potential transmission network, as well as the output and input risk levels of its department. This allows the final classification prediction model to utilize not only the individual status of the strain and the patient (basic feature components), but also the ecological niche information of infection transmission, thereby ensuring the reliability and accuracy of the model in identifying highly infectious and outbreak-prone strains.

[0093] A two-level classification mechanism was designed in the classification prediction stage. Instead of the traditional single-model structure of input feature-output classification, a two-level architecture was set up: a primary classification module (random forest model) and a homology group-level classification module (integrating homology case groups). The primary classification module predicts each case independently, outputting a classification probability vector. The homology group-level classification module integrates homology data for consistency calibration. First, it calculates the deviation of each case's features within the group from the group's dominant distribution features (which can be understood as the overall characteristics of homology cases), aiming to assess the typicality of a single case within the group. When summarizing the prediction results of all cases within the group, instead of a simple average, a weighted average is performed using the deviation as the weight. This means that cases that are more consistent with the mainstream features within the group and are more typical contribute more to the final group classification decision. This mechanism effectively mitigates misjudgments caused by noise or outliers in individual case data. Through mutual verification and calibration of information within the group, it helps improve the robustness and reliability of the classification results.

[0094] Based on the classification results (such as being identified as highly virulent, highly drug-resistant, highly infectious, or a combination thereof), combined with pre-set emergency response recommendations (for example, for strains predicted to be highly virulent and with a high risk of transmission, recommendations may include "immediately implementing contact isolation, strengthening environmental disinfection, screening close contacts, and prioritizing the use of specific antibiotics such as tigecycline"; for highly drug-resistant strains, such as carbapenem-resistant strains, recommendations emphasize stopping the use of empirical carbapenems, initiating drug susceptibility testing, considering combination therapy, and reporting to the hospital infection control department), a complete closed loop is formed from data input to prediction and classification to emergency response recommendations, meeting the urgent need for rapid response tools during the transition period.

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

Claims

1. A method for generating emergency treatment recommendations based on Klebsiella pneumoniae classification prediction, characterized in that, include: Acquire Klebsiella pneumoniae case data for a specified time period. Each Klebsiella pneumoniae case data includes sampling time, case location, phenotypic characteristics, basic patient data, department of origin, department sample type, department infection type, medication data, diagnosis and treatment operation data, inpatient transfer records, treatment outcome, and mass spectrometry. Based on the mass spectrometry data of Klebsiella pneumoniae cases, homologous Klebsiella pneumoniae cases were identified, and the homologous Klebsiella pneumoniae cases were integrated to obtain Klebsiella pneumoniae case data grouping. Based on the grouping of Klebsiella pneumoniae case data, the feature vector of each Klebsiella pneumoniae case data was determined; The feature vector of each Klebsiella pneumoniae case data is input into the Klebsiella pneumoniae classification model to determine the category to which each Klebsiella pneumoniae case data belongs; Emergency treatment recommendations are generated based on the classification corresponding to each Klebsiella pneumoniae case.

2. The method for generating emergency treatment recommendations based on Klebsiella pneumoniae classification prediction according to claim 1, characterized in that, Based on the grouping of Klebsiella pneumoniae case data, a feature vector was determined for each Klebsiella pneumoniae case data point, including: Data for each group of Klebsiella pneumoniae cases: Preprocessing of data for each Klebsiella pneumoniae case within the group; The sampling time, case location, phenotypic characteristics, basic patient data, department origin, department sample type, department infection type, medication data, diagnosis and treatment operation data, inpatient transfer records, and treatment outcomes of each Klebsiella pneumoniae case data in the group were used to extract the basic feature components of each Klebsiella pneumoniae case data in the group. Transmission route analysis was performed based on the basic characteristic components of each Klebsiella pneumoniae case data within the group, and the results of the transmission route analysis were used as transmission characteristic components. By splicing together the basic feature components and the transmission feature components, the feature vector of each Klebsiella pneumoniae case data in the group is determined. The dimension of the feature vector of each Klebsiella pneumoniae case data is kept uniform and associated with a unique case number.

3. The method for generating emergency treatment recommendations based on Klebsiella pneumoniae classification prediction according to claim 2, characterized in that, Feature extraction was performed on the sampling time, case location, phenotypic characteristics, basic patient data, department of origin, departmental sample type, departmental infection type, medication data, diagnostic and treatment operation data, inpatient transfer records, and treatment outcomes of each Klebsiella pneumoniae case data within the group. This yielded the basic feature components for each Klebsiella pneumoniae case data within the group, including: Regarding sampling time: The sampling time is processed into year, month, day, hour, minute, the number of quarters within the year, the number of days between the data of the previous Klebsiella pneumoniae case in the group, and the number of days between the data of the previous Klebsiella pneumoniae case in the same department, to obtain the time component; Regarding the location of the case: the hospital number of the hospital where the case was admitted is used as the location component; Based on the patient's basic data: the underlying diseases are processed using unique hot coding, and concatenated with the patient's age to obtain the patient's weight. The underlying diseases include diabetes, chronic lung disease, chronic liver disease, chronic kidney disease, and malignant tumors. Based on phenotypic characteristics: The drug resistance spectrum and virulence phenotype of Klebsiella pneumoniae case data were processed by unique heat coding to obtain phenotypic components. Among them, the virulence phenotype includes whether there is a high mucin phenotype, serum resistance, and hemolysis. The drug resistance spectrum includes resistance to imipenem, meropenem, ceftazidime, cefotaxime, cefepime, piperacillin, ampicillin, aztreonam, gentamicin, amikacin, ciprofloxacin, levofloxacin, tigecycline, polymyxin E, and trimethoprim-sulfamethoxazole. For department sources: The department sources are processed using unique hot coding to obtain source components. Among them, the department sources include ICU, respiratory department, pediatrics, urology, and other departments. For departmental sample types: the departmental sample types are processed by unique hot coding to obtain sample components, where the departmental sample types include sputum, blood, urine, and others; For departmental infection types: departmental sample types are processed using unique thermal coding to obtain infection components, where departmental infection types include hospital-acquired and community-acquired; Regarding medication data: The medication data is processed using unique thermal coding to obtain the dosage. The medication data includes the usage of imipenem, meropenem, ceftazidime, cefotaxime, cefepime, piperacillin, ampicillin, aztreonam, gentamicin, amikacin, ciprofloxacin, levofloxacin, tigecycline, polymyxin E, and trimethoprim-sulfamethoxazole. For diagnostic and treatment operation data: the diagnostic and treatment operation data is processed by unique thermal encoding to obtain operation components, which include the use of ventilators and the use of central venous catheters; For inpatient transfer records: The inpatient transfer records are processed by one-hot encoding to obtain transfer components. The transfer components are assigned 4 dimensions: no transfer record is represented by 1, ICU to general ward is represented by 2, general ward to ICU is represented by 3, and any part that is not long enough is filled with 0. Regarding treatment outcomes: The treatment outcomes are processed using unique heat encoding to obtain treatment components, which include treatment in progress, cured, and transferred to another hospital; By sequentially splicing the time component, location component, patient component, phenotype component, source component, sample component, infection component, medication component, operation component, transport component, and treatment component, the basic characteristic components of each Klebsiella pneumoniae case data within the group are obtained.

4. The method for generating emergency treatment recommendations based on Klebsiella pneumoniae classification prediction according to claim 2, characterized in that, Transmission route analysis was performed based on the fundamental characteristic components of each Klebsiella pneumoniae case data within the group. The results of the transmission route analysis were used as transmission characteristic components, including: Each Klebsiella pneumoniae case in the group is used as a node to construct directed edges, where directed edges between nodes are constructed according to location association and the direction of the directed edges follows the time order; For each pair of nodes, a propagation index is calculated, which includes a time decay term, a departmental association term, and a diagnosis and treatment operation association term. Calculate the node centrality of each node, where node centrality includes in-degree, out-degree, betweenness centrality, and proximity centrality; Based on the node centrality of each node, the propagation feature components are determined and output.

5. The method for generating emergency treatment recommendations based on Klebsiella pneumoniae classification prediction according to claim 4, characterized in that, For any pair of nodes: Nodes With nodes , And sampling time Less than sampling time The propagation index is calculated using the following method: , , , , in, Represents a node With nodes The propagation index between nodes The sampling time is earlier than the node Sampling time, , and The weights are positive, and , For nodes With nodes The number of days between them To set a period, For nodes With nodes The degree of overlap between the locations For nodes With nodes The degree of overlap between departments For nodes With nodes The degree of overlap in operations between them and Representing nodes respectively and nodes Hospital number, and Representing nodes respectively and nodes The source of the department, and Representing nodes respectively and nodes There are ICU transfer records. and Representing nodes respectively and nodes The use of ventilators, Represents a node and nodes At least one of the patients was not on a ventilator. Represents a node and nodes Both were on ventilators. and Representing nodes respectively and nodes The use of central venous catheters, Represents a node and nodes At least one of the partners was not using a central venous catheter. Represents a node and nodes Both parties used central venous catheters.

6. The method for generating emergency treatment recommendations based on Klebsiella pneumoniae classification prediction according to claim 4, characterized in that, Calculate the node centrality of each node, including: compute nodes in-degree: , in, For nodes in-degree, node For a set of nodes Middle pointer node The node, For nodes With nodes The transmission index between them; compute nodes Out-degree: , in, For nodes Out-degree, node For a set of nodes Middle node The node it points to For nodes With nodes The transmission index between them; compute nodes Betweenness centrality: , in, Represents a node betweenness centrality, Indicates from node To the node The total number of shortest paths, At that time, take , Indicates from node To the node The shortest path passes through the nodes The number of paths, where the shortest path represents the path with the highest overall propagation index among the propagation paths; compute nodes The ingress centrality is close to: , in, For nodes The ingress is close to centrality. Indicates reachable nodes The set of nodes, For a set of nodes The number of nodes in For nodes To the node The shortest path distance, At that time, take ,and satisfy: , in, Represents a node To the node The shortest path propagation index is the overall propagation index of the path, which is the number of nodes in the shortest path that propagate the path. propagation to nodes The product of the propagation exponents of each segment along the directed edge, and ; compute nodes Approximate centrality: , in, For nodes The centrality is close to that of the target. Represents a node The set of reachable nodes For a set of nodes The number of nodes in For nodes To the node The shortest path distance, At that time, take ,and satisfy: , in, Represents a node To the node The shortest path propagation index is the overall propagation index of the path, which is the number of nodes in the shortest path that propagate the path. propagation to nodes The product of the propagation exponents of each segment along the directed edge, and .

7. The method for generating emergency treatment recommendations based on Klebsiella pneumoniae classification prediction according to claim 6, characterized in that, Based on the node centrality of each node, the propagation feature components are determined and output, including: Collect the node set originating from each department and calculate the departmental transmission risk index corresponding to each node set originating from the department: , in, For the department The department outputs a transmission risk index. Belonging to the department The set of nodes, For a set of nodes Middle node The degree of exit, For a set of nodes The number of nodes in, and At that time, take ; In addition, calculate the departmental transmission risk index corresponding to the set of nodes originating from each department: , in, For the department Departmental transmission risk index Belonging to the department The set of nodes, For a set of nodes Middle node in-degree, For a set of nodes The number of nodes in, and At that time, take ; For nodes Integration of propagation feature components: , in, For nodes The propagation feature component is a 15-dimensional feature component.

8. The method for generating emergency treatment recommendations based on Klebsiella pneumoniae classification prediction according to claim 3, characterized in that, The Klebsiella pneumoniae classification model includes a primary classification module and a homology-level classification module. The primary classification module uses a random forest model to determine the classification probability vector corresponding to each Klebsiella pneumoniae case data based on the feature vector of each Klebsiella pneumoniae case data. Each element in the classification probability vector is used to reveal the probability that the Klebsiella pneumoniae case data belongs to the corresponding category. For each Klebsiella pneumoniae case data group: the homology group-level classification module is used to determine the deviation of each Klebsiella pneumoniae case data in the group from its corresponding Klebsiella pneumoniae case data group. Based on the deviation and classification probability vector corresponding to each Klebsiella pneumoniae case data, the classification probability vector of this Klebsiella pneumoniae case data group is determined. Then, the classification with the highest probability in the classification probability vector is determined as the classification of each Klebsiella pneumoniae case data in the group.

9. The method for generating emergency treatment recommendations based on Klebsiella pneumoniae classification prediction according to claim 8, characterized in that, The homology group-level classification module determines the deviation of each Klebsiella pneumoniae case data within a group from its corresponding Klebsiella pneumoniae case data group in the following way: The distribution of location, phenotypic, source, sample, infection, medication, operation, transport, and treatment components in the basic characteristic components corresponding to each Klebsiella pneumoniae case data in the statistical group was analyzed to determine the dominant distribution characteristic components of this group of Klebsiella pneumoniae case data. The degree of overlap between the basic characteristic components of each Klebsiella pneumoniae case data within a group and the dominant distribution characteristic components of the Klebsiella pneumoniae case data group of that group is used as the deviation of each Klebsiella pneumoniae case data from its respective Klebsiella pneumoniae case data group. The time component and patient component in the basic characteristic components of each Klebsiella pneumoniae case data are not included in the calculation.

10. The method for generating emergency treatment recommendations based on Klebsiella pneumoniae classification prediction according to claim 8, characterized in that, The homology-level classification module determines the classification probability vector to which each Klebsiella pneumoniae case data group belongs based on the deviation and classification probability vector corresponding to that Klebsiella pneumoniae case data. , in, For the first The probability vector of the classification of each group of Klebsiella pneumoniae case data. For the first A Klebsiella pneumoniae case data set grouped into individual Klebsiella pneumoniae case data sets. For the first The total number of Klebsiella pneumoniae case data in each Klebsiella pneumoniae case data group. , For the first In the data group of Klebsiella pneumoniae cases, the first Deviation corresponding to individual Klebsiella pneumoniae case data For the first In the data group of Klebsiella pneumoniae cases, the first The classification probability vector corresponding to each Klebsiella pneumoniae case data.