Machine learning-based classification warning method and system for abnormal doctor drug usage

By constructing a drug dosage anomaly detection model based on feature reconstruction autoencoder and attention mechanism, the problem of low efficiency of drug dosage monitoring in existing technologies is solved, real-time and comprehensive dosage monitoring and timely dosage guidance are achieved, and the safety risks of drug use are reduced.

CN120108758BActive Publication Date: 2025-09-26DALIAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510300342.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-09-26
Estimated Expiration
2045-03-14

AI Technical Summary

Technical Problem

In existing technologies, drug dosage monitoring mainly relies on manual review and post-inspection, which is inefficient and highly subjective. It is difficult to achieve real-time and comprehensive monitoring, and it is difficult to identify potential dosage anomalies, resulting in the failure to timely discover and address drug safety hazards.

Method used

An anomaly detection model based on feature reconstruction autoencoder and attention mechanism was constructed. The reconstructed features were optimized through local cross-attention. The X-means algorithm and LOF algorithm were combined for iterative clustering and local outlier factor calculation to generate a drug dosage anomaly detection model. The mean square error and cosine similarity loss functions were used for training.

Benefits of technology

It achieves real-time and accurate detection of doctors' drug usage, provides timely dosage guidance, reduces safety risks in drug use, and improves the comprehensiveness and timeliness of monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120108758B_ABST
    Figure CN120108758B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for early warning of abnormal doctor drug usage based on machine learning, including: a data layer, which is mainly a data center, which collects risk analysis data on drug and consumables usage, departments, suppliers, etc. from the hospital, and performs data cleaning, and manages the data at the same time, including personnel management and query statistics; a business layer, which mainly uses algorithm models to achieve key personnel monitoring and data intelligent analysis, including clue mining, correlation factor analysis and data visualization analysis; an application layer, including an intelligent early warning and forecasting function module, which realizes red, yellow and green three-level risk warnings through business layer big data analysis according to threshold settings, and performs visual display. The present invention adopts a visual graded early warning mechanism and uses an anomaly detection algorithm model to detect doctor drug usage. The detection results are more accurate and the warning effect is more obvious. At the same time, the detection results provide a reference basis for abnormal usage for subsequent relevant departments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence medical technology, and specifically relates to a machine learning-based method and system for grading and warning of abnormal drug usage by doctors. Background Art

[0002] In modern medical practice, rational medication use is crucial for ensuring patient safety and treatment effectiveness. When prescribing medication, physicians must comprehensively determine the appropriate medication type and dosage based on the patient's specific condition, physiological characteristics, and other factors. However, due to various reasons, including but not limited to human error, information asymmetry, or lack of experience, medication dosages sometimes exceed the normal range. This can not only lead to poor efficacy but also cause serious adverse reactions, even endangering the patient's life. Currently, most hospitals and clinics rely primarily on physicians' professional judgment and experience to avoid such issues. While some medical institutions have introduced electronic prescribing systems that provide certain drug interaction detection capabilities, their ability to identify and provide early warnings regarding excessive medication dosages is limited. Furthermore, traditional electronic prescribing systems often lack the ability to deeply analyze historical data, making them ineffective in identifying potential risk patterns or trends.

[0003] As the standardization of medical systems gradually increases, digital tools are gaining attention across the country. Using digital means to monitor clinical behavior is becoming a future trend in medical institution management, and the medical field has entered the "big data era." In this era of big data, the deep integration of data mining and analysis into hospital operations is essential. However, existing technologies currently lack methods for detecting abnormal medication behavior among doctors. Currently, monitoring drug dosage primarily relies on manual review and post-inspection spot checks. This approach is not only inefficient but also highly subjective and time-consuming, making it difficult to achieve real-time, comprehensive monitoring. Furthermore, since manual review is often based on doctor experience or universal dosage standards, it is difficult to identify potential dosage anomalies or prescribing behaviors that deviate from standard practices. Furthermore, existing methods also have significant shortcomings in providing timely feedback, making it difficult to provide doctors with timely dosage guidance, resulting in the failure to promptly identify and address some drug safety risks. This invention is based on an anomaly detection model that integrates a feature reconstruction autoencoder and an attention mechanism. Based on a feature reconstruction model with an autoencoder as its core architecture, the system enhances its ability to capture normal patterns by incorporating attention mechanisms (LCA and MLKA). It also implements a graded warning function by combining reconstruction errors with thresholds. Patient basic information, doctor information, and medication information are historical data recorded in hospital medical records. Summary of the Invention

