Abnormality recognition method applied to electrocardiogram and related equipment

By performing coding model vector transformation and text prototype training on electrocardiogram data, the problem of low prediction accuracy of electrocardiogram data in the prior art is solved, and a higher prediction accuracy of heart disease is achieved.

CN119924846AActive Publication Date: 2025-05-06PING AN TECH (SHENZHEN) CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510014139.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-05-06
Estimated Expiration
2045-01-03

AI Technical Summary

Technical Problem

The existing methods use electrocardiogram data to predict heart disease, the prediction accuracy is too low to effectively capture multivariate timing models.

Method used

By reading the system database, obtaining historical ECG data, using the encoding model to convert vectors, obtaining historical timing embedded vectors. Then build the initial text prototype and model loss function, perform model training, and obtain the target text prototype. Receive the electrocardiogram data to be analyzed, perform the second vector conversion, input the target text prototype for abnormal identification, and output the recognition result.

Benefits of technology

By establishing text prototypes and aligning the timing embedding space to the text embedding space, large language models can better understand timing data, thereby improving the accuracy of heart disease prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119924846A_ABST
    Figure CN119924846A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of model prediction, and relates to an abnormality recognition method and related equipment applied to an electrocardiogram, and the method comprises the steps: carrying out the first vector conversion operation of historical electrocardiogram data according to a coding model, and obtaining a historical time sequence embedded vector; constructing an initial text prototype, and calculating an initial text embedding vector of the initial text prototype according to the contrast learning function and the historical time sequence embedding vector; constructing a model loss function according to the historical time sequence embedding vector and the initial text embedding vector; performing model training operation on the text prototype according to the model loss function to obtain a target text prototype; receiving to-be-analyzed electrocardiogram data sent by the user terminal; performing second vector conversion operation on the to-be-analyzed electrocardiogram data according to the loss coding model to obtain a to-be-analyzed time sequence embedded vector; and inputting the to-be-analyzed time sequence embedding vector into the target text prototype to perform exception recognition operation to obtain an exception recognition result. The prediction accuracy of the heart disease can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of model prediction technology, and in particular to an abnormality recognition method and related equipment applied to electrocardiograms. Background Art

[0002] Most of the data collected by medical devices are time series data, which can help doctors assess patients' health status, monitor disease progression and develop treatment plans. Depending on the type of disease and diagnostic needs, doctors also need other types of time series data for diagnosis. Currently, many medical institutions use someone's electrocardiogram (ECG) data to determine whether they have heart disease.

[0003] The traditional method of using electrocardiogram (ECG) data to determine whether they have heart disease is as follows: extract key features from the ECG data, such as QRS complex, ST segment changes, etc. This helps to convert time series data into a feature set that can be used for machine learning. Then, use machine learning algorithms such as support vector machines (SVM), decision trees, or neural networks to classify the extracted features and determine whether there is heart disease.

[0004] However, the applicant found that the prediction accuracy of existing methods is too low because this task is a multivariate time series classification task, in which each sample is an electrocardiogram signal containing multiple variables, such as different leads of the heart's electrical activity. Traditional methods cannot capture multivariate modeling. Summary of the invention

[0005] The purpose of the embodiments of the present application is to propose an abnormality recognition method and related equipment applied to electrocardiograms to solve the problem that the prediction accuracy of existing methods is too low.

[0006] In order to solve the above technical problems, the present application provides an abnormality recognition method applied to an electrocardiogram, which adopts the following technical solution:

[0007] Reading a system database, and obtaining historical electrocardiogram data in the system database;

[0008] Performing a first vector conversion operation on the historical electrocardiogram data according to the encoding model to obtain a historical time series embedding vector;

[0009] Constructing an initial text prototype, and calculating an initial text embedding vector of the initial text prototype according to a contrastive learning function and the historical time series embedding vector;

[0010] Constructing a model loss function according to the historical time series embedding vector and the initial text embedding vector;

[0011] Performing a model training operation on the text prototype according to the model loss function to obtain a target text prototype;

