Method and system for constructing small sample electrocardiosignal recognition model based on Shaplet
Through shapelet analysis and small sample learning methods, combined with attention mechanism, a small sample ECG signal recognition model is constructed, which solves the problem of low accuracy in small sample data processing in the existing technology, and improves the accuracy of ECG signal recognition and the generalization ability of the model.
Patent Information
- Application Number
- CN202411870587.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-18
AI Technical Summary
Existing ECG signal processing technology has low accuracy when processing small sample data. Deep learning algorithms require a large number of samples for training, making it difficult to effectively apply in the field of medical signals.
The shapelet analysis method is used to identify and extract local patterns from the characteristic data set of the ECG signal, and a small sample learning method and attention mechanism are combined to construct a small sample ECG signal recognition model.
The local characteristics and attention mechanism weighting of the ECG signal are extracted through shapelet, which improves the accuracy of the recognition of ECG signal in small samples and the generalization ability of the model, and avoids overfitting.
Smart Images

Figure CN119700134A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of the combination of computer and biomedical processing, and in particular to a method and system for constructing a small sample electrocardiogram signal recognition model based on shapelet. Background Art
[0002] Electrocardiogram (ECG) signal processing technology is a key technology in medical diagnosis. It assists in the diagnosis and treatment of heart diseases by recording and analyzing the electrical activity of the heart. The acquisition and analysis of ECG signals are very important for understanding heart function and diagnosing heart diseases. However, existing ECG signal processing technology has some defects and shortcomings.
[0003] Traditional ECG signal processing treats ECG signals as time series data. Time series classification methods include dynamic time wrapping (DTW), Fourier transform, and principal component analysis (PCA). These methods have certain effects in processing time series data, but they also have some limitations, such as high computational complexity and sensitivity to data deformation.
[0004] To address this problem, deep learning algorithms are currently being used to process ECG signals. Although deep learning algorithms have the advantage of high accuracy in the field of ECG classification, they usually require a large number of samples for training. However, in the field of medical signals, it is difficult to obtain a large number of labeled samples, which limits the performance of deep learning algorithms. Summary of the invention
[0005] The present invention aims to solve one of the technical problems existing in the related art at least to a certain extent.
[0006] One object of the present invention is to provide a method for constructing a small sample ECG signal recognition model based on shapelet, combining shapelet and small sample learning method to construct an ECG signal recognition model for small samples, thereby improving the accuracy of ECG signal recognition when the number of samples is limited.
[0007] Another object of the present invention is to provide a system for constructing a small sample electrocardiogram signal recognition model based on shapelet.
[0008] In order to achieve the above-mentioned object, the present invention provides a method for constructing a small sample electrocardiogram signal recognition model based on shapelet, comprising:
[0009] S100, collecting ECG signals, preprocessing the ECG signals, extracting features of time series data, and forming a feature data set;
[0010] S200, using shapelet analysis method to identify and extract representative local patterns from feature data sets to form pattern bags;
[0011] S300, apply the attention mechanism to weight the local features in the pattern bag to highlight the key features;
[0012] S400, training a small sample ECG recognition model based on features in the pattern bag, and using the model to recognize and classify ECG signals.
[0013] A further preferred technical solution of the present invention is that step S100 collects ECG signals, pre-processes the ECG signals, extracts features of time series data, and forms a feature data set, including:
[0014] S110, performing segment processing on each lead of the electrocardiogram signal;
[0015] S120, extracting statistical features and frequency domain features from each segment of the ECG signal to form a feature data set.
[0016] Preferably, the step S200 uses the shapelet analysis method to identify and extract representative local patterns from the feature data set to form a pattern bag, including:
[0017] S210, performing shapelet analysis on the features of the ECG signal of each lead, identifying and extracting local features, and obtaining a number of shapelets representing local features of the time series data of the lead;
[0018] S220, calculating the weight of each shapelet, and selecting one or more shapelets with the highest weight;
[0019] S230 , repeating steps S210 - S220 , and using the selected shapelets to form a pattern bag representing the key features of the ECG signal of the lead.
[0020] Preferably, the weight calculation formula of the shapelet in step S220 is:
[0021]
[0022] Among them, W j is the weight of the j-th shapelet; f j is the feature importance score of the shapelet; f k is the feature importance score of the kth shapelet; α is an adjustable parameter that controls the concentration of the weight distribution; N is the total number of shapelets in the pattern bag.
[0023] Preferably, the step S300 of applying the attention mechanism to weight the local features in the pattern bag to highlight the key features includes:
[0024] S310, introducing an attention mechanism to perform attention weighting on the ECG signal features of each lead;
[0025] S320: Update the ECG signal features of the corresponding lead using the weighted features.
[0026] Preferably, the calculation formula for attention weighting in step S310 is:
[0027]
[0028] Among them, a j is the attention weight of the jth feature; g j is the local importance score of the feature; g k is the local importance score of the kth feature; β is an adjustable parameter that controls the concentration of the weight distribution; M is the total number of features considered.
[0029] Preferably, the step S400 of training a small sample ECG recognition model based on the features in the pattern bag and identifying and classifying the ECG signal by using the model includes:
[0030] The small sample ECG recognition model is trained with the updated ECG signal features, and the hyperparameters are adjusted through the validation set and test set in the feature dataset to evaluate the generalization ability of the model.
[0031] Another aspect of the present invention provides a system for constructing a small sample electrocardiogram signal recognition model based on shapelet, comprising:
[0032] The data acquisition module is used to collect ECG signals, pre-process the ECG signals, extract the features of time series data, and form a feature data set;
[0033] The local feature extraction module is used to identify and extract representative local patterns from the feature data set using the shapelet analysis method to form a pattern bag;
[0034] The data weighting calculation module is used to apply the attention mechanism to weight the local features in the pattern bag and highlight the key features;
[0035] The model building module is used to train a small sample ECG recognition model based on the features in the pattern bag to obtain a trained ECG recognition model.
[0036] Preferably, the data acquisition module collects ECG signals, preprocesses the ECG signals, extracts features of time series data, and forms a feature data set. The specific method includes:
[0037] S110, performing segment processing on each lead of the electrocardiogram signal;
[0038] S120, extracting statistical features and frequency domain features from each segment of the ECG signal to form a feature data set.
[0039] Preferably, the local feature extraction module uses a shapelet analysis method to identify and extract representative local patterns from the feature data set to form a pattern bag. The specific method includes:
[0040] S210, performing shapelet analysis on the features of the ECG signal of each lead, identifying and extracting local features, and obtaining a number of shapelets representing local features of the time series data of the lead;
[0041] S220, calculating the weight of each shapelet, and selecting one or more shapelets with the highest weight;
[0042] S230 , repeating steps S210 - S220 , and using the selected shapelets to form a pattern bag representing the key features of the ECG signal of the lead.
[0043] As a preference, the weight calculation formula of shapelet is:
[0044]
[0045] Among them, W j is the weight of the j-th shapelet; f j is the feature importance score of the shapelet; f k is the feature importance score of the kth shapelet; α is an adjustable parameter that controls the concentration of the weight distribution; N is the total number of shapelets in the pattern bag.
[0046] Preferably, the data weighted calculation module uses an attention mechanism to weight the local features in the pattern bag to highlight the key features. The specific method includes:
[0047] S310, introducing an attention mechanism to perform attention weighting on the ECG signal features of each lead;
[0048] S320: Update the ECG signal features of the corresponding lead using the weighted features.
[0049] As a preferred method, the calculation formula of attention weighting is:
[0050]
[0051] Among them, aj is the attention weight of the jth feature; g j is the local importance score of the feature; g k is the local importance score of the kth feature; β is an adjustable parameter that controls the concentration of the weight distribution; M is the total number of features considered.
[0052] Preferably, the model building module trains a small sample ECG recognition model based on the features in the pattern bag, and uses the model to identify and classify ECG signals. The specific method is:
[0053] The small sample ECG recognition model is trained with the updated ECG signal features, and the hyperparameters are adjusted through the validation set and test set in the feature dataset to evaluate the generalization ability of the model.
[0054] Another aspect of the present invention provides a non-transitory computer-readable storage medium having computer instructions stored thereon, which enable a computer to execute the above-mentioned method for constructing a small sample electrocardiogram signal recognition model based on shapelet.
[0055] Another aspect of the present invention provides an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus, and the processor calls the logic instructions in the memory to execute the above-mentioned method for constructing a small sample electrocardiogram signal recognition model based on shapelet.
[0056] On the other hand, the present invention provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer executes the above-mentioned method for constructing a small sample electrocardiogram signal recognition model based on shapelet.
[0057] Beneficial effects: (1) The present invention extracts local features of ECG signals through shapelet analysis method, defines shapelet as the local feature representation of time series data, and can capture local patterns in ECG signals, which is helpful to construct pattern bags. By identifying and extracting local features and calculating the weight of each shapelet, shapelets are sorted according to the weights, and shapelets with the highest weights are selected to form pattern bags to represent the key features of ECG signals;
[0058] (2) The present invention further enhances the ability to capture local features of ECG signals by using the attention mechanism, which is used to highlight the key local features in ECG signals. By weighting the ECG signal features of each lead, the model can pay more attention to the key local features in the ECG signals, thereby improving the recognition accuracy.
[0059] (3) The ECG signal recognition model constructed by the present invention is trained with small sample data, and multiple pattern bags are mined for the same disease, thereby improving the generalization ability of the model and avoiding overfitting. The diagnostic accuracy of the model is improved through continuous parameter adjustment and structural optimization. The performance of the ECG signal recognition model is further improved by weighted fusion of features from different leads. Features from different leads are weightedly fused based on the importance of the features or the signal quality of the leads, so that the fused features have richer information and can better capture the complexity of the ECG signals. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 The figure is a flow chart of a method for constructing a small sample electrocardiogram signal recognition model based on shapelet according to the present invention. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments, and they should not be understood as limitations on the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. In the description of the present invention, it should be understood that the terms used are only for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0062] Combine the following Figure 1 The present invention describes a method and system for constructing a small sample electrocardiogram signal recognition model based on shapelet.
[0063] Before describing the technical solution of the present invention in detail, the technology involved in the present invention is first described.
[0064] The technical problem faced by the present invention is that the construction of deep learning models usually requires a large number of samples for training. However, in the field of medical signals, it is difficult to obtain a large number of labeled samples, which makes model construction difficult and the model prediction accuracy is low.
[0065] Based on this, the present invention provides a method and system for constructing a small sample ECG signal recognition model based on shapelet, and applies algorithms such as shapelet, small sample learning, and attention mechanism.
[0066] Among them, Shapelet is a technology used for time series data mining and analysis, especially in time series classification tasks. The core idea of Shapelet technology is to extract subsequences (shapelets) of different lengths from the original time series, and use Euclidean distance, DTW distance, etc. to calculate the similarity between the time series. Shapelets with higher discrimination ability are selected as features, and classification models such as decision trees, random forests, and support vector machines are constructed using the selected shapelets. The advantage of Shapelet technology is that it can greatly reduce the calculation time and improve the classification efficiency by extracting subsequences. Shapelet technology has been applied in many fields, including assisting disease diagnosis by analyzing medical signals such as electrocardiograms and electroencephalograms. In general, Shapelet technology provides an effective method for the classification and pattern recognition of time series data by extracting the most representative subsequences, and has broad application prospects and research value.
[0067] Few-Shot Learning (FSL) is also an important research direction in the field of machine learning, which aims to use very small amounts of training data for effective learning and prediction. This technology is critical for many application scenarios, such as medical image analysis, rare language processing, and any field where it is expensive to obtain labeled data. Traditional machine learning methods usually rely on a large amount of labeled data to train models. These methods perform well on large data sets, but performance often drops significantly when data is scarce. The study of few-shot learning is precisely to meet the above challenges. In order to train effective models when data is scarce, its goal is to enable the model to learn and generalize quickly with a small number of samples. Few-shot learning methods can be roughly divided into the following categories: 1. Data enhancement-based methods: Generate more training samples by transforming existing data (such as rotation, scaling, flipping, etc.). 2. Prior knowledge-based methods: A framework for learning how to learn, which enables it to quickly adapt to new tasks by training a meta-model. 3. Model design-based methods: By introducing an attention mechanism, the model can focus on the key features of a small number of samples.
[0068] Attention Mechanism is a technology that has made important progress in the field of deep learning in recent years, especially in the fields of natural language processing (NLP) and computer vision. When processing input information, the model can selectively focus on the most relevant parts of the current task and ignore other irrelevant or minor information. The core idea of the attention mechanism is to calculate a set of attention weights, which represent the importance of each element in the input sequence to the current task. The basic attention mechanism can be divided into the following steps: 1. Calculate the similarity score: Calculate the similarity score between each element in the input sequence and the current query. Common methods include dot product, additive attention, etc. 2. Normalize the score: Use the softmax function to normalize the similarity score to a probability distribution. These normalized scores are called attention weights. 3. Weighted summation: Use the attention weights to perform a weighted summation on the input sequence to obtain a new representation, which is the output of the attention operation. The Transformer model is a major breakthrough in the attention mechanism. It completely abandons the RNN structure and relies on the self-attention mechanism to capture the dependencies in the sequence. The Transformer model not only solves the problem of long-distance dependency, but also greatly improves computing efficiency and makes parallel computing possible.
[0069] The present invention combines shapelet technology and small sample learning technology. For the same disease, key features extracted by shapelet form multiple representative pattern bags, and the generalization ability of the small sample ECG disease determination method is improved by expanding the small sample ECG data set.
[0070] Embodiment 1: This embodiment provides a method for constructing a small sample ECG signal recognition model based on shapelet, such as Figure 1 As shown, including:
[0071] S100, collecting ECG signals, preprocessing the ECG signals, extracting features of time series data, and forming a feature data set; including:
[0072] S110, performing segment processing on each lead of the electrocardiogram signal;
[0073] S120, extracting statistical features and frequency domain features from each segment of the ECG signal to form a feature data set.
[0074] S200, define shapelet as a local feature representation of time series data, which can capture local patterns in ECG signals. Use shapelet analysis method to identify and extract representative local patterns from feature data sets to form pattern bags; including:
[0075] S210, performing shapelet analysis on the features of the ECG signal of each lead, identifying and extracting local features, and obtaining a number of shapelets representing local features of the time series data of the lead;
[0076] S220, calculate the weight of each shapelet, the shapelet weight calculation formula is:
[0077]
[0078] Among them, W j is the weight of the j-th shapelet; f j is the feature importance score of the shapelet; f k is the feature importance score of the kth shapelet; α is an adjustable parameter that controls the concentration of the weight distribution; N is the total number of shapelets in the pattern bag;
[0079] S230, sorting the shapelets according to the weights, and selecting the shapelets with the highest weights to form a pattern bag to represent the key features of the ECG signal of the lead;
[0080] S240, repeating steps S210-S230, and using the selected shapelets to form a pattern bag representing the key features of the ECG signal of the lead. Mining representative pattern bags, and improving the generalization ability of small sample methods by expanding small sample data sets.
[0081] S300, define the attention mechanism as a dynamic weighting method for highlighting key local features in the ECG signal. Apply the attention mechanism to weight the local features in the pattern bag, and the specific method includes:
[0082] S310, introducing an attention mechanism to perform attention weighting on the ECG signal features of each lead; the calculation formula for attention weighting is:
[0083]
[0084] Among them, a j is the attention weight of the jth feature; g j is the local importance score of the feature; g k is the local importance score of the kth feature; β is an adjustable parameter that controls the concentration of the weight distribution; M is the total number of features considered;
[0085] S320, updating the ECG signal features of the corresponding lead with the weighted features to enhance the sensitivity of the model to key local features.
[0086] S400, using the updated ECG signal features, train a small sample ECG recognition model, and adjust hyperparameters through the validation set and test set in the feature data set to evaluate the generalization ability of the model.
[0087] Embodiment 2: A system for constructing a small sample electrocardiogram signal recognition model based on shapelet, comprising:
[0088] The data acquisition module is used to collect ECG signals, pre-process the ECG signals, extract the features of time series data, and form a feature data set;
[0089] The local feature extraction module is used to identify and extract representative local patterns from the feature data set using the shapelet analysis method to form a pattern bag;
[0090] The data weighting calculation module is used to apply the attention mechanism to weight the local features in the pattern bag and highlight the key features;
[0091] The model building module is used to train a small sample ECG recognition model based on the features in the pattern bag to obtain a trained ECG recognition model.
[0092] The data acquisition module is specifically used for:
[0093] (1) Segment processing of each lead of the ECG signal;
[0094] (2) Extract statistical features and frequency domain features from each ECG signal to form a feature data set.
[0095] The local feature extraction module is specifically used for:
[0096] (1) Perform shapelet analysis on the features of the ECG signal of each lead, identify and extract local features, and obtain several shapelets representing the local features of the time series data of the lead;
[0097] (2) Calculate the weight of each shapelet and select one or more shapelets with the highest weight. The weight calculation formula of shapelet is:
[0098]
[0099] Among them, W j is the weight of the j-th shapelet; f j is the feature importance score of the shapelet; f k is the feature importance score of the kth shapelet; α is an adjustable parameter that controls the concentration of the weight distribution; N is the total number of shapelets in the pattern bag.
[0100] (3) Repeat the local feature extraction to form a pattern bag that represents the key features of the ECG signal of the lead with the selected shapelets.
[0101] The data weighted calculation module is specifically used for:
[0102] (1) Introduce the attention mechanism to perform attention weighting on the ECG signal features of each lead; the calculation formula for attention weighting is:
[0103]
[0104] Among them, a j is the attention weight of the jth feature; g j is the local importance score of the feature; g k is the local importance score of the kth feature; β is an adjustable parameter that controls the concentration of the weight distribution; M is the total number of features considered.
[0105] (2) Update the ECG signal features of the corresponding lead using the weighted features.
[0106] The model building module is specifically used to:
[0107] The small sample ECG recognition model is trained with the updated ECG signal features, and the hyperparameters are adjusted through the validation set and test set in the feature dataset to evaluate the generalization ability of the model.
[0108] Embodiment 3: This embodiment provides a non-transitory computer-readable storage medium on which computer instructions are stored. The computer instructions enable a computer to execute a method for constructing a small sample electrocardiogram signal recognition model based on shapelet, the method comprising the following steps:
[0109] S100, collecting ECG signals, preprocessing the ECG signals, extracting features of time series data, and forming a feature data set;
[0110] S200, using shapelet analysis method to identify and extract representative local patterns from feature data sets to form pattern bags;
[0111] S300, apply the attention mechanism to weight the local features in the pattern bag to highlight the key features;
[0112] S400, training a small sample ECG recognition model based on features in the pattern bag, and using the model to recognize and classify ECG signals.
[0113] Embodiment 4: This embodiment provides an electronic device, which may include: a processor, a communications interface, a memory, and a communication bus, wherein the processor, the communications interface, and the memory communicate with each other via the communication bus. The processor may call the logic instructions in the memory to execute a method for constructing a small sample electrocardiogram signal recognition model based on shapelet, and the method includes the following steps:
[0114] S100, collecting ECG signals, preprocessing the ECG signals, extracting features of time series data, and forming a feature data set;
[0115] S200, using shapelet analysis method to identify and extract representative local patterns from feature data sets to form pattern bags;
[0116] S300, apply the attention mechanism to weight the local features in the pattern bag to highlight the key features;
[0117] S400, training a small sample ECG recognition model based on features in the pattern bag, and using the model to recognize and classify ECG signals.
[0118] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0119] Embodiment 5: This embodiment provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute a method for constructing a small sample electrocardiogram signal recognition model based on shapelet, which includes the following steps:
[0120] S100, collecting ECG signals, preprocessing the ECG signals, extracting features of time series data, and forming a feature data set;
[0121] S200, using shapelet analysis method to identify and extract representative local patterns from feature data sets to form pattern bags;
[0122] S300, apply the attention mechanism to weight the local features in the pattern bag to highlight the key features;
[0123] S400, training a small sample ECG recognition model based on features in the pattern bag, and using the model to recognize and classify ECG signals.
[0124] The present invention extracts local features of ECG signals through shapelet analysis method, defines shapelet as local feature representation of time series data, can capture local patterns in ECG signals, helps to build pattern bags, identifies and extracts local features, calculates the weight of each shapelet, sorts shapelets according to weights, selects shapelets with the highest weights to form pattern bags, and represents the key features of ECG signals. The present invention further enhances the ability to capture local features of ECG signals by using attention mechanism, and highlights key local features in ECG signals by weighting the ECG signal features of each lead. The ECG recognition model of the present invention is trained with small sample data, and uses cross-validation and other methods to evaluate the generalization ability of the model, avoids overfitting, and improves the generalization ability and diagnostic accuracy of the model.
[0125] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0126] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for constructing a small sample electrocardiogram signal recognition model based on shapelet, characterized in that: include: S100, collecting ECG signals, preprocessing the ECG signals, extracting features of time series data, and forming a feature data set; S200, using shapelet analysis method to identify and extract representative local patterns from feature data sets to form pattern bags; S300, apply the attention mechanism to weight the local features in the pattern bag to highlight the key features; S400, training a small sample ECG recognition model based on features in the pattern bag, and using the model to recognize and classify ECG signals.
2. The method for constructing a small sample ECG signal recognition model based on shapelet according to claim 1, characterized in that: Step S100 collects ECG signals, pre-processes the ECG signals, extracts features of time series data, and forms a feature data set, including: S110, performing segment processing on each lead of the electrocardiogram signal; S120, extracting statistical features and frequency domain features from each segment of the ECG signal to form a feature data set.
3. The method for constructing a small sample ECG signal recognition model based on shapelet according to claim 1, characterized in that: Step S200 uses the shapelet analysis method to identify and extract representative local patterns from the feature data set to form a pattern bag, including: S210, performing shapelet analysis on the features of the ECG signal of each lead, identifying and extracting local features, and obtaining a number of shapelets representing local features of the time series data of the lead; S220, calculating the weight of each shapelet, and selecting one or more shapelets with the highest weight; S230 , repeating steps S210 - S220 , and using the selected shapelets to form a pattern bag representing the key features of the ECG signal of the lead.
4. The method for constructing a small sample ECG signal recognition model based on shapelet according to claim 3, characterized in that: The weight calculation formula of shapelet in step S220 is: Among them, W j is the weight of the j-th shapelet; f j is the feature importance score of the shapelet; f k is the feature importance score of the kth shapelet; α is an adjustable parameter that controls the concentration of the weight distribution; N is the total number of shapelets in the pattern bag.
5. The method for constructing a small sample ECG signal recognition model based on shapelet according to claim 3, characterized in that: Step S300 uses the attention mechanism to weight the local features in the pattern bag to highlight the key features, including: S310, introducing an attention mechanism to perform attention weighting on the ECG signal features of each lead; S320: Update the ECG signal features of the corresponding lead using the weighted features.
6. The method for constructing a small sample ECG signal recognition model based on shapelet according to claim 5, characterized in that: The calculation formula for attention weighting in step S310 is: Among them, a j is the attention weight of the jth feature; g j is the local importance score of the feature; g k is the local importance score of the kth feature; β is an adjustable parameter that controls the concentration of the weight distribution; M is the total number of features considered.
7. The method for constructing a small sample ECG signal recognition model based on shapelet according to claim 5, characterized in that: The step S400 of training a small sample ECG recognition model based on the features in the pattern bag and using the model to recognize and classify ECG signals includes: The small sample ECG recognition model is trained with the updated ECG signal features, and the hyperparameters are adjusted through the validation set and test set in the feature dataset to evaluate the generalization ability of the model.
8. A system for constructing a small sample ECG signal recognition model based on shapelet, characterized in that: include: The data acquisition module is used to collect ECG signals, pre-process the ECG signals, extract the features of time series data, and form a feature data set; The local feature extraction module is used to identify and extract representative local patterns from the feature data set using the shapelet analysis method to form a pattern bag; The data weighting calculation module is used to apply the attention mechanism to weight the local features in the pattern bag and highlight the key features; The model building module is used to train a small sample ECG recognition model based on the features in the pattern bag to obtain a trained ECG recognition model.
9. A non-transitory computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions enable a computer to execute the method for constructing a small sample electrocardiogram signal recognition model based on shapelet according to any one of claims 1 to 7.
10. An electronic device, comprising: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus, and the processor calls the logic instructions in the memory to execute the method for constructing a small sample electrocardiogram signal recognition model based on shapelet as described in any one of claims 1-7.
Citation Information
Patent Citations
Arrhythmia classification method based on self-attention mechanism
CN115530788A
Multi-scale context-based multivariate time sequence signal analysis method
CN116244585A
CNN-GRU ECG signal classification method based on attention mechanism
CN119014878A
Electrocardiosignal open set identity recognition method based on hybrid network and cross attention mechanism
CN119128684A
Method for realizing a multi-channel convolutional recurrent neural network EEG emotion recognition model using transfer learning
US20230039900A1