[0004] The purpose of the present invention is to solve the problem that the monitoring of drug dosage in the prior art mainly relies on manual review and post-inspection. This method is not only inefficient, but also has high subjectivity and lag, making it difficult to achieve real-time and comprehensive monitoring. At the same time, since manual review is usually based on the doctor's experience or general dosage standards, it is difficult to identify potential dosage anomalies or prescription behaviors that deviate from the norm. In addition, the existing methods also have obvious deficiencies in timely feedback, making it difficult to provide doctors with timely dosage guidance, resulting in the problem that some safety hazards in the use of drugs are not discovered and addressed in a timely manner.

[0005] To solve the above problems, the present invention provides a machine learning-based method for early warning of abnormal doctor drug usage, comprising:

[0006] S1: Construct sample set;

[0007] The sample set includes: basic patient information, doctor information, medication information, and medical insurance data;

[0008] S2: obtain sample characteristics;

[0009] The ratio of patient age to drug dosage is used as a new sample, and the X-means algorithm is used to iteratively cluster the new samples to obtain the sample set feature F org ;

[0010] S3: Use the LOF algorithm to calculate the local outlier factor of each sample point;

[0011] Using the sample set feature F org The sample points are obtained by the minimum reachable distance, the local reachable density of each sample point is calculated according to the minimum reachable distance, and the local outlier factor of each sample point is obtained by the LOF algorithm;

[0012] S4: Reconstructed features through local cross attention LCA optimization;

[0013] Obtain reference features through local cross attention LCA, and pass weight , value vector Generate the final reconstruction features;

[0014] S5: Use the features reconstructed in step S4 to train the sample set and obtain a drug dosage anomaly detection model.

[0015] In a preferred embodiment, the sample set in step S1 includes: basic patient information, doctor information, medication information, and medical insurance data;

[0016] Patient basic information includes: recording month, patient age, patient gender, and length of hospitalization; physician information includes: subspecialty, physician name, and physician title; medication information includes: disease diagnosis, medication dosage, medication name, medication category, medication code, medication manufacturer, medication unit price, and medication unit; medical insurance data includes: DRG group number, number of DRG group members, and DRG group name;

[0017] The specific steps of obtaining sample features in step S2 are as follows:

[0018] The ratio of patient age to drug dosage is used as a new sample, and the formula is:

[0019]

[0020] in, represents a new sample, Indicates the Patient age, Indicates the The corresponding drug dosage for each patient, =1, 2, ..., N;

[0021] Use X-means algorithm to analyze new samples Perform iterative clustering, and take the initial number of clusters K as 2 or 3. For each initial cluster , using the binary K-means algorithm Split into two subclusters and , and calculate the center after the split, evaluate the results before and after the split, and calculate the BIC value, that is, the Bayesian Information Criterion, to determine whether the split is reasonable. The formula is:

[0022]

[0023] in, represents the log-likelihood value of the split model, The number of parameters representing the split model includes the number of centers and variance parameters, Indicates the number of samples in the cluster. If the BIC value after classification is higher than the original value, the split is accepted. If the splitting condition is met, the number of clusters K is updated: K=K+1, and the division test is repeated until all clusters cannot be split any further. After the clustering is completed, the centroid of each cluster is obtained and used together with the sample set obtained in step S1 as the sample set feature F. org ;

[0024] Step S3 uses the LOF algorithm to calculate the local outlier factor of each sample point. The specific steps are:

[0025] For each sample set feature F orgSample points , define its k-distance, that is, the distance from the point to its kth nearest neighbor, the formula is:

[0026]

[0027] Where, yes The first nearest neighbor;

[0028] The LOF algorithm introduces the reachable distance, which is defined as the point and its first Neighbors The distance between them is:

[0029]

