A method for detecting anomalies in follow-up records
Through machine learning and deep learning technology, the follow-up record data set is constructed and abnormal detection is performed using SVDD and LSTM twin neural networks, which solves the omissions and lag problems caused by manual review, improves the accuracy and efficiency of abnormal detection, and ensures postoperative The accuracy of timely tracking of recovery situations and follow-up visits.
Patent Information
- Application Number
- CN202210676416.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-15
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-06-15
AI Technical Summary
In the prior art, hospitals have omissions and lags in abnormal judgments through manual review of patient follow-up records, especially when the number of patients increases, resulting in negative impact on postoperative recovery tracking and follow-up visits.
Using machine learning/deep learning methods, the follow-up record data set is constructed, and abnormal detection is performed using SVDD algorithm and LSTM twin neural network to assist hospital staff in abnormal judgments and reduce the workload of manual review.
It improves the accuracy and efficiency of abnormal detection, avoids omissions and lag problems caused by manual review methods, and ensures the accuracy of timely tracking of postoperative recovery and follow-up visits.
Smart Images

Figure CN115064231B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical big data technology, and in particular to a method for detecting anomalies in follow-up records. Background Art
[0002] With the rapid development of computer technology and the demand for information construction, hospital case information management is of great significance in improving the hospital's medical level and improving patients' medical experience. Among them, postoperative follow-up of patients is a very important part of case information management. Through regular follow-up of patients, the patient's postoperative physical indicators, changes in condition, postoperative feelings and other data can be continuously recorded, so that doctors can better track the patient's postoperative recovery and conduct postoperative follow-up visits for patients in a timely manner.
[0003] Since the definition of abnormality at the medical level is relatively complex, hospitals currently often use manual review to judge abnormalities in collected patient follow-up records based on professional medical knowledge. However, with the increase in the number of patients and limited hospital staff, manual review can easily lead to omissions and delays in abnormal judgments, which has a negative impact on the tracking of patients' postoperative recovery and postoperative follow-up visits. Summary of the invention
[0004] In view of the above problems, the present invention provides a follow-up record anomaly detection method, which uses a machine learning / deep learning anomaly detection method to perform an initial screening of patient follow-up records for anomalies at the big data level, thereby assisting hospital staff in making anomaly judgments on patient follow-up records at the medical level, greatly reducing the workload of manual review and solving the problems of omissions and lags in abnormal judgment caused by traditional methods that rely solely on manual review.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: a method for detecting anomalies in follow-up records, comprising the following steps: S100, collecting follow-up records and constructing a follow-up record dataset D, wherein the follow-up record dataset D includes a normal label dataset D c and abnormal label dataset D e ; S201, select normal label data set D c , the normal label data set D c Divide into n subsets d i , and for the subset d i Perform clustering to obtain a new normal label data set D′ c ; S202, according to the new normal label data set D′ c, use the SVDD algorithm to train the model and obtain the SVDD classifier set F; S203, obtain the follow-up record to be detected and convert it into a follow-up feature vector u to be detected, and divide the follow-up feature vector u to be detected into n subsets u according to the follow-up time i , and the subset u i Input the SVDD classifier set F to obtain the content anomaly detection result set R; S204, perform an OR operation on the content anomaly detection result set R to obtain the content anomaly detection result result sv ; S301, select the normal label data set D c and abnormal label dataset D e , divide the subsets and randomly select subsets to construct sample pairs, and obtain the positive sample pair set P of normal follow-up record time series features cc , abnormal follow-up record time series feature positive sample pair set P ee and the negative sample pair set P of follow-up record temporal features ce ; S302, according to the normal follow-up record time series feature positive sample pair set P cc , abnormal follow-up record time series feature positive sample pair set P ee and the negative sample pair set P of follow-up record temporal features ce Perform model training to obtain the normal similarity monitoring twin neural network SN c and abnormal similarity monitoring twin neural network SN e ; S303, obtain the follow-up record to be detected and convert it into a follow-up feature vector u to be detected, and compare the follow-up feature vector u to be detected with the normal label data set D c and abnormal label dataset D e Repeat the construction of data pairs for multiple times to obtain the normal follow-up record time series feature similarity detection data pair set P uc and abnormal follow-up record time series feature similarity detection data set P ue , the normal follow-up record time series feature similarity detection data set P uc and abnormal follow-up record time series feature similarity detection data set P ue Input the normal similarity monitoring twin neural network SN respectively c and abnormal similarity monitoring twin neural network SN e In the above example, we obtain the normal label similarity set S c and the abnormal label similarity set S e ; S304, the normal tag similarity set S c The variance of the average value is calculated to obtain the variance sc d , for the abnormal label similarity set S e Take the minimum value and get the minimum value se m; S305, according to the set similarity threshold, the variance sc d and the minimum value se m Perform calculations to obtain the time series feature anomaly detection result sn ; S400, the content anomaly detection result result sv And the time series feature anomaly detection result sn Perform an OR operation to obtain the final anomaly detection result result u .
[0006] As a preferred solution, the construction of the follow-up record data set D includes: converting the follow-up records into a feature vector set X, denoted as X=(x1, x2, ..., x n ), where the eigenvector x i The characteristic values of are divided into four subsets: patient name, follow-up time, follow-up questionnaire and patient description, that is,
[0007] x i =(name i , time i , questionnaire i ,description i ):
[0008] For all eigenvectors x in the eigenvector group X i Perform missing value check. If the feature vector x i If the eigenvalue of is missing, then delete the eigenvector x i , obtain the feature vector group X after missing value processing; according to the feature vector x in the feature vector group X after missing value processing i Follow-up questionnaire subset i , establish a feature value mapping table H, and convert the follow-up questionnaire subset questionnaire i The non-numeric eigenvalues are mapped to numeric eigenvalues, and the mapping rules are stored in the eigenvalue mapping table H to obtain the eigenvector group X after discrete value processing; for the eigenvector x in the eigenvector group X after discrete value processing i A subset of patient descriptions i , use jieba word segmentation component to describe the patient description subset i Perform word segmentation and use the word2vec model to convert the word segmentation results into word vectors, input the word vectors into the LSTM model to obtain the patient description subset description iThe probability of expressing positive emotions; converting the probability into an emotion score on a percentage basis and describing the subset of patients i The text content in is replaced with the sentiment score to obtain the feature vector group X after sentiment analysis; according to the feature vector x in the feature vector group X after sentiment analysis i , perform normal / abnormal label discrimination, and establish a classification label vector group, recorded as Y = (y1, y2, ..., y n ), where the classification label vector y i and the eigenvector x i One-to-one correspondence, y i =1 indicates abnormality, y i =0 indicates normal; combining the feature vector group X and the classification label vector group Y, a follow-up record data set D is established, denoted as D=(X, Y).
[0009] As a preferred solution, the training steps of the LSTM model include: using the jieba word segmentation component to segment the patient description part in the follow-up record set D, and using the UTF-8 encoding rules to encode the characters in the word segmentation result to obtain a word segmentation data set; using the word2vec model to convert the word segmentation data set into a word vector to obtain a word vector data set; based on the word vector data set, training the LSTM model for sentiment feature extraction.
[0010] As a preferred solution, the normal label data set D c It includes a set of eigenvectors X, denoted as X = (x1, x2, ..., xn), where the eigenvector x i The characteristic values of are divided into four subsets: patient name, follow-up time, follow-up questionnaire and patient description, that is,
[0011] x i =(name i , time i , questionnaire i ,description i )
[0012] Then the step S201 specifically includes: according to the feature vector x in the feature vector group X i The follow-up time subset time i , the normal label data set D c Divide into n subsets, denoted as D c =(d1, d2, ..., d n ), where subset d i Represents the follow-up records of all patients at each follow-up time; for the normal label data set D c The subset d ini , determine the number of clusters k, and use the K-means algorithm to divide the subset d i Clustered into k data clusters, denoted as For the normal label dataset D c All subsets d in i Do the above processing to obtain the normal label data set D after clustering processing c , recorded as
[0013]
[0014] For the normal label dataset D c The subset d in i In the k data clusters, take the first 30% of the data closest to the cluster center in each data cluster to construct a new subset d′ i , for the normal label dataset D c All subsets d in i Do the above processing to get the new normal label data set D c , denoted as D c =(d1, d2, ..., d n ), where subset d′ i Represents the follow-up records of all patients at each follow-up time.
[0015] As a preferred solution, the step S202 specifically includes: according to the new normal label data set D′ c The subset d′ in i , use the SVDD algorithm to train the SVDD classifier, where the kernel function uses the Gaussian kernel function, and the formula of the Gaussian kernel function is as follows:
[0016]
[0017] where a n 、b n For the new normal label dataset D′ c The two eigenvectors in ||a n -b n || 2 Represents the feature vector a n 、b n Euclidean distance, σ is the bandwidth of the Gaussian kernel function, which is used to control the local scope of the kernel function; for the new normal label data set D′ c All subsets d′ in i After the above processing, we get a SVDD classifier set F consisting of n SVDD classifiers, denoted as F = (f1, f2, ..., f n ), where the SVDD classifier f i And the new normal label dataset D′c Each subset d′ in i One-to-one correspondence, that is, each SVDD classifier f i The subset d′ corresponding to a specific follow-up time i .
[0018] As a preferred solution, in step S203, the acquisition of the follow-up record to be detected and converting it into the follow-up feature vector u to be detected includes: converting the follow-up record to be detected into a feature vector according to the feature value mapping table H, and using the mapping rules in the feature value mapping table H to map the non-numeric feature values in the feature vector to the numeric feature values, and obtaining the follow-up feature vector u to be detected after discrete value processing, wherein the feature value mapping table H is based on the feature vector x in the feature vector group X. i Follow-up questionnaire subset i Establish; convert the patient description subset in the to-be-detected follow-up feature vector u after the discrete value processing into a sentiment score, and replace the text content in the patient description subset with the sentiment score to obtain the to-be-detected follow-up record feature vector u after sentiment analysis processing.
[0019] As a preferred solution, step S301 specifically includes: dividing the follow-up record data set D into a normal label data set D according to the normal / abnormal label. c and abnormal label dataset D e , denoted as D=(D c , D e ); For the normal label dataset D c , according to the patient's name, that is, the feature vector x in the feature vector group X i The characteristic value of name i , the normal label data set D c Divided into m c subset, denoted as For the abnormal label dataset D e , according to the patient's name, that is, the feature vector x in the feature vector group X i The characteristic value of name i , the abnormal label dataset D e Divide into me subsets, denoted as In the normal label dataset D c Randomly select two subsets c from i and c j , construct the positive sample pairs of normal follow-up record time series features (c i , c j ), repeatedly construct the above positive sample pairs to obtain the positive sample pair set P of normal follow-up record time series features cc ; In the abnormal label dataset D e Randomly select two subsets e fromi and e j , construct positive sample pairs of abnormal follow-up record time series features (e i , e j ), repeatedly construct the above positive sample pairs to obtain the abnormal follow-up record time series feature positive sample pair set P ee ; In the normal label dataset D c Randomly select a subset c from i , in the abnormal label dataset D e Randomly select a subset e from j , construct negative sample pairs of follow-up record time series features (c i, e j ), repeatedly construct the above negative sample pairs to obtain the negative sample pair set P of follow-up record time series features ce .
[0020] As a preferred solution, step S302 specifically includes: according to the normal follow-up record time series feature positive sample pair set P cc and the negative sample pair set P of follow-up record temporal features ce , train the normal similarity monitoring twin neural network SN c ;
[0021] According to the abnormal follow-up record time series feature positive sample pair set P ee and the negative sample pair set P of follow-up record temporal features ce , training the anomaly similarity monitoring twin neural network SN e ; The normal similarity monitoring twin neural network SN c and abnormal similarity monitoring twin neural network SN e The model structures of the two LSTMs are the same, both use two LTSMs with shared parameters to extract the time series features of the follow-up records, and use Contrastive Loss to compare the similarity of the time series feature vectors extracted by the two LSTMs.
[0022] As a preferred solution, step S303 specifically includes: according to the eigenvalue mapping table H, the follow-up record to be detected is converted into a feature vector, and the non-numeric eigenvalues in the feature vector are mapped to numerical eigenvalues using the mapping rules in the eigenvalue mapping table H, to obtain the feature vector u of the follow-up record to be detected after discrete value processing, and the eigenvalue mapping table H is based on the feature vector x in the feature vector group X. i Follow-up questionnaire subset iEstablish; convert the patient description subset in the feature vector u of the follow-up record to be detected after the discrete value processing into a sentiment score, and replace the text content in the patient description subset with the sentiment score to obtain the feature vector u of the follow-up record to be detected after sentiment analysis processing; according to the feature vector u of the follow-up record to be detected after sentiment analysis processing, in the normal label data set D c Randomly select a subset c from i , construct the normal follow-up record time series feature similarity detection data pair (u, c i ), repeatedly construct the above data pair k c Second, obtain the normal follow-up record time series feature similarity detection data set P uc ; The normal follow-up record time series feature similarity detection data set P uc Input normal similarity monitoring twin neural network SN c , obtain the feature vectors u and k of the follow-up records to be detected c A normal label similarity set, denoted as The similarity sc i and the normal follow-up record time series feature similarity detection data set P uc Each data pair (u, c i ) in the normal label follow-up record feature vector c i One-to-one correspondence; according to the feature vector u of the follow-up record to be detected after the sentiment analysis, in D e Randomly select a subset e from i , construct abnormal follow-up record time series feature similarity detection data pair (u, e i ). Repeat the above data pair k e Second, obtain the abnormal follow-up record time series feature similarity detection data set P ue ; The abnormal follow-up record time series feature similarity detection data set P ue Input Anomaly Similarity Monitoring Twin Neural Network SN e , obtain the feature vectors u and k of the follow-up records to be detected e Anomaly label similarity set, denoted as The similarity se i and abnormal follow-up record time series feature similarity detection data set P ue Each data pair (u, e i ) in the abnormal label follow-up record feature vector e i One to one correspondence.
[0023] As a preferred solution, step S305 specifically includes: setting a similarity threshold of the normal tag follow-up record feature vector, denoted as M ca , set the similarity threshold of the feature vector of the abnormal label follow-up record, denoted as Mem , perform the following operation to obtain the time series feature anomaly detection result, recorded as result sn ,Right now:
[0024]
[0025]
[0026]
[0027] Result sn =(result ca or result cd )and result em
[0028] If result sn =1, the time series characteristics of the follow-up records to be tested are judged to be abnormal; if result sn =0, the time series characteristics of the follow-up records to be tested are judged to be normal.
[0029] Compared with the prior art, the beneficial effects of the present invention include:
[0030] (1) The present invention adopts a text sentiment analysis method. By training an LSTM model for sentiment feature extraction, the patient description part in the follow-up record is converted into a sentiment score, and the relatively vague and colloquial patient description text is converted into a clear and quantifiable value and integrated into the follow-up record dataset, which provides a dataset source and a conversion rule for the follow-up record to be detected for subsequent anomaly detection.
[0031] (2) In view of the fact that the number of normal follow-up records in the follow-up record data set is much larger than that of abnormal follow-up records, the present invention adopts the single-class model algorithm SVDD to construct a classifier to realize anomaly detection of the follow-up record content. Compared with the traditional binary classification model, the accuracy of anomaly detection is improved under the condition of data imbalance.
[0032] (3) The present invention adopts LSTM to construct a twin neural network for the follow-up record sequence data, and performs similarity detection on the time series features of the follow-up records to be detected by using two similarity monitoring twin neural networks, normal / abnormal, respectively, thereby improving the accuracy and persuasiveness of the similarity detection results of the time series features of the follow-up records.
[0033] (4) The present invention combines the abnormality detection results of the follow-up record content and the detection results of the follow-up record time series characteristics to obtain the final follow-up record abnormality detection results, and completes the abnormality detection from two dimensions: the follow-up record content and the follow-up record time series characteristics, thereby expanding the coverage of the abnormality detection, improving the accuracy and persuasiveness of the abnormality detection results, and avoiding the problems of omissions and lags in abnormal judgment caused by the traditional manual review method. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The disclosure of the present invention is described with reference to the accompanying drawings. It should be understood that the drawings are for illustrative purposes only and are not intended to limit the scope of protection of the present invention. In the accompanying drawings, the same reference numerals are used to refer to the same components. Among them:
[0035] Figure 1 Schematic diagram of the process of the abnormality detection method of the follow-up records according to the embodiment of the present invention;
[0036] Figure 2 Schematic diagram of the structure of the twin neural network of an embodiment of the present invention. DETAILED DESCRIPTION
[0037] It is easy to understand that according to the technical solution of the present invention, without changing the essential spirit of the present invention, a person skilled in the art can propose a variety of interchangeable structural modes and implementation modes. Therefore, the following specific implementation modes and drawings are only exemplary descriptions of the technical solution of the present invention, and should not be regarded as the whole of the present invention or as a limitation or restriction to the technical solution of the present invention.
[0038] According to one embodiment of the present invention, Figure 1 A method for detecting anomalies in follow-up records comprises the following steps:
[0039] S100, collecting follow-up records and constructing a follow-up record dataset D, wherein the follow-up record dataset D includes a normal label dataset D c and abnormal label dataset D e .
[0040] In an embodiment of the present invention, the follow-up record is mainly composed of the following four attributes: patient name, follow-up time, follow-up questionnaire and patient description. Taking the postoperative follow-up of gastric cancer patients as an example, the patient needs to complete the follow-up record at 1 month, 3 months, 6 months, 9 months, 12 months, 18 months and 24 months after surgery. The main information of the follow-up record is concentrated in the follow-up questionnaire and the patient description. The question format in the follow-up questionnaire is single-choice, multiple-choice or numerical fill-in-the-blank questions, and the patient description is a summary of the patient's physical condition, changes in the disease, postoperative feelings, etc. from the time of surgery to the current follow-up time.
[0041] Since follow-up records in questionnaire or text form cannot be directly used in the training of machine learning / deep learning models, it is necessary to convert the follow-up records into a specific form of data set required for training models in machine learning / deep learning, and provide the data set source and conversion rules for the follow-up records to be detected for the subsequent anomaly detection method.
[0042] For follow-up questionnaires, the options of single-choice questions and multiple-choice questions in the questionnaire can be mapped into numerical values, and a feature value mapping table can be established to save the mapping rules; for patient descriptions, considering that most patient descriptions are non-fixed format and more colloquial language, the text sentiment analysis method is used to convert the content (text) in the patient description into a sentiment score (numerical value).
[0043] Specifically, the above construction of the follow-up record dataset D includes the following steps:
[0044] S101, convert the follow-up records into a feature vector group X, denoted as X=(x1, x2, ..., x n ), where the eigenvector x i The feature values of are divided into four subsets: patient name, follow-up time, follow-up questionnaire and patient description, that is, x i =(name i , time i , questionnaire i ,description i ).
[0045] S102: for all the feature vectors x in the feature vector group X, i Perform missing value check. If the feature vector x i If the eigenvalue of is missing, then delete the eigenvector x i , obtain the feature vector group X after missing value processing.
[0046] S103, based on the feature vector x in the feature vector group X after missing value processing i Follow-up questionnaire subset i , establish a feature value mapping table H, and convert the follow-up questionnaire subset questionnaire i The non-numeric eigenvalues are mapped into numeric eigenvalues, and the mapping rules are stored in the eigenvalue mapping table H to obtain the eigenvector group X after discrete value processing;
[0047] S104: for the feature vector x in the feature vector group X after discrete value processing, i A subset of patient descriptions i, use jieba word segmentation component to describe the patient description subset i Perform word segmentation and use the word2vec model to convert the word segmentation results into word vectors, input the word vectors into the LSTM model to obtain the patient description subset description i Probability of expressing positive emotions
[0048] S105, convert the probability into a sentiment score according to the percentage system (0 points represent absolute negativity, 100 points represent absolute positivity), and write the patient description subset description i Replace the text content in with the sentiment score. For all feature vectors x in the feature vector group X i After the above processing, a feature vector group X is obtained after sentiment analysis.
[0049] S106, based on the feature vector x in the feature vector group X processed by the sentiment analysis i , perform normal / abnormal label discrimination, and establish a classification label vector group, recorded as Y = (y1, y2, ..., y n ), where the classification label vector y i and the eigenvector x i One-to-one correspondence, y i =1 indicates abnormality, y i =0 means normal.
[0050] S107, combining the feature vector group X and the classification label vector group Y to establish a follow-up record data set D, denoted as D=(X, Y).
[0051] Furthermore, in the above step S104, the training step of the LSTM model includes:
[0052] a) Use the Jieba word segmentation component to segment the patient description part in the follow-up record set D, and use the UTF-8 encoding rules to encode the characters in the word segmentation results to obtain the word segmentation dataset.
[0053] b) Use the word2vec model to convert the word segmentation dataset into word vectors to obtain a word vector dataset.
[0054] c) Based on the word vector dataset, train an LSTM model for sentiment feature extraction. The LSTM model can extract sentiment features from word vectors, thereby obtaining the probability of expressing positive sentiment in the original text corresponding to the word vector.
[0055] S201, select normal label data set D c , according to the follow-up time, the normal label data set D c Divide into n subsets and perform thei Perform clustering to obtain a new normal label data set D′ c .
[0056] Select the normal label dataset D c , is to select the normal label in the follow-up record dataset D, that is, the classification label vector y in the classification label vector group Y i = 0 to construct a normal label data set, denoted as D c .
[0057] Specifically, the above step S201 includes:
[0058] S2011, according to the feature vector x in the feature vector group X, i The follow-up time subset time i , the normal label data set D c Divide into n subsets, denoted as D c =(d1, d2, ..., d n ), where subset d i Represents the follow-up records of all patients at each follow-up time.
[0059] S2012, for the normal label dataset D c The subset d in i , determine the number of clusters k, and use the K-means algorithm to divide the subset d i Clustered into k data clusters, denoted as For the normal label dataset D c All subsets d in i Do the above processing to obtain the normal label data set D after clustering processing c , recorded as
[0060]
[0061] S2013, for the normal label dataset D c The subset d in i In the k data clusters, take the first 30% of the data closest to the cluster center in each data cluster to construct a new subset d′ i , for the normal label dataset D c All subsets d in i Do the above processing to get the new normal label data set D′ c , denoted as D′ c =(d′ 1, d′2,......,d′ n ), where subset d′ i Represents the follow-up records of all patients at each follow-up time.
[0062] S202, based on the new normal label data set D′ c , the SVDD algorithm is used for model training to obtain the SVDD classifier set F.
[0063] It should be understood that in the follow-up records, the number of normal follow-up records is much larger than that of abnormal follow-up records, so it is suitable to use a single-class model to detect anomalies in the follow-up record content. The SVDD algorithm (Support Vector Domain Description) is different from the traditional SVM (Support Vector Machine) algorithm. During model training, the SVDD algorithm only uses single-class samples to construct a data set, and constructs a sphere based on the single-class samples, and the sphere contains all single-class samples; during anomaly detection, by calculating the distance between the sample to be detected and the center of the sphere, if the distance is less than or equal to the radius of the sphere, the sample to be detected and the single-class sample used in training are of the same class, otherwise they are not of the same class.
[0064] In order to obtain a better effect of the SVDD classifier, we need to select appropriate single-class samples to construct a data set. If some samples that are far away from most samples are selected to construct the data set, the radius of the ball constructed by the SVDD algorithm will be larger, and this ball with a larger radius cannot well represent the characteristics of the single-class samples in the data set. Therefore, the present invention proposes to cluster the follow-up record data set through the K-means algorithm, select appropriate follow-up record data to reconstruct the data set, and then use the SVDD algorithm to train the classifier.
[0065] Specifically, the above step S202 includes:
[0066] S2021, based on the new normal label data set D′ c The subset d′ in i , use the SVDD algorithm to train the SVDD classifier, where the kernel function uses the Gaussian kernel function, and the formula of the Gaussian kernel function is as follows:
[0067]
[0068] where a n 、b n For the new normal label dataset D′ c The two eigenvectors in ||a n -b n || 2 Represents the feature vector a n 、b n The Euclidean distance of , σ is the bandwidth of the Gaussian kernel function, which is used to control the local scope of the kernel function;
[0069] S2022, for the new normal label dataset D′ c All subsets d′ in i After the above processing, we get a SVDD classifier set F consisting of n SVDD classifiers, denoted as F = (f1, f2, ..., f n ), where the SVDD classifier f i And the new normal label dataset D′ c Each subset d in i One-to-one correspondence, that is, each SVDD classifier f i The subset d corresponding to a specific follow-up time i .
[0070] S203, obtaining the follow-up record to be detected and converting it into a follow-up feature vector u to be detected, and dividing the follow-up feature vector u to be detected into n subsets u according to the follow-up time i , and the subset u i Input into the SVDD classifier set F and obtain the content anomaly detection result set R;
[0071] Specifically, the above step S203 includes:
[0072] S2031, according to the eigenvalue mapping table H obtained in the above step S1013, the follow-up record to be detected is converted into a feature vector, and the non-numeric eigenvalues in the feature vector are mapped to numerical eigenvalues using the mapping rules in the eigenvalue mapping table H, so as to obtain the follow-up feature vector u to be detected after discrete value processing.
[0073] S2032, converting the patient description subset in the to-be-detected follow-up record feature vector u after discrete value processing into a sentiment score, and replacing the text content in the patient description subset with the sentiment score, to obtain the to-be-detected follow-up record feature vector u after sentiment analysis processing.
[0074] S2033, according to the follow-up time, the follow-up time subset of the feature vector u, divide the feature vector u into n subsets, denoted as u=(u1, u2, ..., u n ), where subset u i Indicates the follow-up records to be tested at each follow-up time.
[0075] S2034, a subset u of the feature vectors of the n follow-up records to be detected is i Input into the SVDD classifier f corresponding to the follow-up time i , get a subset u of n follow-up record feature vectors to be detected i The result set of content anomaly detection is denoted as R = (r1, r2, ..., r n ), where ri =0 indicates abnormality, r i =1 means normal.
[0076] S204, performing an OR operation on the content anomaly detection result set R to obtain the content anomaly detection result result sυ .Right now:
[0077] Result sυ =(r1 or r2 or ......or r n )
[0078] If result sυ =1, the content of the follow-up record to be tested is considered abnormal; if result sυ =0, the content of the follow-up record to be tested is determined to be normal.
[0079] In the embodiment of the present invention, the above steps S201-S204 are a process of constructing a classifier using the single-class model algorithm SVDD to implement abnormal detection of the follow-up record content.
[0080] S301, select normal label data set D c and abnormal label dataset D e , divide the subsets and randomly select subsets to construct sample pairs, and obtain the positive sample pair set P of normal follow-up record time series features cc , abnormal follow-up record time series feature positive sample pair set P ee and the negative sample pair set P of follow-up record temporal features ce .
[0081] Specifically, the above step S301 includes:
[0082] S3011, according to the normal / abnormal labels, divide the follow-up record dataset D into the normal label dataset D c and abnormal label dataset D e , denoted as D=(D c , D e ).
[0083] S3012, for the normal label dataset D c , according to the patient's name, that is, the feature vector x in the feature vector group X i The characteristic value of name i , the normal label data set D c Divide into mc subsets, denoted as
[0084] S3013, for the abnormal label dataset D e , according to the patient's name, that is, the feature vector x in the feature vector group X iThe characteristic value of name i , the abnormal label dataset D e Divide into me subsets, denoted as
[0085] S3014, in the normal label dataset D c Randomly select two subsets c from i and c j , construct the positive sample pairs of normal follow-up record time series features (c i , c j ), repeatedly construct the above positive sample pairs to obtain the positive sample pair set P of normal follow-up record time series features cc .
[0086] S3015, in the abnormal label dataset D e Randomly select two subsets e from i and e j , construct positive sample pairs of abnormal follow-up record time series features (e i , e j ), repeatedly construct the above positive sample pairs to obtain the abnormal follow-up record time series feature positive sample pair set P ee .
[0087] S3016, in the normal label dataset D c Randomly select a subset c from i , in the abnormal label dataset D e Randomly select a subset e from j , construct negative sample pairs of follow-up record time series features (c i , e j ), repeatedly construct the above negative sample pairs to obtain the negative sample pair set P of follow-up record time series features ce .
[0088] S302, based on the time series characteristics of normal follow-up records, positive sample pair set P cc , abnormal follow-up record time series feature positive sample pair set P ee and the negative sample pair set P of follow-up record temporal features ce Perform model training to obtain the normal similarity monitoring twin neural network SN c and abnormal similarity monitoring twin neural network SN e .
[0089] Specifically, the above step S302 includes:
[0090] S3021, based on the time series characteristics of normal follow-up records, positive sample pair set P cc and the negative sample pair set P of follow-up record temporal features ce , train the normal similarity monitoring twin neural network SN c.
[0091] S3022, based on the time series characteristics of abnormal follow-up records, positive sample pair set P ee and the negative sample pair set P of follow-up record temporal features ce , training the anomaly similarity monitoring twin neural network SN e .
[0092] See also Figure 2 ,The twin neural network is a coupling framework based on two neural networks. The two sub-networks share training parameters, take two samples as input, and output their representation embedded in a high-dimensional space to compare the similarity of the two samples.
[0093] Normal Similarity Monitoring Siamese Neural Network SN c and abnormal similarity monitoring twin neural network SN e The model structure is the same, both use two LTSMs with shared parameters to extract the time series features of the follow-up records, and use Contrastive Loss to compare the similarity of the time series feature vectors extracted by the two LSTMs. That is:
[0094] The twin neural network uses two LTSMs with shared parameters to extract the time series features of the follow-up records, and uses Contrastive Loss to compare the similarity of the time series feature vectors extracted by the two LSTMs. The calculation formula of Contrastive Loss is as follows:
[0095]
[0096] where a n 、b n They represent the time series feature vectors extracted by the two LSTMs that share parameters in the twin neural network, ||a n -b n || 2 represents the Euclidean distance between the two time series feature vectors; y represents whether a positive sample or a negative sample is used, y=1 represents a positive sample, y=0 represents a negative sample, and M is the set similarity threshold.
[0097] S303, obtain the follow-up record to be detected and convert it into a follow-up feature vector u to be detected, and compare the follow-up feature vector u to be detected with the normal label data set D c and abnormal label dataset D e Repeat the construction of data pairs for multiple times to obtain the normal follow-up record time series feature similarity detection data pair set P uc and abnormal follow-up record time series feature similarity detection data set P ue , the normal follow-up record time series feature similarity detection data set P ucand abnormal follow-up record time series feature similarity detection data set P ue Input the normal similarity monitoring twin neural network SN respectively c and abnormal similarity monitoring twin neural network SN e In the above example, we obtain the normal label similarity set S c and the abnormal label similarity set S e .
[0098] Specifically, the above step S303 includes:
[0099] S3031, according to the eigenvalue mapping table H obtained in the above step S1013, the follow-up record to be detected is converted into a feature vector, and the non-numeric eigenvalues in the feature vector are mapped to numerical eigenvalues using the mapping rules in the eigenvalue mapping table H, to obtain the feature vector u of the follow-up record to be detected after discrete value processing.
[0100] S3032, converting the patient description subset in the feature vector u of the follow-up record to be detected after discrete value processing into a sentiment score, and replacing the text content in the patient description subset with the sentiment score, to obtain the feature vector u of the follow-up record to be detected after sentiment analysis processing.
[0101] S3033, based on the feature vector u of the follow-up record to be detected after the sentiment analysis, in the normal label data set D c Randomly select a subset c from i , construct the normal follow-up record time series feature similarity detection data pair (u, c i ), repeatedly construct the above data pair k c Second, obtain the normal follow-up record time series feature similarity detection data set P uc .
[0102] S3034: the normal follow-up record time series feature similarity detection data set P uc Input normal similarity monitoring twin neural network SN c , obtain the feature vectors u and k of the follow-up records to be detected c A normal label similarity set, denoted as The similarity sc i and the normal follow-up record time series feature similarity detection data set P uc Each data pair (u, c i ) in the normal label follow-up record feature vector c i One to one correspondence.
[0103] S3035, according to the feature vector u of the follow-up record to be detected after the sentiment analysis, in D e Randomly select a subset e from i, construct abnormal follow-up record time series feature similarity detection data pair (u, e i ). Repeat the above data pair k e Second, obtain the abnormal follow-up record time series feature similarity detection data set P ue .
[0104] S3036: The abnormal follow-up record time series feature similarity detection data set P ue Input Anomaly Similarity Monitoring Twin Neural Network SN e , obtain the feature vectors u and k of the follow-up records to be detected e Anomaly label similarity set, denoted as The similarity se i and abnormal follow-up record time series feature similarity detection data set P ue Each data pair (u, e i ) in the abnormal label follow-up record feature vector e i One to one correspondence.
[0105] S304, for the normal label similarity set S c Take the average and calculate the variance to get the average value sc a and variance sc d ; For the abnormal label similarity set S e Take the minimum value and get the minimum value se m .Right now:
[0106]
[0107]
[0108]
[0109] S305: according to the set similarity threshold, the average value sc a , variance sc d and the minimum value se m Perform calculations to obtain the time series feature anomaly detection result sn .
[0110] Specifically, step S305 includes:
[0111] Set the similarity threshold of the feature vector of the normal label follow-up record, denoted as M ca , set the similarity threshold of the feature vector of the abnormal label follow-up record, denoted as M em , perform the following operation to obtain the time series feature anomaly detection result, recorded as result sn ,Right now:
[0112]
[0113]
[0114]
[0115] Result sn =(result ca or result cd )and result em
[0116] If result sn =1, the time series characteristics of the follow-up records to be tested are judged to be abnormal; if result sn =0, the time series characteristics of the follow-up records to be tested are judged to be normal.
[0117] In an embodiment of the present invention, the above steps S301-S305 are a process of constructing a twin neural network using LSTM, and performing similarity detection on the time series features of the follow-up records to be detected by using normal / abnormal twin neural networks respectively.
[0118] S400, the content anomaly detection result result sυ And the time series feature anomaly detection result sn Perform an OR operation to obtain the final anomaly detection result result u .
[0119] Right now:
[0120] Result u =result sυ Or result sn
[0121] If result u =1, the follow-up record to be tested is considered abnormal; if result u =0, the follow-up record to be tested is judged to be normal.
[0122] In summary, the beneficial effects of the present invention include:
[0123] (1) The present invention adopts a text sentiment analysis method. By training an LSTM model for sentiment feature extraction, the patient description part in the follow-up record is converted into a sentiment score, and the relatively vague and colloquial patient description text is converted into a clear and quantifiable value and integrated into the follow-up record dataset, which provides a dataset source and a conversion rule for the follow-up record to be detected for subsequent anomaly detection.
[0124] (2) In view of the fact that the number of normal follow-up records in the follow-up record data set is much larger than that of abnormal follow-up records, the present invention adopts the single-class model algorithm SVDD to construct a classifier to realize anomaly detection of the follow-up record content. Compared with the traditional binary classification model, the accuracy of anomaly detection is improved under the condition of data imbalance.
[0125] (3) The present invention adopts LSTM to construct a twin neural network for the follow-up record sequence data, and performs similarity detection on the time series features of the follow-up records to be detected by using two similarity monitoring twin neural networks, normal / abnormal, respectively, thereby improving the accuracy and persuasiveness of the similarity detection results of the time series features of the follow-up records.
[0126] (4) The present invention combines the abnormality detection results of the follow-up record content and the detection results of the follow-up record time series characteristics to obtain the final follow-up record abnormality detection results, and completes the abnormality detection from two dimensions: the follow-up record content and the follow-up record time series characteristics, thereby expanding the coverage of the abnormality detection, improving the accuracy and persuasiveness of the abnormality detection results, and avoiding the problems of omissions and lags in abnormal judgment caused by the traditional manual review method.
[0127] It should be understood that if the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0128] The technical scope of the present invention is not limited to the contents in the above description. Those skilled in the art can make various deformations and modifications to the above embodiments without departing from the technical idea of the present invention, and these deformations and modifications should all fall within the protection scope of the present invention.
Claims
1. A method for detecting anomalies in follow-up records, characterized in that: The steps include: S100, collect follow-up records and construct follow-up record data set , the follow-up record dataset Including normal label dataset and abnormal label dataset ; S201, select normal label data set , according to the follow-up time, the normal label data set Divide into n subsets , and for the subset Perform clustering to obtain a new normal label data set ; S202, based on the new normal label data set , use the SVDD algorithm to train the model and obtain the SVDD classifier set F; S203, obtaining the follow-up record to be detected and converting it into a follow-up feature vector to be detected , according to the follow-up time, the follow-up feature vector to be detected Divide into n subsets , and the subset Input into the SVDD classifier set F and obtain the content anomaly detection result set R; S204, performing an OR operation on the content anomaly detection result set R to obtain a content anomaly detection result ; S301, selecting the normal label data set and abnormal label dataset , divide the subsets and randomly select subsets to construct sample pairs, and obtain the positive sample pairs of normal follow-up record time series characteristics , abnormal follow-up record time series feature positive sample pair set and negative sample pairs of follow-up record temporal features ; S302, based on the normal follow-up record time series feature positive sample pair set , abnormal follow-up record time series feature positive sample pair set and negative sample pairs of follow-up record temporal features Perform model training to obtain a normal similarity detection twin neural network and anomaly similarity detection twin neural networks ; S303: Obtain the follow-up record to be detected and convert it into a follow-up feature vector to be detected , the follow-up feature vector to be detected With normal label dataset and abnormal label dataset Repeat the process several times to construct data pairs and obtain the normal follow-up record time series feature similarity detection data pair set. and abnormal follow-up record time series feature similarity detection data set , the normal follow-up record time series feature similarity detection data set and abnormal follow-up record time series feature similarity detection data set Input the normal similarity detection twin neural network separately and anomaly similarity detection twin neural networks In the example above, we obtain the normal label similarity set and abnormal label similarity set ; S304: the normal tag similarity set Take the mean and calculate the variance to get the average and variance , for the abnormal label similarity set Take the minimum value to get the minimum value ; S305: According to the set similarity threshold, the average ,variance and minimum value Perform calculations to obtain the time series feature anomaly detection results ; S400: The content anomaly detection result And the results of abnormal detection of time series characteristics Perform an OR operation to obtain the final anomaly detection result ; The step S303 specifically includes: according to the feature value mapping table H, converting the follow-up record to be detected into a feature vector, and using the mapping rules in the feature value mapping table H to map the non-numeric feature value in the feature vector to a numeric feature value, so as to obtain the feature vector of the follow-up record to be detected after discrete value processing. The eigenvalue mapping table H is based on the eigenvectors in the eigenvector group X A subset of follow-up questionnaires Establish; the characteristic vector of the follow-up record to be detected after the discrete value processing The patient description subset in the image is converted into a sentiment score, and the text content in the patient description subset is replaced with the sentiment score to obtain the feature vector of the follow-up record to be detected after sentiment analysis. ; According to the feature vector of the follow-up record to be detected after the sentiment analysis , in the normal label dataset Randomly select a subset of , construct the normal follow-up record time series feature similarity detection data pair , repeatedly construct the above data pairs Second, obtain the normal follow-up record time series feature similarity detection data set ; The normal follow-up record time series feature similarity detection data set Input Normal Similarity Monitoring Siamese Neural Network , obtain the feature vector of the follow-up record to be detected and A normal label similarity set, denoted as , where the similarity and normal follow-up record time series feature similarity detection data set Each data pair Normal label follow-up record feature vector One-to-one correspondence; according to the feature vector of the follow-up record to be detected after the sentiment analysis ,exist Randomly select a subset of , construct abnormal follow-up record time series feature similarity detection data pair , repeatedly construct the above data pairs Second, obtain the abnormal follow-up record time series feature similarity detection data set ; The abnormal follow-up record time series feature similarity detection data set Input Anomaly Similarity Monitoring Siamese Neural Network , obtain the feature vector of the follow-up record to be detected and Anomaly label similarity set, denoted as , where the similarity and abnormal follow-up record time series feature similarity detection data set Each data pair The feature vector of the abnormal label follow-up record One to one correspondence.
2. The method for detecting anomalies in follow-up records according to claim 1, characterized in that: In step S100, constructing a follow-up record dataset D includes: The follow-up records are converted into feature vector group X, denoted as , where the eigenvector The characteristic values of are divided into four subsets: patient name, follow-up time, follow-up questionnaire and patient description, that is, ; For all the eigenvectors in the eigenvector group X Perform missing value check. If the feature vector If the eigenvalue of is missing, delete the eigenvector , obtain the feature vector group X after missing value processing; According to the missing value processing of the feature vector group X feature vector A subset of follow-up questionnaires was used to establish a eigenvalue mapping table , the follow-up questionnaire subset The non-numeric eigenvalues are mapped into numeric eigenvalues, and the mapping rules are stored in the eigenvalue mapping table H to obtain the eigenvector group X after discrete value processing; For the feature vector in the feature vector group X after discrete value processing A subset of patient descriptions , use the Jieba word segmentation component to describe the subset of patients Perform word segmentation and use the word2vec model to convert the word segmentation results into word vectors, input the word vectors into the LSTM model to obtain the patient description subset The probability of expressing positive emotions; The probabilities were converted into sentiment scores on a percentage basis and the patient description subsets were Replace the text content in with the sentiment score to obtain the feature vector group X after sentiment analysis; According to the feature vector in the feature vector group X after the sentiment analysis processing , to distinguish normal / abnormal labels and establish a classification label vector group, recorded as , where the classification label vector and the eigenvector One to one correspondence, Indicates abnormality, Indicates normal; Combine the feature vector group X and the classification label vector group Y to establish the follow-up record data set D, denoted as .
3. The method for detecting anomalies in follow-up records according to claim 2, characterized in that: The training steps of the LSTM model include: Use the Jieba word segmentation component to segment the patient description part in the follow-up record set D, and use the UTF-8 encoding rule to encode the characters in the word segmentation results to obtain the word segmentation dataset; Use the word2vec model to convert the word segmentation dataset into word vectors to obtain a word vector dataset; According to the word vector dataset, an LSTM model for sentiment feature extraction is trained.
4. The method for detecting anomalies in follow-up records according to claim 1, characterized in that: The normal label dataset Including the feature vector group X, denoted as , where the eigenvector The characteristic values of are divided into four subsets: patient name, follow-up time, follow-up questionnaire and patient description, that is, ; Then the step S201 specifically includes: According to the feature vector in the feature vector group X Subset of follow-up time , the normal label dataset Divide into n subsets, denoted as , where the subset represents the follow-up records of all patients at each follow-up time; For normal label dataset A subset of , determine the number of clusters k, and use the K-means algorithm to divide the subsets Clustered into k data clusters, denoted as , for normal label dataset All subsets of Do the above processing to obtain the normal label data set after clustering processing , recorded as ; For normal label dataset A subset of In the k data clusters, take the first 30% of the data closest to the cluster center in each data cluster to construct a new subset , for normal label dataset All subsets of Do the above processing to get a new normal label data set , recorded as , where the subset Represents the follow-up records of all patients at each follow-up time.
5. The method for detecting anomalies in follow-up records according to claim 1, characterized in that: The step S202 specifically includes: According to the new normal label dataset A subset of , use the SVDD algorithm to train the SVDD classifier, where the kernel function uses the Gaussian kernel function, and the formula of the Gaussian kernel function is as follows: ; in For the new normal label dataset The two eigenvectors in Represents the feature vector The Euclidean distance of is the bandwidth of the Gaussian kernel function, which is used to control the local range of the kernel function; For the new normal label dataset All subsets of After the above processing, we get the SVDD classifier set F consisting of n SVDD classifiers, denoted as , where the SVDD classifier and new normal label dataset Each subset of One-to-one correspondence, that is, each SVDD classifier A subset corresponding to a specific follow-up time .
6. The method for detecting anomalies in follow-up records according to claim 1, characterized in that: In step S203, the follow-up record to be detected is obtained and converted into a feature vector of the follow-up to be detected. ,include: According to the eigenvalue mapping table H, the follow-up records to be detected are converted into eigenvectors, and the non-numeric eigenvalues in the eigenvectors are mapped to numeric eigenvalues using the mapping rules in the eigenvalue mapping table H to obtain the follow-up eigenvectors to be detected after discrete value processing. The eigenvalue mapping table H is based on the eigenvectors in the eigenvector group X A subset of follow-up questionnaires Establish; The discrete value processed follow-up feature vector to be detected The patient description subset in the image is converted into a sentiment score, and the text content in the patient description subset is replaced with the sentiment score to obtain the feature vector of the follow-up record to be detected after sentiment analysis. .
7. The method for detecting anomalies in follow-up records according to claim 1, characterized in that: The step S301 specifically includes: According to the normal / abnormal labels, the follow-up record dataset D is divided into a normal label dataset and abnormal label dataset , recorded as ; For normal label dataset , according to the patient's name, that is, the feature vector in the feature vector group X The eigenvalue of , the normal label dataset Divide into subset, denoted as ; For abnormal label dataset , according to the patient's name, that is, the feature vector group The eigenvectors in The eigenvalue of , the abnormal label dataset Divide into subset, denoted as ; In the normal label dataset Randomly select two subsets from and , construct the positive sample pairs of normal follow-up record time series features , repeatedly construct the above positive sample pairs to obtain the positive sample pair set of normal follow-up record time series features ; In the abnormal label dataset Randomly select two subsets from and , construct positive sample pairs of abnormal follow-up record time series features , repeatedly construct the above positive sample pairs to obtain the positive sample pair set of abnormal follow-up record time series features ; In the normal label dataset Randomly select a subset of , in the abnormal label dataset Randomly select a subset of , construct negative sample pairs of follow-up record time series features , repeatedly construct the above negative sample pairs to obtain the negative sample pair set of follow-up record time series features .
8. The method for detecting anomalies in follow-up records according to claim 1, characterized in that: The step S302 specifically includes: According to the normal follow-up record time series feature positive sample pair set and negative sample pairs of follow-up record temporal features , train the normal similarity monitoring twin neural network ; According to the abnormal follow-up record time series feature positive sample pair set and negative sample pairs of follow-up record temporal features , training anomaly similarity monitoring twin neural network ; The normal similarity monitoring twin neural network and anomaly similarity monitoring twin neural networks The model structures of the two LSTMs are the same, both use two LTSMs with shared parameters to extract the time series features of the follow-up records, and use ContrastiveLoss to compare the similarity of the time series feature vectors extracted by the two LSTMs.
9. The method for detecting anomalies in follow-up records according to claim 1, characterized in that: The step S305 specifically includes: Set the similarity threshold of the feature vector of the normal label follow-up record, denoted as , set the similarity threshold of the feature vector of the abnormal label follow-up record, Recorded as , perform the following operations to obtain the time series feature anomaly detection results, denoted as ,Right now: ; like , then the time series characteristics of the follow-up records to be tested are judged to be abnormal; if , then the time series characteristics of the follow-up records to be tested are judged to be normal.
Citation Information
Patent Citations
Semantic enhanced hash medical image retrieval method based on mixed attention
CN113889228A
Partially customized machine learning models for data de-identification
US20210303725A1