[0012] Receiving electrocardiogram data to be analyzed sent by a user terminal;

[0013] Performing a second vector conversion operation on the electrocardiogram data to be analyzed according to the lossy coding model to obtain a time series embedding vector to be analyzed;

[0014] Inputting the time series embedding vector to be analyzed into the target text prototype to perform an anomaly recognition operation to obtain an anomaly recognition result;

[0015] The abnormality identification result is output to the user terminal.

[0016] Furthermore, the step of performing a first vector conversion operation on the historical electrocardiogram data according to the encoding model to obtain a historical time series embedding vector specifically includes the following steps:

[0017] Perform segmentation operations on the historical electrocardiogram data according to a time series segmentation algorithm to obtain historical electrocardiogram segments;

[0018] The historical electrocardiogram segments are input into the encoding model for vector conversion operation to obtain the historical time series embedding vector.

[0019] Furthermore, after the step of reading the system database and acquiring the historical electrocardiogram data in the system database, and before the step of performing a first vector conversion operation on the historical electrocardiogram data according to the encoding model to obtain the historical time series embedding vector, the following steps are also included:

[0020] Automatically extract and learn typical time series patterns in the historical electrocardiogram data using a time series pattern mining algorithm to obtain a time series pattern feature set;

[0021] Adaptively grouping the historical electrocardiogram data according to the cluster analysis method and the time series pattern feature set to obtain historical electrocardiogram data with similar time series patterns;

[0022] The step of performing a first vector conversion operation on the historical electrocardiogram data according to the encoding model to obtain a historical time series embedding vector specifically includes the following steps:

[0023] The historical electrocardiogram data with similar time series patterns are respectively input into the encoding model to perform a third vector conversion operation to obtain the historical time series embedding vector.

[0024] Furthermore, the historical time series embedding vector includes a historical embedding vector, a historical positive sample embedding vector, and a historical negative sample embedding vector. After the step of segmenting the historical electrocardiogram data to obtain historical electrocardiogram segments, the following steps are also included:

[0025] Performing data enhancement operation on the historical electrocardiogram segments to obtain historical positive sample electrocardiogram segments and historical negative sample electrocardiogram segments;

[0026] The step of inputting the historical electrocardiogram segments into the coding model for vector conversion operation to obtain the historical time series embedding vector specifically includes the following steps:

[0027] The historical electrocardiogram segments, the historical positive sample electrocardiogram segments, and the historical negative sample electrocardiogram segments are respectively input into the encoding model for vector conversion operations to obtain the historical embedding vector, the historical positive sample embedding vector, and the historical negative sample embedding vector.

[0028] Furthermore, the contrastive learning function L fea It is expressed as:

[0029]

[0030] Among them, f triplet (·) represents the triple loss function, e k represents the historical embedding vector, represents the historical positive sample embedding vector, represents the historical negative sample embedding vector, and tp represents the initial text embedding vector.

[0031] Furthermore, the model loss function L text It is expressed as:

[0032]

[0033] Among them, sim(tp,e k ) represents the similarity calculation formula of the historical embedding vector and the initial text embedding vector,: fea Denotes the contrastive learning function.

[0034] In order to solve the above technical problems, the embodiment of the present application further provides an abnormality recognition device applied to an electrocardiogram, which adopts the following technical solution:

[0035] A historical data acquisition module, used for reading a system database and acquiring historical electrocardiogram data in the system database;

[0036] A first vector conversion module, used for performing a first vector conversion operation on the historical electrocardiogram data according to the encoding model to obtain a historical time series embedding vector;

[0037] An initial text embedding vector calculation module, used to construct an initial text prototype and calculate an initial text embedding vector of the initial text prototype according to a contrastive learning function and the historical time series embedding vector;

[0038] A loss function construction module, used to construct a model loss function according to the historical time series embedding vector and the initial text embedding vector;

[0039] A model training module, used for performing a model training operation on the text prototype according to the model loss function to obtain a target text prototype;