[0030] Even if and The distance is less than The k-distance is still used as the minimum reachable distance;

[0031] Each sample point The local reachability density formula is:

[0032]

[0033] The LOF algorithm compares sample points The local density of the point and the density of other points in its neighborhood are measured Is it abnormal? The formula is:

[0034]

[0035] In the formula, if ,but The density of its neighborhood is similar and it is not an outlier. but The density of the sample is lower than the neighborhood density, which is an outlier. The threshold value is set for distribution. In practical applications, the threshold value [0.9, 0.95] is selected;

[0036] Step S4 optimizes and reconstructs features through local cross attention LCA. The specific steps are:

[0037] LCA adds a local perception mask to restrict the query feature to match the reference feature in the neighborhood within a local range. The formula is as follows:

[0038]

[0039] Where, is the sample set feature Forg The sample features in is a learnable normal reference representation, is the local mask matrix;

[0040] By weight Sum value vector Generate the final reconstruction features, the formula is:

[0041]

[0042] Where, Represents the reconstruction features and weights of a certain layer of LCA module Represents weighting of the reference, value vector A mapping form that represents a learnable reference representation;

[0043] At the same time, the output of LCA is combined with the output of the mask learning key attention module and the hyperparameter Weighting ensures that the model pays more attention to the LCA output. The formula is:

[0044]

[0045] Where, Represents the final output reconstruction feature, represents the reconstruction features of the LCA module, represents the mask learning key attention matrix;

[0046] Step S5 uses step S4 to reconstruct features The training sample set is used to obtain the drug dosage anomaly detection model. The specific steps are as follows:

[0047] The mean square error and cosine similarity loss functions are used to measure the difference between the reconstructed features and the original input features. The loss function is defined as follows:

[0048]

[0049] Where, and Represents the height and width of the feature map; by minimizing the reconstruction loss, the model learns the distribution of normal usage features and ignores abnormal patterns. The reconstructed feature set is input into the model for training and optimization iteration to obtain the optimal method.

[0050] A machine learning-based physician drug usage abnormal graded warning system, comprising: a data module, a business module, and an application module;

[0051] M1: The working method of the data module is to use the data module to build a sample set, which includes: basic patient information, doctor information, medication information, and medical insurance data;

[0052] Patient basic information includes: recording month, patient age, patient gender, and length of hospitalization; physician information includes: subspecialty, physician name, and physician title; medication information includes: disease diagnosis, medication dosage, medication name, medication category, medication code, medication manufacturer, medication unit price, and medication unit; medical insurance data includes: DRG group number, number of DRG group members, and DRG group name;

[0053] M2: The working mode of the application module is reflected in obtaining sample characteristics;

[0054] The ratio of patient age to drug dosage is used as a new sample, and the formula is:

[0055]

[0056] in, represents a new sample, Indicates the Patient age, Indicates the The corresponding drug dosage for each patient, =1, 2, ..., N;

[0057] Use X-means algorithm to analyze new samples Perform iterative clustering, and take the initial number of clusters K as 2 or 3. For each initial cluster , using the binary K-means algorithm Split into two subclusters and , and calculate the center after the split, evaluate the results before and after the split, and calculate the BIC value, that is, the Bayesian Information Criterion, to determine whether the split is reasonable. The formula is:

[0058]

[0059] in, represents the log-likelihood value of the split model, The number of parameters representing the split model includes the number of centers and variance parameters, Indicates the number of samples in the cluster. If the BIC value after classification is higher than the original value, the split is accepted. If the splitting condition is met, the number of clusters K is updated: K=K+1, and the division test is repeated until all clusters cannot be split any further. After the clustering is completed, the centroid of each cluster is obtained and used together with the sample set obtained in step S1 as the sample set feature F. org ;

[0060] M3: Use the LOF algorithm to calculate the local outlier factor of each sample point;

[0061] For each sample set feature F org Sample points , define its k-distance, that is, the distance from the point to its kth nearest neighbor, the formula is:

[0062]

[0063] Where, yes The first nearest neighbor;

[0064] The LOF algorithm introduces the reachable distance, which is defined as the point and its first Neighbors The distance between them is:

[0065]

[0066] Even if and The distance is less than The k-distance is still used as the minimum reachable distance;

[0067] Each sample point The local reachability density formula is:

[0068]

[0069] The LOF algorithm compares sample points The local density of the point and the density of other points in its neighborhood are measured Is it abnormal? The formula is:

[0070]

[0071] In the formula, if ,but The density of its neighborhood is similar and it is not an outlier. but The density of the sample is lower than the neighborhood density, which is an outlier. The threshold value is set for distribution. In practical applications, the threshold value [0.9, 0.95] is selected;

[0072] M4: Optimize feature reconstruction through local cross attention LCA;

[0073] LCA adds a local perception mask to restrict the query feature to match the reference feature in the neighborhood within a local range. The formula is as follows:

[0074]

[0075] Where, is the sample set feature F org The sample features in is a learnable normal reference representation, is the local mask matrix;

[0076] By weight Sum value vector Generate the final reconstruction features, the formula is:

[0077]

[0078] Where, Represents the reconstruction features and weights of a certain layer of LCA module Represents weighting of the reference, value vector A mapping form that represents a learnable reference representation;

[0079] At the same time, the output of LCA is combined with the output of the mask learning key attention module and the hyperparameter Weighting ensures that the model pays more attention to the LCA output. The formula is:

[0080]

[0081] Where, Represents the final output reconstruction feature, represents the reconstruction features of the LCA module, represents the mask learning key attention matrix;

[0082] M5: Reconstruct the feature using step M4 The training sample set is used to obtain a drug dosage anomaly detection model;

[0083] The mean square error and cosine similarity loss functions are used to measure the difference between the reconstructed features and the original input features. The loss function is defined as follows:

[0084]

[0085] Where, and Represents the height and width of the feature map; by minimizing the reconstruction loss, the model learns the distribution of normal usage features and ignores abnormal patterns. The reconstructed feature set is input into the model for training and optimization iteration. Finally, the business module uses the trained model algorithm to detect anomalies and stores the detection results in the database.

[0086] The beneficial effects of the present invention are as follows: a visual hierarchical early warning mechanism is adopted, and an abnormal detection algorithm model is used to detect the doctor's drug usage. The detection results are more accurate and the warning effect is more obvious. At the same time, the detection results provide a reference basis for abnormal dosage situations for subsequent relevant departments. BRIEF DESCRIPTION OF THE DRAWINGS

[0087] Figure 1 This is a system block diagram of the machine learning-based physician drug usage abnormal graded early warning system of the present invention;

[0088] Figure 2 This is a schematic diagram of the modeling process of the abnormal drug dosage detection model for doctors of the present invention;

[0089] Figure 3 Schematic diagram of the process flow of the present invention in which the consumption of consumables is abnormal. DETAILED DESCRIPTION

[0090] Example 1

[0091] A machine learning-based method for early warning of abnormal doctor drug usage, comprising the following steps:

[0092] S1: Construct sample set;

[0093] The sample set includes: basic patient information, doctor information, medication information, and medical insurance data;

[0094] S2: obtain sample characteristics;

[0095] The ratio of patient age to drug dosage is used as a new sample, and the X-means algorithm is used to iteratively cluster the new samples to obtain the sample set feature F org ;

[0096] S3: Use the LOF algorithm to calculate the local outlier factor of each sample point;

[0097] Using the sample set feature F org The sample points are obtained by the minimum reachable distance, the local reachable density of each sample point is calculated according to the minimum reachable distance, and the local outlier factor of each sample point is obtained by the LOF algorithm;

[0098] S4: Reconstructed features through local cross attention LCA optimization;

[0099] Obtain reference features through local cross attention LCA, and pass weight , value vector Generate the final reconstruction features;

[0100] S5: Use the features reconstructed in step S4 to train the sample set and obtain a drug dosage anomaly detection model.

[0101] The sample set in step S1 includes: patient basic information, doctor information, medication information, and medical insurance data;

