An abnormality recognition method applied to electrocardiogram and related device

By using an encoding model and a contrastive learning function to perform vector transformation and text prototype training on electrocardiogram (ECG) data, the problem of low prediction accuracy of ECG data is solved, and intelligent anomaly identification and high-precision prediction of ECG data are achieved.

CN119924846BActive Publication Date: 2026-06-26PING AN TECH (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN TECH (SHENZHEN) CO LTD
Filing Date
2025-01-03
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies have low predictive accuracy when using electrocardiogram data to diagnose heart diseases and cannot effectively capture the characteristics of multivariate time series data.

Method used

An encoding model is used to perform vector transformation on electrocardiogram (ECG) data. A loss function is constructed by combining a contrastive learning function and a text prototype. The target text prototype is obtained through training to identify anomalies in the ECG data to be analyzed.

Benefits of technology

By establishing a text prototype and aligning the temporal embedding space to the text embedding space, the prediction accuracy of heart disease is improved, and intelligent analysis and anomaly detection of electrocardiogram data are realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119924846B_ABST
    Figure CN119924846B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of model prediction, and relates to an abnormality identification method applied to electrocardiograms and related equipment.The method comprises the following steps: performing a first vector conversion operation on historical electrocardiogram data according to an encoding model to obtain a historical time sequence 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 sequence embedding vector; constructing a model loss function according to the historical time sequence 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 encoding model to obtain a time sequence embedding vector to be analyzed; inputting the time sequence embedding vector to be analyzed into the target text prototype to perform an abnormality identification operation and obtaining an abnormality identification result.The application can greatly improve the prediction accuracy of heart diseases.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of model prediction technology, and in particular to an abnormality identification method and related equipment applied to electrocardiograms. Background Technology

[0002] Most medical devices collect time-series data, which helps doctors assess patients' health, monitor disease progression, and develop treatment plans. Depending on the type of disease and diagnostic needs, doctors may require other types of time-series data for diagnosis. Currently, many healthcare facilities rely on an individual's electrocardiogram (ECG) data to determine if they have heart disease.

[0003] Traditional methods for using electrocardiogram (ECG) data to determine if someone has heart disease involve extracting key features from the ECG data, such as the QRS complex and ST segment changes. This helps transform time-series data into a feature set that can be used for machine learning. Then, machine learning algorithms, such as support vector machines (SVMs), decision trees, or neural networks, are used to classify the extracted features and determine whether heart disease is present.

[0004] However, the applicant found that existing methods have too low prediction accuracy 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 cardiac electrical activity. Traditional methods cannot capture multivariate modeling. Summary of the Invention

[0005] The purpose of this application is to propose an abnormality identification method and related equipment for electrocardiograms, so as to solve the problem of low prediction accuracy of existing methods.

[0006] To address the aforementioned technical problems, this application provides a method for abnormality identification in electrocardiograms, employing the following technical solution:

[0007] Read the system database and retrieve historical electrocardiogram data from the system database;

[0008] The historical electrocardiogram data is subjected to a first vector transformation operation based on the encoding model to obtain the historical time-series embedding vector;

[0009] Construct an initial text prototype, and calculate the initial text embedding vector of the initial text prototype based on the contrastive learning function and the historical temporal embedding vector;

[0010] The model loss function is constructed based on the historical time-series embedding vector and the initial text embedding vector.

[0011] The target text prototype is obtained by training the model based on the model loss function.

[0012] Receive electrocardiogram data to be analyzed sent by the user terminal;

[0013] The second vector transformation operation is performed on the electrocardiogram data to be analyzed according to the loss coding model to obtain the time series embedding vector to be analyzed.

[0014] The time series embedding vector to be analyzed is input into the target text prototype to perform an anomaly identification operation, and the anomaly identification result is obtained.

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

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

[0017] The historical electrocardiogram data is segmented according to the time series segmentation algorithm to obtain historical electrocardiogram segments.

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

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

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

[0021] The historical electrocardiogram data are adaptively grouped according to the clustering 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 transformation operation on the historical electrocardiogram data according to the encoding model to obtain the historical time-series embedding vector specifically includes the following steps:

[0023] Historical electrocardiogram data with similar temporal patterns are input into the encoding model for a third vector transformation operation to obtain the historical temporal 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 step is also included:

[0025] Data augmentation is performed on the historical ECG image segments to obtain historical positive sample ECG image segments and historical negative sample ECG image segments.

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

[0027] The historical ECG image segments, the historical positive sample ECG image segments, and the historical negative sample ECG image segments are respectively input into the encoding model for vector transformation operation 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 Represented as:

[0029]

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

[0031] Furthermore, the model loss function L text Represented as:

[0032]

[0033] Wherein, sim(tp,e k () represents the similarity calculation formula between the historical embedding vector and the initial text embedding vector. fea This represents the contrastive learning function.

[0034] To address the aforementioned technical problems, this application also provides an abnormality recognition device for electrocardiograms, employing the following technical solution:

[0035] The historical data acquisition module is used to read the system database and acquire historical electrocardiogram data from the system database;

[0036] The first vector conversion module is used to perform a first vector conversion operation on the historical electrocardiogram data according to the encoding model to obtain a historical time-series embedding vector.

[0037] The initial text embedding vector calculation module is used to construct an initial text prototype and calculate the initial text embedding vector of the initial text prototype based on the contrastive learning function and the historical temporal embedding vector.

[0038] The loss function construction module is used to construct the model loss function based on the historical time-series embedding vector and the initial text embedding vector.

[0039] The model training module is used to perform model training operations on the text prototype according to the model loss function to obtain the target text prototype.

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

[0041] The second vector conversion module is used to perform a second vector conversion operation on the electrocardiogram data to be analyzed according to the loss coding model to obtain the time series embedding vector to be analyzed.

[0042] The time series analysis module is used to input the time series embedding vector to be analyzed into the target text prototype for anomaly identification operation, and obtain anomaly identification results;

[0043] The result output module is used to output the anomaly identification result to the user terminal.

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

[0045] The segmentation module is used to segment the historical electrocardiogram data according to the time series segmentation algorithm to obtain historical electrocardiogram segments;

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

[0047] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution:

[0048] The device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the abnormality identification method applied to electrocardiograms as described above.

[0049] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below:

[0050] The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the abnormality identification method applied to electrocardiograms as described above.

[0051] This application provides an anomaly recognition method for electrocardiograms (ECGs), comprising: reading a system database to obtain historical ECG data; performing a first vector transformation operation on the historical ECG data according to an encoding model to obtain a historical temporal embedding vector; constructing an initial text prototype and calculating an initial text embedding vector of the initial text prototype based on a contrastive learning function and the historical temporal embedding vector; constructing a model loss function based on the historical temporal 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 ECG data to be analyzed sent by a user terminal; performing a second vector transformation operation on the ECG data to be analyzed according to a loss encoding model to obtain a temporal embedding vector to be analyzed; inputting the temporal embedding vector to be analyzed into the target text prototype for anomaly recognition to obtain an anomaly recognition result; and outputting the anomaly recognition result to the user terminal. Compared with the prior art, this application, by establishing a text prototype, aligns the temporal embedding space to the text embedding space, enabling large language models to understand temporal data, thereby distinguishing between normal and abnormal ECGs and significantly improving the prediction accuracy of heart diseases. Attached Figure Description

[0052] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0053] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;

[0054] Figure 2 This is a flowchart illustrating the implementation of the abnormality identification method for electrocardiograms provided in the embodiments of this application;

[0055] Figure 3 This is a schematic diagram of the structure of the abnormality recognition device for electrocardiogram provided in the embodiments of this application;

[0056] Figure 4 This is a schematic diagram of the structure of one embodiment of the computer device according to this application. Detailed Implementation

[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.

[0058] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

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

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

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

[0062] Terminal device 101 can be various electronic devices with a display screen and support web browsing. In addition to laptops 1011, tablets 1012, or mobile phones 1013, terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer, and a desktop computer, etc.

[0063] Server 103 can be a server that provides various services, such as a backend server that provides support for the pages displayed on terminal device 101.

[0064] It should be noted that the abnormal identification method for electrocardiograms provided in this application embodiment is generally executed by a server / terminal device, and correspondingly, the abnormal identification device for electrocardiograms is generally set in the server / terminal device.

[0065] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0066] Continue to refer to Figure 2 The diagram shows a flowchart of an embodiment of the abnormality identification method for electrocardiograms according to this application. The abnormality identification method for electrocardiograms includes steps S201, S202, S203, S204, S205, S206, S207, S208, and S209.

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

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

[0069]

[0070] Where X i This 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 time duration.

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

[0074] In this embodiment, an encoding model (such as a convolutional neural network, a recurrent neural network, or a Transformer) is used to convert electrocardiogram (ECG) data from its original format into vector form. These vectors (historical temporal embedding vectors) capture the temporal characteristics of the ECG data, facilitating subsequent processing.

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

[0076] In this embodiment, a contrastive learning function (a method commonly used to learn the similarity or difference between data) is used to compute the embedding vectors between these vectors and the initial text prototype.

[0077] In this embodiment, the purpose is to align time-series data with the data in this paper. Therefore, a text prototype needs to be established. This text space will use descriptive terms from the time-series data domain, such as: high, low, upward, downward, stable, and fluctuating. However, manually labeling these terms would be very labor-intensive. Therefore, this paper uses contrastive learning to find the original model vector tp, as shown below:

[0078]

[0079] Among them, f triplet (·) represents the triplet loss function, e k This represents the historical embedding vector. This represents the embedding vector of the historical positive samples. tp 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 this embodiment, the loss function is a key metric used to evaluate model performance during training. Here, a loss function is constructed based on the difference between the temporal embedding vector of historical electrocardiogram data and the initial text embedding vector to guide the optimization direction of the model.

[0082] In this embodiment, the similarity calculation formula between text embedding and temporal embedding is expressed as sim(tp,e) k To align the data from the two modalities, the final loss function is as follows:

[0083]

[0084] Wherein, sim(tp,e k ) represents the similarity calculation formula between the historical embedding vector and the initial text embedding vector, L fea This represents the contrastive learning function.

[0085] In step S205, the text prototype is trained according to the model loss function to obtain the target text prototype.

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

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

[0088] In step S207, a second vector transformation operation is performed on the ECG data to be analyzed according to the loss coding model to obtain the 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 the anomaly recognition result.

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

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

[0092] This application provides an anomaly recognition method for electrocardiograms (ECGs), comprising: reading a system database to obtain historical ECG data; performing a first vector transformation operation on the historical ECG data according to an encoding model to obtain historical temporal embedding vectors; constructing an initial text prototype and calculating an initial text embedding vector of the initial text prototype based on a contrastive learning function and the historical temporal embedding vectors; constructing a model loss function based on the historical temporal embedding vectors and the initial text embedding vectors; performing a model training operation on the text prototype based on the model loss function to obtain a target text prototype; receiving ECG data to be analyzed sent by a user terminal; performing a second vector transformation operation on the ECG data to be analyzed according to a loss encoding model to obtain a temporal embedding vector to be analyzed; inputting the temporal embedding vector to be analyzed into the target text prototype for anomaly recognition to obtain an anomaly recognition result; and outputting the anomaly recognition result to the user terminal. Compared with the prior art, this application, by establishing a text prototype, aligns the temporal embedding space to the text embedding space, enabling large language models to understand temporal data, thereby distinguishing between normal and abnormal ECGs and significantly improving the prediction accuracy of heart diseases.

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

[0094] The historical electrocardiogram (ECG) data were segmented using a time-series segmentation algorithm to obtain historical ECG image segments.

[0095] Historical electrocardiogram (ECG) image segments are input into the encoding model for vector transformation to obtain historical time-series embedding vectors.

[0096] In this embodiment of the application, the i-th sample X is... i Divide into K segments, as shown below:

[0097]

[0098] Where Seg(·) represents the segmentation function, which uses a uniform segmentation method to divide each time series data into K segments, where s k This represents the k-th segment.

[0099] In some optional implementations of the embodiments of this application, after the step of reading the system database and obtaining historical electrocardiogram data from the system database, and before the step of performing a first vector transformation operation on the historical electrocardiogram data according to the encoding model to obtain the historical time-series embedding vector, the following steps are further 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] Based on clustering analysis and time-series pattern feature set, historical electrocardiogram data are adaptively grouped to obtain historical electrocardiogram data with similar time-series patterns.