[0040] The data acquisition module to be analyzed is used to receive the electrocardiogram data to be analyzed sent by the user terminal;

[0041] A second vector conversion module, used for performing a second vector conversion operation on the electrocardiogram data to be analyzed according to a lossy coding model to obtain a time series embedding vector to be analyzed;

[0042] A timing analysis module, used for inputting the timing embedding vector to be analyzed into the target text prototype to perform an anomaly recognition operation and obtain an anomaly recognition result;

[0043] A result output module is used to output the abnormality identification result to the user terminal.

[0044] Furthermore, the first vector conversion module includes:

[0045] A segmentation submodule, used for performing segmentation operations on the historical electrocardiogram data according to a time series segmentation algorithm to obtain historical electrocardiogram segments;

[0046] The first vector conversion submodule is used to input the historical electrocardiogram segment into the encoding model to perform a vector conversion operation to obtain the historical time series embedding vector.

[0047] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0048] The invention comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the abnormality identification method applied to an electrocardiogram as described above when executing the computer-readable instructions.

[0049] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0050] The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the abnormality identification method applied to the electrocardiogram as described above are implemented.

[0051] The present application provides an abnormality recognition method for electrocardiogram, comprising: reading a system database, obtaining historical electrocardiogram data from the system database; performing a first vector conversion operation on the historical electrocardiogram data according to a coding model to obtain a historical time series embedding vector; constructing an initial text prototype, and calculating an initial text embedding vector of the initial text prototype according to a contrast learning function and the historical time series embedding vector; constructing a model loss function according to the historical time series embedding vector and the initial text embedding vector; performing a model training operation on the text prototype according to the model loss function to obtain a target text prototype; receiving electrocardiogram data to be analyzed sent by a user terminal; performing a second vector conversion operation on the electrocardiogram data to be analyzed according to a loss coding model to obtain a time series embedding vector to be analyzed; inputting the time series embedding vector to be analyzed into the target text prototype for abnormality recognition operation to obtain an abnormality recognition result; and outputting the abnormality recognition result to the user terminal. Compared with the prior art, the present application aligns the time series embedding space to the text embedding space by establishing a text prototype, so that a large language model can understand the time series data, thereby distinguishing normal electrocardiograms from abnormal electrocardiograms, so as to greatly improve the prediction accuracy of heart disease. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0053] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0054] Figure 2 is a flowchart of an implementation of an abnormality recognition method applied to an electrocardiogram provided in an embodiment of the present application;

[0055] Figure 3 is a schematic diagram of the structure of an abnormality identification device applied to an electrocardiogram provided in an embodiment of the present application;

[0056] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0058] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0059] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0060] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0061] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0062] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.

[0063] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .

[0064] It should be noted that the abnormality identification method applied to the electrocardiogram provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the abnormality identification device applied to the electrocardiogram is generally set in the server / terminal device.

[0065] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0066] Continue to refer Figure 2 , shows a flow chart of an embodiment of an abnormality recognition method applied to an electrocardiogram according to the present application. The abnormality recognition method applied to an electrocardiogram comprises: step S201, step S202, step S203, step S204, step S205, step S206, step S207, step S208 and step S209.

[0067] In step S201, the system database is read to obtain historical electrocardiogram data from the system database.

[0068] In an embodiment of the present application, whether a person has heart disease is determined based on electrocardiogram (ECG) data. In this task, each sample is an ECG signal, which contains multiple variables, such as different leads of cardiac electrical activity. The present application can use the time series data of these ECG signals to train a classification model to distinguish between normal ECGs and abnormal ECGs. The data set is represented as follows:

[0069]

[0070] Where X i is the i-th sample, which is a multi-dimensional time series data, represented as follows:

[0071]

[0072] Where D represents the number of variables and T represents the length of time.

[0073] In step S202, a first vector conversion operation is performed on the historical electrocardiogram data according to the encoding model to obtain a historical time series embedding vector.