[0102] Patient basic information includes: recording month, patient age, patient gender, and length of hospitalization; physician information includes: subspecialty, physician name, and physician title; medication information includes: disease diagnosis, medication dosage, medication name, medication category, medication code, medication manufacturer, medication unit price, and medication unit; medical insurance data includes: DRG group number, number of DRG group members, and DRG group name;

[0103] The specific steps of obtaining sample features in step S2 are as follows:

[0104] The ratio of patient age to drug dosage is used as a new sample, and the formula is:

[0105]

[0106] in, represents a new sample, Indicates the Patient age, Indicates the The corresponding drug dosage for each patient, =1, 2, ..., N;

[0107] Use X-means algorithm to analyze new samples Perform iterative clustering, and take the initial number of clusters K as 2 or 3. For each initial cluster , using the binary K-means algorithm Split into two subclusters and , and calculate the center after the split, evaluate the results before and after the split, and calculate the BIC value, that is, the Bayesian Information Criterion, to determine whether the split is reasonable. The formula is:

[0108]

[0109] in, represents the log-likelihood value of the split model, The number of parameters representing the split model includes the number of centers and variance parameters, Indicates the number of samples in the cluster. If the BIC value after classification is higher than the original value, the split is accepted. If the splitting condition is met, the number of clusters K is updated: K=K+1, and the division test is repeated until all clusters cannot be split any further. After the clustering is completed, the centroid of each cluster is obtained and used together with the sample set obtained in step S1 as the sample set feature F. org ;

[0110] Step S3 uses the LOF algorithm to calculate the local outlier factor of each sample point. The specific steps are:

[0111] For each sample set feature F org Sample points , define its k-distance, that is, the distance from the point to its kth nearest neighbor, the formula is:

[0112]

[0113] Where, yes The first nearest neighbor;

[0114] The LOF algorithm introduces the reachable distance, which is defined as the point and its first Neighbors The distance between them is:

[0115]

[0116] Even if and The distance is less than The k-distance is still used as the minimum reachable distance;

[0117] Each sample point The local reachability density formula is:

[0118]

[0119] The LOF algorithm compares sample points The local density of the point and the density of other points in its neighborhood are measured Is it abnormal? The formula is:

[0120]

[0121] In the formula, if ,but The density of its neighborhood is similar and it is not an outlier. but The density of the sample is lower than the neighborhood density, which is an outlier. The threshold value is set for distribution. In practical applications, the threshold value [0.9, 0.95] is selected;

[0122] Step S4 optimizes and reconstructs features through local cross attention LCA. The specific steps are:

[0123] LCA adds a local perception mask to restrict the query feature to match the reference feature in the neighborhood within a local range. The formula is as follows:

[0124]

[0125] Where, is the sample set feature F org The sample features in is a learnable normal reference representation, is the local mask matrix;

[0126] By weight Sum value vector Generate the final reconstruction features, the formula is:

[0127]

[0128] Where, Represents the reconstruction features and weights of a certain layer of LCA module Represents weighting of the reference, value vector A mapping form that represents a learnable reference representation;

[0129] At the same time, the output of LCA is combined with the output of the mask learning key attention module and the hyperparameter Weighting ensures that the model pays more attention to the LCA output. The formula is:

[0130]

[0131] Where, Represents the final output reconstruction feature, represents the reconstruction features of the LCA module, represents the mask learning key attention matrix;

[0132] Step S5 uses step S4 to reconstruct features The training sample set is used to obtain the drug dosage anomaly detection model. The specific steps are as follows:

[0133] The mean square error and cosine similarity loss functions are used to measure the difference between the reconstructed features and the original input features. The loss function is defined as follows:

[0134]

[0135] Where, and Represents the height and width of the feature map; by minimizing the reconstruction loss, the model learns the distribution of normal usage features and ignores abnormal patterns. The reconstructed feature set is input into the model for training and optimization iteration to obtain the optimal method.

[0136] A machine learning-based physician drug usage abnormal graded warning system, comprising: a data module, a business module, and an application module;

[0137] M1: The working method of the data module is to use the data module to build a sample set, which includes: basic patient information, doctor information, medication information, and medical insurance data;