[0102] The steps involved in performing a first vector transformation operation on historical electrocardiogram data based on the encoding model to obtain historical time-series embedding vectors include the following:

[0103] Historical electrocardiogram data with similar temporal patterns are input into the encoding model for a third vector transformation operation to obtain historical temporal embedding vectors.

[0104] In this embodiment, time-series pattern mining refers to the technique of extracting frequently occurring or meaningful subsequences from time-series data. This time-series pattern mining algorithm can identify recurring typical waveforms or rhythmic features in historical electrocardiogram data.

[0105] In this embodiment, the automatic extraction and learning process automatically traverses the historical electrocardiogram dataset, identifying and recording all typical time-series patterns. These patterns represent normal electrocardiogram characteristics as well as certain pathological features.

[0106] In this embodiment, a feature set containing all identified temporal patterns is generated. This set provides the foundation for subsequent clustering analysis and coding models.

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

[0108] In this embodiment of the application, during electrocardiogram (ECG) data analysis, clustering analysis groups historical ECG data based on a set of time-series pattern features. This process is adaptive, meaning that the grouping results are adjusted and optimized according to the actual situation of the data.

[0109] In this embodiment, cluster analysis allows us to obtain multiple sets of historical electrocardiogram (ECG) data with similar temporal patterns. These data sets contain similar ECG waveforms or rhythm characteristics, facilitating subsequent analysis and processing.