[0074] In the embodiment of the present application, an encoding model (such as a convolutional neural network, a recurrent neural network or a Transformer, etc.) is used to convert the ECG data from the original format into a vector form. These vectors (historical time series embedding vectors) capture the time series characteristics of the ECG data, which is convenient for subsequent processing.

[0075] In step S203, an initial text prototype is constructed, and an initial text embedding vector of the initial text prototype is calculated based on the contrastive learning function and the historical time series embedding vector.

[0076] In an embodiment of the present application, a contrastive learning function (a method commonly used to learn similarities or differences between data) is used to calculate the embedding vectors between these vectors and the initial text prototype.

[0077] In the embodiment of this application, the purpose of this article is to align the time series data with the article data, so it is necessary to establish a text prototype. This text space will use some descriptive terms in the field of time series data, such as: high, low, up, down, stable, and fluctuating. However, if you label it manually, it will waste a lot of manpower, so this article uses comparative learning to find the original model vector tp, which is expressed as follows:

[0078]

[0079] Among them, f triplet (·) represents the triple loss function, e k represents the historical embedding vector, represents the historical positive sample embedding vector, represents the historical negative sample embedding vector, and tp represents the initial text embedding vector.

[0080] In step S204, a model loss function is constructed based on the historical time series embedding vector and the initial text embedding vector.

[0081] In the embodiment of the present application, the loss function is a key indicator for evaluating the performance of the model during the model training process. Here, a loss function is constructed based on the difference between the time series embedding vector of the historical electrocardiogram data and the initial text embedding vector to guide the optimization direction of the model.

[0082] In the embodiment of the present application, the similarity calculation formula between text embedding and time series embedding is expressed as sim(tp,e k ), in order to align the data of the two modalities, the final loss function is as follows:

[0083]

[0084] Among them, sim(tp,e k ) represents the similarity calculation formula of the historical embedding vector and the initial text embedding vector, L fea Denotes the contrastive learning function.

[0085] In step S205, a model training operation is performed on the text prototype according to the model loss function to obtain a target text prototype.

[0086] In the embodiment of the present application, by continuously iterating the training process and adjusting the model parameters to minimize the loss function, an optimized "target text prototype" is finally obtained. This prototype can more effectively process the electrocardiogram data and perform anomaly detection.

[0087] In step S206, the electrocardiogram data to be analyzed sent by the user terminal is received.

[0088] In step S207, a second vector conversion operation is performed on the electrocardiogram data to be analyzed according to the lossy coding model to obtain a time series embedding vector to be analyzed.

[0089] In step S208, the time series embedding vector to be analyzed is input into the target text prototype for anomaly recognition operation to obtain anomaly recognition results.

[0090] In step S209, the abnormality identification result is output to the user terminal.

[0091] In the embodiments of the present application, technologies such as deep learning, vector representation and contrastive learning are combined to achieve intelligent analysis and anomaly detection of electrocardiogram data.

[0092] In an embodiment of the present application, a method for identifying an abnormality applied to an electrocardiogram is provided, including: reading a system database, obtaining historical electrocardiogram data in the system database; performing a first vector conversion operation on the historical electrocardiogram data according to a coding model to obtain a historical time series embedding vector; constructing an initial text prototype, and calculating an initial text embedding vector of the initial text prototype according to a contrast learning function and the historical time series embedding vector; constructing a model loss function according to the historical time series embedding vector and the initial text embedding vector; performing a model training operation on the text prototype according to the model loss function to obtain a target text prototype; receiving electrocardiogram data to be analyzed sent by a user terminal; performing a second vector conversion operation on the electrocardiogram data to be analyzed according to a loss coding model to obtain a time series embedding vector to be analyzed; inputting the time series embedding vector to be analyzed into the target text prototype for an abnormality identification operation to obtain an abnormality identification result; and outputting the abnormality identification result to the user terminal. Compared with the prior art, the present application aligns the time series embedding space to the text embedding space by establishing a text prototype, so that a large language model can understand the time series data, thereby distinguishing normal electrocardiograms from abnormal electrocardiograms, so as to greatly improve the prediction accuracy of heart disease.