[0138] Patient basic information includes: recording month, patient age, patient gender, and length of hospitalization; physician information includes: subspecialty, physician name, and physician title; medication information includes: disease diagnosis, medication dosage, medication name, medication category, medication code, medication manufacturer, medication unit price, and medication unit; medical insurance data includes: DRG group number, number of DRG group members, and DRG group name;

[0139] M2: The working mode of the application module is reflected in obtaining sample characteristics;

[0140] The ratio of patient age to drug dosage is used as a new sample, and the formula is:

[0141]

[0142] in, represents a new sample, Indicates the Patient age, Indicates the The corresponding drug dosage for each patient, =1, 2, ..., N;

[0143] Use X-means algorithm to analyze new samples Perform iterative clustering, and take the initial number of clusters K as 2 or 3. For each initial cluster , using the binary K-means algorithm Split into two subclusters and , and calculate the center after the split, evaluate the results before and after the split, and calculate the BIC value, that is, the Bayesian Information Criterion, to determine whether the split is reasonable. The formula is:

[0144]

[0145] in, represents the log-likelihood value of the split model, The number of parameters representing the split model includes the number of centers and variance parameters, Indicates the number of samples in the cluster. If the BIC value after classification is higher than the original value, the split is accepted. If the splitting condition is met, the number of clusters K is updated: K=K+1, and the division test is repeated until all clusters cannot be split any further. After the clustering is completed, the centroid of each cluster is obtained and used together with the sample set obtained in step S1 as the sample set feature F. org ;

[0146] M3: Use the LOF algorithm to calculate the local outlier factor of each sample point;

[0147] For each sample set feature F org Sample points , define its k-distance, that is, the distance from the point to its kth nearest neighbor, the formula is:

[0148]

[0149] Where, yes The first nearest neighbor;

[0150] The LOF algorithm introduces the reachable distance, which is defined as the point and its first Neighbors The distance between them is:

[0151]

[0152] Even if and The distance is less than The k-distance is still used as the minimum reachable distance;

[0153] Each sample point The local reachability density formula is:

[0154]

[0155] The LOF algorithm compares sample points The local density of the point and the density of other points in its neighborhood are measured Is it abnormal? The formula is:

[0156]

[0157] In the formula, if ,but The density of its neighborhood is similar and it is not an outlier. but The density of the sample is lower than the neighborhood density, which is an outlier. The threshold value is set for distribution. In practical applications, the threshold value [0.9, 0.95] is selected;

[0158] M4: Optimize feature reconstruction through local cross attention LCA;

[0159] LCA adds a local perception mask to restrict the query feature to match the reference feature in the neighborhood within a local range. The formula is as follows:

[0160]

[0161] Where, is the sample set feature F org The sample features in is a learnable normal reference representation, is the local mask matrix;

[0162] By weight Sum value vector Generate the final reconstruction features, the formula is:

[0163]

[0164] Where, Represents the reconstruction features and weights of a certain layer of LCA module Represents weighting of the reference, value vector A mapping form that represents a learnable reference representation;

[0165] At the same time, the output of LCA is combined with the output of the mask learning key attention module and the hyperparameter Weighting ensures that the model pays more attention to the LCA output. The formula is:

[0166]

[0167] Where, Represents the final output reconstruction feature, represents the reconstruction features of the LCA module, Mask learning key attention matrix;

[0168] M5: Reconstruct the feature using step M4 The training sample set is used to obtain a drug dosage anomaly detection model;

[0169] The mean square error and cosine similarity loss functions are used to measure the difference between the reconstructed features and the original input features. The loss function is defined as follows:

[0170]

[0171] Where, and Represents the height and width of the feature map; by minimizing the reconstruction loss, the model learns the distribution of normal usage features and ignores abnormal patterns. The reconstructed feature set is input into the model for training and optimization iteration. Finally, the business module uses the trained model algorithm to detect anomalies and stores the detection results in the database.

[0172] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.

Claims