[0110] In this embodiment, the encoding model is used to extract deep features from electrocardiogram data.

[0111] In this embodiment, multiple techniques such as time-series pattern mining, cluster analysis, and vector transformation are combined to achieve in-depth analysis and feature extraction of historical electrocardiogram data.

[0112] In some optional implementations of the embodiments of this application, the aforementioned 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:

[0113] Data augmentation is performed on historical ECG image segments to obtain historical positive sample ECG image segments and historical negative sample ECG image segments.

[0114] The steps involved in inputting historical electrocardiogram (ECG) image segments into the encoding model for vector transformation to obtain historical temporal embedding vectors include the following:

[0115] Historical ECG image segments, historical positive sample ECG image segments, and historical negative sample ECG image segments are respectively input into the encoding model for vector transformation operation to obtain historical embedding vector, historical positive sample embedding vector, and historical negative sample embedding vector.

[0116] In the embodiments of this application, for each fragment s k Data augmentation is needed to obtain a corresponding positive sample. Then, select one fragment from the remaining fragments as a negative sample.

[0117] In this embodiment of the application, each segment is converted into an embedding vector, mathematically represented as follows: This conversion process requires the use of an encoding model, represented as follows:

[0118] e k =Encoder(s k )

[0119]

[0120] Where Encoder(·) represents the encoding model, e k This represents the embedding vector of the k-th segment. This represents the embedding vector of the positive sample in the k-th segment. This represents the embedding vector of the negative sample of the k-th segment.