[0093] In some optional implementations of the embodiments of the present application, the step of performing a first vector conversion operation on the historical electrocardiogram data according to the encoding model to obtain a historical time series embedding vector specifically includes the following steps:

[0094] According to the time series segmentation algorithm, the historical electrocardiogram data are segmented to obtain historical electrocardiogram segments;

[0095] The historical ECG segments are input into the encoding model for vector conversion operation to obtain the historical time series embedding vector.

[0096] In the embodiment of the present application, the i-th sample X i Divide into K fragments, expressed as follows:

[0097]

[0098] Among them, Seg(·) represents the segmentation function, and the uniform segmentation method is used to divide each time series data into K segments, where s k represents the kth fragment.

[0099] In some optional implementations of the embodiments of the present application, after the step of reading the system database and obtaining the historical electrocardiogram data in the system database, and before the step of performing a first vector conversion operation on the historical electrocardiogram data according to the encoding model to obtain the historical time series embedding vector, the following steps are also included:

[0100] The time series pattern mining algorithm is used to automatically extract and learn typical time series patterns in historical electrocardiogram data to obtain a time series pattern feature set;

[0101] Adaptively grouping historical electrocardiogram data according to a cluster analysis method and a time series pattern feature set to obtain historical electrocardiogram data with similar time series patterns;

[0102] The step of performing a first vector conversion operation on the historical electrocardiogram data according to the encoding model to obtain a historical time series embedding vector specifically includes the following steps:

[0103] The historical electrocardiogram data with similar time series patterns are respectively input into the encoding model for a third vector conversion operation to obtain a historical time series embedding vector.

[0104] In the embodiment of the present application, time series pattern mining refers to the technology of extracting subsequences that appear frequently or have specific meanings from time series data. The time series pattern mining algorithm can identify typical waveform or rhythm features that appear repeatedly in historical electrocardiogram data.

[0105] In the embodiment of the present application, automatic extraction and learning will automatically traverse the historical ECG data set, identify and record all typical time series patterns. These patterns represent normal ECG features and also represent certain pathological features.

[0106] In the embodiment of the present application, a feature set containing all identified temporal patterns is generated, which provides a basis for subsequent clustering analysis and coding models.

[0107] In the embodiment of the present application, cluster analysis is mainly used to divide a data set into multiple clusters or groups, so that data points in the same group are similar to each other, while data points in different groups are quite different.

[0108] In the embodiment of the present application, in the electrocardiogram data analysis, cluster analysis will group the historical electrocardiogram data according to the time series pattern feature set. This process is adaptive, which means that the grouping results will be adjusted and optimized according to the actual situation of the data.

[0109] In the embodiment of the present application, through cluster analysis, we can obtain multiple groups of historical electrocardiogram data with similar time series patterns. The electrocardiogram waveforms or rhythm features in these data groups are similar to each other, which is convenient for subsequent analysis and processing.

[0110] In an embodiment of the present application, the encoding model is used to extract deep features of electrocardiogram data.

[0111] In the embodiment of the present application, multiple technologies such as time series pattern mining, cluster analysis and vector conversion are combined to achieve in-depth analysis and feature extraction of historical electrocardiogram data.

[0112] In some optional implementations of the embodiments of the present application, the above-mentioned historical time series embedding vector includes a historical embedding vector, a historical positive sample embedding vector, and a historical negative sample embedding vector. After the steps of segmenting the historical electrocardiogram data to obtain historical electrocardiogram segments, the following steps are also included:

[0113] Perform data enhancement operations on historical ECG segments to obtain historical positive sample ECG segments and historical negative sample ECG segments;

[0114] The steps of inputting the historical electrocardiogram segments into the encoding model for vector conversion operation to obtain the historical time series embedding vector specifically include the following steps:

[0115] The historical ECG segments, historical positive sample ECG segments and historical negative sample ECG segments are respectively input into the encoding model for vector conversion operations to obtain historical embedding vectors, historical positive sample embedding vectors and historical negative sample embedding vectors.