1. A machine learning-based method for early warning of abnormal doctor drug usage, characterized by: include: S1: Construct sample set; The sample set includes: basic patient information, doctor information, medication information, and medical insurance data; S2: obtain sample characteristics; The ratio of patient age to drug dosage is used as a new sample, and the X-means algorithm is used to iteratively cluster the new samples to obtain the sample set feature F org ; S3: Use the LOF algorithm to calculate the local outlier factor of each sample point; Using the sample set feature F org The sample points are obtained by the minimum reachable distance, the local reachable density of each sample point is calculated according to the minimum reachable distance, and the local outlier factor of each sample point is obtained by the LOF algorithm; S4: Reconstructed features through local cross attention LCA optimization; Obtain reference features through local cross attention LCA, and pass weight , value vector Generate the final reconstruction features; S5: Use the features reconstructed in step S4 to train the sample set and obtain a drug dosage anomaly detection model.

2. The machine learning-based early warning method for abnormal doctor drug usage according to claim 1, characterized in that: Step S1: The sample set includes: patient basic information, doctor information, medication information, and medical insurance data; Patient basic information includes: recording month, patient age, patient gender, and length of hospitalization; physician information includes: subspecialty, physician name, and physician title; medication information includes: disease diagnosis, medication dosage, medication name, medication category, medication code, medication manufacturer, medication unit price, and medication unit; medical insurance data includes: DRG group number, number of DRG group members, and DRG group name; The specific steps of obtaining sample features in step S2 are as follows: The ratio of patient age to drug dosage is used as a new sample, and the formula is: in, represents a new sample, Indicates the Patient age, Indicates the The corresponding drug dosage for each patient, =1, 2, ..., N; Use X-means algorithm to analyze new samples Perform iterative clustering, and take the initial number of clusters K as 2 or 3. For each initial cluster , using the binary K-means algorithm Split into two subclusters and , and calculate the center after the split, evaluate the results before and after the split, and calculate the BIC value, that is, the Bayesian Information Criterion, to determine whether the split is reasonable. The formula is: in, represents the log-likelihood value of the split model, The number of parameters representing the split model includes the number of centers and variance parameters, Indicates the number of samples in the cluster. If the BIC value after classification is higher than the original value, the split is accepted. If the splitting condition is met, the number of clusters K is updated: K=K+1, and the division test is repeated until all clusters cannot be split any further. After the clustering is completed, the centroid of each cluster is obtained and used together with the sample set obtained in step S1 as the sample set feature F. org ; Step S3 uses the LOF algorithm to calculate the local outlier factor of each sample point. The specific steps are: For each sample set feature F org Sample points , define its k-distance, that is, the distance from the point to its kth nearest neighbor, the formula is: Where, yes The first nearest neighbor; The LOF algorithm introduces the reachable distance, which is defined as the point and its first Neighbors The distance between them is: Even if and The distance is less than The k-distance is still used as the minimum reachable distance; Each sample point The local reachability density formula is: The LOF algorithm compares sample points The local density of the point and the density of other points in its neighborhood are measured Is it abnormal? The formula is: In the formula, if ,but The density of its neighborhood is similar and it is not an outlier. but The density of the sample is lower than the neighborhood density, which is an outlier. The threshold value is set for distribution. In practical applications, the threshold value [0.9, 0.95] is selected; Step S4 optimizes and reconstructs features through local cross attention LCA. The specific steps are: LCA adds a local perception mask to restrict the query feature to match the reference feature in the neighborhood within a local range. The formula is as follows: Where, is the sample set feature F org The sample features in is a learnable normal reference representation, is the local mask matrix; By weight Sum value vector Generate the final reconstruction features, the formula is: Where, Represents the reconstruction features and weights of a certain layer of LCA module Represents weighting of the reference, value vector A mapping form that represents a learnable reference representation; At the same time, the output of LCA is combined with the output of the mask learning key attention module and the hyperparameter Weighting ensures that the model pays more attention to the LCA output. The formula is: Where, Represents the final output reconstruction feature, represents the reconstruction features of the LCA module, represents the mask learning key attention matrix; Step S5 uses step S4 to reconstruct features The training sample set is used to obtain the drug dosage anomaly detection model. The specific steps are as follows: The mean square error and cosine similarity loss functions are used to measure the difference between the reconstructed features and the original input features. The loss function is defined as follows: Where, and Represents the height and width of the feature map; by minimizing the reconstruction loss, the model learns the distribution of normal usage features and ignores abnormal patterns. The reconstructed feature set is input into the model for training and optimization iteration to obtain the optimal method.