[0121] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0122] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0123] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When executed, the program can include the processes of the embodiments of the above methods. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).

[0124] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0125] Further reference Figure 3 As a response to the above Figure 2 The implementation of the method shown in this application provides an embodiment of an abnormality recognition device for electrocardiograms, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0126] like Figure 3 As shown, the abnormality recognition device 200 applied to electrocardiogram according to an embodiment of this application includes:

[0127] The historical data acquisition module 210 is used to read the system database and obtain historical electrocardiogram data from the system database.

[0128] The first vector conversion module 220 is used to perform a first vector conversion operation on historical electrocardiogram data according to the encoding model to obtain historical time-series embedding vectors.

[0129] The initial text embedding vector calculation module 230 is used to construct the initial text prototype and calculate the initial text embedding vector of the initial text prototype based on the contrastive learning function and the historical time-series embedding vector.

[0130] Loss function construction module 240 is used to construct the model loss function based on historical temporal embedding vectors and initial text embedding vectors;

[0131] The model training module 250 is used to perform model training operations on the text prototype according to the model loss function to obtain the target text prototype.

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

[0133] The 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, so as to obtain the time series embedding vector to be analyzed.

[0134] The time series analysis module 280 is used to input the embedded vector of the time series to be analyzed into the target text prototype for anomaly recognition operation and obtain anomaly recognition results.

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