[0116] In the embodiment of the present application, for each segment s k , data enhancement is required to obtain a corresponding positive sample Then select a segment from the remaining segments as a negative sample

[0117] In the embodiment of the present application, each fragment is converted into an embedding vector, which is mathematically expressed as This conversion process requires the use of an encoding model, which is expressed as follows:

[0118] e k =Encoder(s k )

[0119]

[0120] Among them, Encoder(·) represents the encoding model, e k represents the embedding vector of the kth segment, represents the embedding vector of the positive sample of the kth segment, The embedding vector representing the negative sample of the kth segment.

[0121] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0122] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0123] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0124] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0125] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of an abnormality recognition device for electrocardiogram, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0126] like Figure 3 As shown, the abnormality identification device 200 applied to the electrocardiogram of the embodiment of the present application includes:

[0127] A historical data acquisition module 210 is used to read a system database and acquire historical electrocardiogram data from the system database;

[0128] A first vector conversion module 220, configured to perform a first vector conversion operation on the historical electrocardiogram data according to the coding model to obtain a historical time series embedding vector;

[0129] An initial text embedding vector calculation module 230, used to construct an initial text prototype and calculate an initial text embedding vector of the initial text prototype according to a contrastive learning function and a historical time series embedding vector;

[0130] A loss function construction module 240 is used to construct a model loss function according to the historical time series embedding vector and the initial text embedding vector;

[0131] A model training module 250 is used to perform a model training operation on the text prototype according to the model loss function to obtain a target text prototype;

[0132] The to-be-analyzed data acquisition module 260 is used to receive the to-be-analyzed electrocardiogram data sent by the user terminal;

[0133] A second vector conversion module 270, configured to perform a second vector conversion operation on the electrocardiogram data to be analyzed according to the lossy coding model to obtain a time series embedding vector to be analyzed;

[0134] The timing analysis module 280 is used to input the timing embedding vector to be analyzed into the target text prototype to perform an anomaly recognition operation and obtain an anomaly recognition result;

[0135] The result output module 290 is used to output the abnormality identification result to the user terminal.

[0136] In an embodiment of the present application, an abnormality recognition device 200 for electrocardiogram is provided, comprising: a historical data acquisition module 210, used to read a system database and obtain historical electrocardiogram data in the system database; a first vector conversion module 220, used to perform a first vector conversion operation on the historical electrocardiogram data according to a coding model to obtain a historical time series embedding vector; an initial text embedding vector calculation module 230, used to construct an initial text prototype, and calculate an initial text embedding vector of the initial text prototype according to a contrast learning function and the historical time series embedding vector; a loss function construction module 240, used to calculate an initial text embedding vector of the initial text prototype according to the historical time series embedding vector, the initial text embedding vector, and the loss function construction module 240. A model loss function is constructed by inputting a vector; a model training module 250 is used to perform a model training operation on the text prototype according to the model loss function to obtain a target text prototype; a data acquisition module 260 to be analyzed is used to receive the electrocardiogram data to be analyzed sent by the user terminal; a second vector conversion module 270 is used to perform a second vector conversion operation on the electrocardiogram data to be analyzed according to the loss coding model to obtain a time series embedding vector to be analyzed; a time series analysis module 280 is used to input the time series embedding vector to be analyzed into the target text prototype for anomaly recognition operation to obtain anomaly recognition results; a result output module 290 is used to output the anomaly recognition results to the user terminal. Compared with the prior art, the present application establishes a text prototype and aligns the time series embedding space to the text embedding space so that a large language model can understand the time series data, thereby distinguishing normal electrocardiograms from abnormal electrocardiograms, so as to greatly improve the prediction accuracy of heart disease.

[0137] In some optional implementations of the embodiments of the present application, the first vector conversion module includes:

[0138] A segmentation submodule is used to segment the historical electrocardiogram data according to the time series segmentation algorithm to obtain historical electrocardiogram segments;