3. A machine learning-based physician drug dosage abnormal graded warning system, characterized by: include: Data module, business module, application module; M1: The working method of the data module is to use the data module to build a sample set, which includes: basic patient information, doctor information, medication information, and medical insurance data; Patient basic information includes: recording month, patient age, patient gender, and length of hospitalization; physician information includes: subspecialty, physician name, and physician title; medication information includes: disease diagnosis, medication dosage, medication name, medication category, medication code, medication manufacturer, medication unit price, and medication unit; medical insurance data includes: DRG group number, number of DRG group members, and DRG group name; M2: The working mode of the application module is reflected in obtaining sample characteristics; The ratio of patient age to drug dosage is used as a new sample, and the formula is: in, represents a new sample, Indicates the Patient age, Indicates the The corresponding drug dosage for each patient, =1, 2, ..., N; Use X-means algorithm to analyze new samples Perform iterative clustering, and take the initial number of clusters K as 2 or 3. For each initial cluster , using the binary K-means algorithm Split into two subclusters and , and calculate the center after the split, evaluate the results before and after the split, and calculate the BIC value, that is, the Bayesian Information Criterion, to determine whether the split is reasonable. The formula is: in, represents the log-likelihood value of the split model, The number of parameters representing the split model includes the number of centers and variance parameters, Indicates the number of samples in the cluster. If the BIC value after classification is higher than the original value, the split is accepted. If the splitting condition is met, the number of clusters K is updated: K=K+1, and the division test is repeated until all clusters cannot be split any further. After the clustering is completed, the centroid of each cluster is obtained and used together with the sample set obtained in step S1 as the sample set feature F. org ; M3: Use the LOF algorithm to calculate the local outlier factor of each sample point; For each sample set feature F org Sample points , define its k-distance, that is, the distance from the point to its kth nearest neighbor, the formula is: Where, yes The first nearest neighbor; The LOF algorithm introduces the reachable distance, which is defined as the point and its first Neighbors The distance between them is: Even if and The distance is less than The k-distance is still used as the minimum reachable distance; Each sample point The local reachability density formula is: The LOF algorithm compares sample points The local density of the point and the density of other points in its neighborhood are measured Is it abnormal? The formula is: In the formula, if ,but The density of its neighborhood is similar and it is not an outlier. but The density of the sample is lower than the neighborhood density, which is an outlier. The threshold value is set for distribution. In practical applications, the threshold value [0.9, 0.95] is selected; M4: Optimize feature reconstruction through local cross attention LCA; LCA adds a local perception mask to restrict the query feature to match the reference feature in the neighborhood within a local range. The formula is as follows: Where, is the sample set feature F org The sample features in is a learnable normal reference representation, is the local mask matrix; By weight Sum value vector Generate the final reconstruction features, the formula is: Where, Represents the reconstruction features and weights of a certain layer of LCA module Represents weighting of the reference, value vector A mapping form that represents a learnable reference representation; At the same time, the output of LCA is combined with the output of the mask learning key attention module and the hyperparameter Weighting ensures that the model pays more attention to the LCA output. The formula is: Where, Represents the final output reconstruction feature, represents the reconstruction features of the LCA module, represents the mask learning key attention matrix; M5: Reconstruct the feature using step M4 The training sample set is used to obtain a drug dosage anomaly detection model; The mean square error and cosine similarity loss functions are used to measure the difference between the reconstructed features and the original input features. The loss function is defined as follows: Where, and Represents the height and width of the feature map; by minimizing the reconstruction loss, the model learns the distribution of normal usage features and ignores abnormal patterns. The reconstructed feature set is input into the model for training and optimization iteration. Finally, the business module uses the trained model algorithm to detect anomalies and stores the detection results in the database.

Citation Information

Patent Citations

  • Medical abnormity violation big data risk early warning method based on unsupervised machine learning and integrated learning

    CN117764741A

  • Medicine project reasonable use method and system based on diagnosis and medicine project reasoning

    CN118507077A