[0136] In this embodiment, an abnormality recognition device 200 for electrocardiograms is provided, comprising: a historical data acquisition module 210 for reading a system database and acquiring historical electrocardiogram data from the system database; a first vector conversion module 220 for performing a first vector conversion operation on the historical electrocardiogram data according to an encoding model to obtain a historical temporal embedding vector; an initial text embedding vector calculation module 230 for constructing an initial text prototype and calculating the initial text embedding vector of the initial text prototype according to a contrastive learning function and the historical temporal embedding vector; and a loss function construction module 240 for constructing a loss function based on the historical temporal embedding vector and the initial text embedding vector. The system comprises the following modules: an input vector constructs a model loss function; a model training module 250 trains the text prototype according to the model loss function to obtain the target text prototype; a data acquisition module 260 receives the ECG data to be analyzed sent by the user terminal; a second vector conversion module 270 performs a second vector conversion operation on the ECG data to be analyzed according to the loss coding model to obtain the time-series embedding vector to be analyzed; a time-series analysis module 280 inputs the time-series embedding vector to be analyzed into the target text prototype for anomaly recognition to obtain the anomaly recognition result; and a result output module 290 outputs the anomaly recognition result to the user terminal. Compared with existing technologies, this application establishes a text prototype and aligns the time-series embedding space to the text embedding space, enabling large language models to understand time-series data and thus distinguish between normal and abnormal ECGs, significantly improving the prediction accuracy of heart diseases.

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

[0138] The segmentation module is used to segment historical electrocardiogram data according to the time series segmentation algorithm to obtain historical electrocardiogram image segments.

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

[0140] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 4 , Figure 4 This is a basic structural block diagram of a computer device according to an embodiment of this application.

[0141] The computer device 300 includes a memory 310, a processor 320, and a network interface 330 that are interconnected via a system bus. It should be noted that only the computer device 300 with components 310-330 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing 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 (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0142] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.

[0143] The memory 310 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), 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 may be an internal storage unit of the computer device 300, such as the hard disk or memory of the computer device 300. In other embodiments, the memory 310 may also be an external storage device of the computer device 300, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. Of course, the memory 310 may also include both internal storage units and external storage devices of the computer device 300. In this embodiment, the memory 310 is typically used to store the operating system and various application software installed on the computer device 300, such as computer-readable instructions for an abnormality detection method applied to electrocardiograms. Furthermore, the memory 310 can also be used to temporarily store various types of data that have been output or will be output.

[0144] In some embodiments, the processor 320 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 320 is typically used to control the overall operation of the computer device 300. In this embodiment, the processor 320 is used to execute computer-readable instructions stored in the memory 310 or to process data, for example, to execute computer-readable instructions for the abnormality detection method applied to electrocardiograms.

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

[0146] The computer device provided in this application aligns the temporal embedding space to the text embedding space by establishing a text prototype, so that a large language model can understand the temporal data and thus distinguish between normal and abnormal electrocardiograms, thereby significantly improving the prediction accuracy of heart diseases.

[0147] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor to cause the at least one processor to perform the steps of the above-described method for abnormal identification of electrocardiograms.

[0148] The computer-readable storage medium provided in this application aligns the temporal embedding space to the text embedding space by establishing a text prototype, so that large language models can understand temporal data and thus distinguish between normal and abnormal electrocardiograms, thereby significantly improving the prediction accuracy of heart diseases.

[0149] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0150] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.

Claims

1. A method for abnormal identification applied to electrocardiograms, characterized in that, Includes the following steps: Read the system database and retrieve historical electrocardiogram data from the system database; The time-series pattern mining algorithm is used to automatically extract and learn typical time-series patterns in the historical electrocardiogram data to obtain a time-series pattern feature set. The historical electrocardiogram data are adaptively grouped according to the clustering analysis method and the time series pattern feature set to obtain historical electrocardiogram data with similar time series patterns. The historical electrocardiogram data with similar temporal patterns are respectively input into the encoding model for vector transformation to obtain historical temporal embedding vectors, wherein the historical temporal embedding vectors include historical embedding vectors, historical positive sample embedding vectors, and historical negative sample embedding vectors. An initial text prototype is constructed, and an initial text embedding vector is calculated based on the contrastive learning function and the historical time-series embedding vector. The initial text prototype is a descriptive term in the time-series data domain, including terms such as high, low, upward, downward, stable, and fluctuating. The initial text embedding vector refers to the original model vector obtained by learning the historical time-series embedding vector through the contrastive learning function. The contrastive learning function Represented as: in, Represents the triplet loss function. This represents the historical embedding vector. This represents the embedding vector of the historical positive samples. This represents the historical negative sample embedding vector. This represents the initial text embedding vector; The model loss function is constructed based on the historical time-series embedding vector and the initial text embedding vector. The target text prototype is obtained by training the model based on the model loss function. Receive electrocardiogram data to be analyzed sent by the user terminal; The second vector transformation operation is performed on the electrocardiogram data to be analyzed according to the loss coding model to obtain the time series embedding vector to be analyzed. The time series embedding vector to be analyzed is input into the target text prototype to perform an anomaly identification operation, and the anomaly identification result is obtained. The anomaly identification result is output to the user terminal.