[0139] The first vector conversion submodule is used to input the historical electrocardiogram segments into the encoding model for vector conversion operation to obtain the historical time series embedding vector.

[0140] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of a computer device according to an embodiment of the present application.

[0141] The computer device 300 includes a memory 310, a processor 320, and a network interface 330 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 300 having components 310-330, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0142] The computer device may be a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with the user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0143] The memory 310 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 310 can be an internal storage unit of the computer device 300, such as a hard disk or memory of the computer device 300. In other embodiments, the memory 310 can also be an external storage device of the computer device 300, such as a plug-in hard disk equipped on the computer device 300, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. Of course, the memory 310 can also include both the internal storage unit of the computer device 300 and its external storage device. In the embodiment of the present application, the memory 310 is generally used to store the operating system and various application software installed on the computer device 300, such as computer-readable instructions for an abnormal electrocardiogram recognition method, etc. In addition, the memory 310 can also be used to temporarily store various data that have been output or are to be output.

[0144] The processor 320 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 320 is generally used to control the overall operation of the computer device 300. In the embodiment of the present application, the processor 320 is used to run the computer-readable instructions stored in the memory 310 or process data, such as running the computer-readable instructions of the abnormality identification method applied to the electrocardiogram.

[0145] The network interface 330 may include a wireless network interface or a wired network interface. The network interface 330 is generally used to establish a communication connection between the computer device 300 and other electronic devices.

[0146] The computer device provided in this application establishes a text prototype and aligns the time series embedding space to the text embedding space so that a large language model can understand the time series data, thereby distinguishing between normal electrocardiograms and abnormal electrocardiograms, thereby greatly improving the prediction accuracy of heart disease.

[0147] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the abnormality identification method applied to the electrocardiogram as described above.

[0148] The computer-readable storage medium provided in this application establishes a text prototype and aligns the time series embedding space to the text embedding space so that a large language model can understand the time series data, thereby distinguishing between normal electrocardiograms and abnormal electrocardiograms, thereby greatly improving the prediction accuracy of heart disease.

[0149] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0150] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A method for identifying abnormalities in an electrocardiogram, characterized in that: The steps include: Reading a system database, and obtaining historical electrocardiogram data in the system database; Performing a first vector conversion operation on the historical electrocardiogram data according to the encoding model to obtain a historical time series embedding vector; Constructing an initial text prototype, and calculating an initial text embedding vector of the initial text prototype according to a contrastive learning function and the historical time series embedding vector; Constructing a model loss function according to the historical time series embedding vector and the initial text embedding vector; Performing a model training operation on the text prototype according to the model loss function to obtain a target text prototype; Receiving electrocardiogram data to be analyzed sent by a user terminal; Performing a second vector conversion operation on the electrocardiogram data to be analyzed according to the lossy coding model to obtain a time series embedding vector to be analyzed; Inputting the time series embedding vector to be analyzed into the target text prototype to perform an anomaly recognition operation to obtain an anomaly recognition result; The abnormality identification result is output to the user terminal.

2. The abnormality recognition method applied to electrocardiogram according to claim 1, characterized in that: The step of performing a first vector conversion operation on the historical electrocardiogram data according to the encoding model to obtain a historical time series embedding vector specifically includes the following steps: Perform segmentation operations on the historical electrocardiogram data according to a time series segmentation algorithm to obtain historical electrocardiogram segments; The historical electrocardiogram segments are input into the encoding model to perform vector conversion operations to obtain the historical time series embedding vectors.

3. The abnormality recognition method applied to electrocardiogram according to claim 1, characterized in that: After the step of reading the system database and acquiring the historical electrocardiogram data in the system database, and before the step of performing a first vector conversion operation on the historical electrocardiogram data according to the encoding model to obtain the historical time series embedding vector, the following steps are also included: Automatically extract and learn typical time series patterns in the historical electrocardiogram data using a time series pattern mining algorithm to obtain a time series pattern feature set; Adaptively grouping the historical electrocardiogram data according to the cluster analysis method and the time series pattern feature set to obtain historical electrocardiogram data with similar time series patterns; The step of performing a first vector conversion operation on the historical electrocardiogram data according to the encoding model to obtain a historical time series embedding vector specifically includes the following steps: The historical electrocardiogram data with similar time series patterns are respectively input into the encoding model to perform a third vector conversion operation to obtain the historical time series embedding vector.