2. The abnormality identification method applied to electrocardiogram according to claim 1, characterized in that, The step of inputting the historical electrocardiogram data with similar temporal patterns into the encoding model for vector transformation to obtain historical temporal embedding vectors specifically includes the following steps: The historical electrocardiogram data with similar time-series patterns are segmented according to the time-series segmentation algorithm to obtain historical electrocardiogram segments. The historical electrocardiogram segments are input into the encoding model for vector conversion to obtain the historical time-series embedding vector.

3. The abnormality identification 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 step is also included: Data augmentation is performed on the historical ECG image segments to obtain historical positive sample ECG image segments and historical negative sample ECG image segments. The step of inputting the historical electrocardiogram segments into the encoding model for vector transformation to obtain the historical time-series embedding vector specifically includes the following steps: The historical ECG image segments, the historical positive sample ECG image segments, and the historical negative sample ECG image segments are respectively input into the encoding model for vector transformation operation to obtain the historical embedding vector, the historical positive sample embedding vector, and the historical negative sample embedding vector.

4. The abnormality identification method applied to electrocardiogram according to claim 1, characterized in that, The model loss function Represented as: in, This represents the formula for calculating the similarity between the historical embedding vector and the initial text embedding vector. This represents the contrastive learning function.

5. An abnormality detection device for electrocardiograms, characterized in that, include: The historical data acquisition module is used to read the system database and acquire historical electrocardiogram data from the system database; The first vector conversion module is used to automatically extract and learn typical time-series patterns in the historical electrocardiogram data using a time-series pattern mining algorithm, and obtain a time-series pattern feature set. The first vector conversion module is further configured to adaptively group the historical electrocardiogram data according to the clustering analysis method and the time series pattern feature set to obtain historical electrocardiogram data with similar time series patterns. The first vector conversion module is further configured to input the historical electrocardiogram data with similar temporal patterns into the encoding model for vector conversion operations to obtain historical temporal embedding vectors, wherein the historical temporal embedding vectors include historical embedding vectors, historical positive sample embedding vectors, and historical negative sample embedding vectors. The initial text embedding vector calculation module is used to construct an initial text prototype and calculate the initial text embedding vector of the initial text prototype based on the contrastive learning function and the historical time-series embedding vector. The initial text prototype is a descriptive term in the time-series data domain, including terms such as high, low, upward, downward, stationary, and fluctuating. The initial text embedding vector refers to the original model vector obtained by learning the historical time-series embedding vector through the contrastive learning function. The contrastive learning function Represented as: in, Represents the triplet loss function. This represents the historical embedding vector. This represents the embedding vector of the historical positive samples. This represents the historical negative sample embedding vector. This represents the initial text embedding vector; The loss function construction module is used to construct the model loss function based on the historical time-series embedding vector and the initial text embedding vector. The model training module is used to perform model training operations on the text prototype according to the model loss function to obtain the target text prototype. The data acquisition module is used to receive electrocardiogram data to be analyzed sent by the user terminal; The second vector conversion module is used to perform a second vector conversion operation on the electrocardiogram data to be analyzed according to the loss coding model to obtain the time series embedding vector to be analyzed. The time series analysis module is used to input the time series embedding vector to be analyzed into the target text prototype for anomaly identification operation, and obtain anomaly identification results; The result output module is used to output the anomaly identification result to the user terminal.

6. The abnormality identification device for electrocardiogram according to claim 5, characterized in that, The first vector conversion module includes: The segmentation module is used to segment the historical electrocardiogram data with similar time patterns according to the time series segmentation algorithm to obtain historical electrocardiogram segments. The first vector conversion submodule is used to input the historical electrocardiogram segments into the encoding model for vector conversion operations to obtain the historical time-series embedding vector.

7. 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, it implements the steps of the abnormal identification method for electrocardiograms as described in any one of claims 1 to 4.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the abnormality identification method for electrocardiograms as described in any one of claims 1 to 4.