4. The abnormality recognition method applied to electrocardiogram according to claim 2, characterized in that: The historical time series embedding vector includes a historical embedding vector, a historical positive sample embedding vector and a historical negative sample embedding vector. After the step of segmenting the historical electrocardiogram data to obtain historical electrocardiogram segments, the following steps are also included: Performing data enhancement operation on the historical electrocardiogram segments to obtain historical positive sample electrocardiogram segments and historical negative sample electrocardiogram segments; The step of inputting the historical electrocardiogram segments into the coding model for vector conversion operation to obtain the historical time series embedding vector specifically includes the following steps: The historical electrocardiogram segments, the historical positive sample electrocardiogram segments, and the historical negative sample electrocardiogram segments are respectively input into the encoding model for vector conversion operations to obtain the historical embedding vector, the historical positive sample embedding vector, and the historical negative sample embedding vector.

5. The abnormality recognition method applied to electrocardiogram according to claim 4, characterized in that: The contrastive learning function L fea It is expressed as: Among them, f triplet (·) represents the triple loss function, e k represents the historical embedding vector, represents the historical positive sample embedding vector, represents the historical negative sample embedding vector, and tp represents the initial text embedding vector.

6. The abnormality recognition method applied to electrocardiogram according to claim 5, characterized in that: The model loss function L text It is expressed as: Among them, sim(tp,e k ) represents the similarity calculation formula of the historical embedding vector and the initial text embedding vector, L fea Denotes the contrastive learning function.

7. An abnormality recognition device for electrocardiogram, characterized in that: include: A historical data acquisition module, used for reading a system database and acquiring historical electrocardiogram data in the system database; A first vector conversion module, used for performing a first vector conversion operation on the historical electrocardiogram data according to the encoding model to obtain a historical time series embedding vector; An initial text embedding vector calculation module, used to construct an initial text prototype and calculate an initial text embedding vector of the initial text prototype according to a contrastive learning function and the historical time series embedding vector; A loss function construction module, used to construct a model loss function according to the historical time series embedding vector and the initial text embedding vector; A model training module, used for performing a model training operation on the text prototype according to the model loss function to obtain a target text prototype; The data acquisition module to be analyzed is used to receive the electrocardiogram data to be analyzed sent by the user terminal; A second vector conversion module, used for performing a second vector conversion operation on the electrocardiogram data to be analyzed according to a lossy coding model to obtain a time series embedding vector to be analyzed; A timing analysis module, used for inputting the timing embedding vector to be analyzed into the target text prototype to perform an anomaly recognition operation and obtain an anomaly recognition result; A result output module is used to output the abnormality identification result to the user terminal.

8. The abnormality identification device for electrocardiogram according to claim 7, characterized in that: The first vector conversion module includes: A segmentation submodule, used for performing segmentation operations on the historical electrocardiogram data according to a time series segmentation algorithm to obtain historical electrocardiogram segments; The first vector conversion submodule is used to input the historical electrocardiogram segment into the encoding model to perform a vector conversion operation to obtain the historical time series embedding vector.

9. A computer device comprising a memory and a processor, characterized in that: The memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the abnormality identification method applied to an electrocardiogram as claimed in any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the abnormality identification method applied to an electrocardiogram as claimed in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Electrocardiogram characterization self-supervised learning method

    CN115429286A

  • Electrocardiogram emotion recognition method based on comparative learning

    CN117131333A

  • Multi-lead electrocardiogram data processing method and device based on graph contrast learning and medium

    CN117668466A

  • Multi-dimensional psychological state assessment method based on multi-modal fusion

    CN117796810A

  • PU contrast learning anomaly detection method and system based on multi-modal prototype network

    CN117951632A