A method for electrocardiogram multi-label classification oriented to long-tailed distribution
By converting physiological attributes into case text and combining them with dual-stream ECG encoding, and utilizing pre-trained language models and multi-head cross-attention fusion features, the classification bias problem of ECG data under extreme long-tail distributions is solved, achieving effective representation and classification decision optimization for multi-label ECG data.
Patent Information
- Application Number
- CN202611505579.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-24
- Publication Date
- 2026-11-27
AI Technical Summary
Existing technologies struggle to fully utilize patient physiological attribute information while maintaining effective representation of multi-lead ECG waveforms and reducing the bias caused by differences in the number of category samples when processing clinical multi-label ECG data with extremely long tail distributions.
The patient's physiological attributes are converted into case text. A pre-trained medical language model and mask-aware mean pooling are used to form a semantic prior for the text. The dual-stream encoding of global ECG sequences and trend ECG sequences is combined with feature fusion through multi-head cross-attention. A two-stage training method is used to optimize representation learning and classification decision-making respectively.
While preserving the details and trends of multi-lead ECG waveforms, this study fully utilizes patient physiological attribute information to reduce the bias of category sample quantity differences on classification decisions, thereby improving the identification and ranking capabilities of uncommon and rare categories in multi-label classification.
Smart Images

Figure CN123179237A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of medical artificial intelligence and biomedical signal processing technology, and in particular to a multi-label classification method for electrocardiograms oriented towards long-tailed distributions. Background Technology
[0002] Electrocardiogram (ECG) is an important physiological signal reflecting the electrical activity of the heart. With the ever-increasing scale of clinical ECG data, the automatic classification of multi-lead ECG signals using deep learning models has become a technique in ECG-assisted analysis. Actual clinical ECG data typically features multiple leads, long-term sequences, and multiple labels, and the number of samples varies significantly between different ECG categories. Common categories often have a large number of training samples, while some rare abnormalities have only a small number of samples. Therefore, ECG classification models also need to address the significant long-tailed data distribution.
[0003] Existing technologies include schemes using deep neural networks for multi-label, multi-lead ECG classification. For example, one scheme inputs 12-lead ECG signals into a multi-scale residual network, extracts ECG features using convolutional kernels of different scales, and incorporates channel attention and spatial attention mechanisms within the convolutional network to weight ECG information from different channels and locations. Multiple ECG categories are then output through fully connected layers. While these methods can improve ECG waveform classification by utilizing multi-scale features and attention mechanisms, their classification process primarily relies on the ECG waveform itself as a feature source, and the highly imbalanced number of category samples and the utilization of patient physiological attribute information are not their primary focus.
[0004] To address the long-tail distribution problem in electrocardiogram (ECG) data, existing technologies have proposed ECG long-tail classification methods based on anomaly detection pre-training. This approach preprocesses the ECG signal to form global and local ECG signals. Anomaly detection pre-training is performed using random masking, encoding, cross-recovery, and trend-assisted recovery. Report attributes such as age, gender, heart rate, PR interval, QT interval, and QRS interval are used for auxiliary learning. After pre-training, the parameters of the pre-trained model are fixed, and the obtained ECG features are input into a downstream long-tail classification network. Anomaly type classification is then performed using a loss function that differentiates between positive and negative multi-label samples. This approach can simultaneously utilize ECG waveforms, report attributes, and a self-supervised recovery task to improve long-tail classification.
[0005] However, patient attributes in real clinical ECG data exhibit significant medical semantic relationships. Simply using discrete attributes as auxiliary prediction targets is insufficient to fully represent the continuous clinical context formed by multiple physiological parameters. Furthermore, under extreme long-tail distribution conditions, if class resampling, complex classification loss, and low-level ECG feature learning continuously interact during the same training process, the long-tail correction process may interfere with the already formed ECG waveform representation. How to further utilize the medical semantic information contained in patient physiological attributes while preserving the details and trend information of the original multi-lead ECG waveform, and simultaneously coordinate the relationship between low-level representation learning and long-tail classification decision optimization, still requires further improvement.
[0006] Furthermore, existing technologies can also classify one-dimensional electrocardiogram (ECG) signals by converting them into two-dimensional images using visual networks, or directly incorporate language models into diagnostic result generation. However, the two-dimensional conversion process typically requires scaling or downsampling the data, which may affect local high-frequency morphological information in the original ECG waveform. When diagnostic text is generated directly from a generative language model, the generation process differs from the deterministic calculation of classification features. Therefore, while utilizing clinical semantic information, it is still necessary to balance the effective representation of the original multi-lead ECG signals with the stability of the classification output.
[0007] Therefore, how to fully utilize patient physiological attribute information while maintaining effective representation of multi-lead ECG waveforms under extremely long-tailed clinical multi-label ECG data conditions, and reduce the bias caused by differences in the number of category samples in classification decisions, has become an urgent technical problem to be solved. Summary of the Invention
[0008] The purpose of this invention is to provide a multi-label classification method for electrocardiograms oriented towards long-tailed distributions, so as to make full use of patients' physiological attribute information while maintaining effective representation of multi-lead electrocardiogram waveforms under the condition of extremely long-tailed clinical multi-label electrocardiogram data, and reduce the bias caused by the difference in the number of category samples on classification decisions.
[0009] To achieve the above objectives, this invention proposes a multi-label electrocardiogram classification method oriented towards long-tailed distributions, comprising: The 12-lead ECG waveform and physiological attributes are obtained. The physiological attributes are converted into case text according to the clinical context template. The text is encoded by a pre-trained medical language model. The hidden features of effective clinical information blocks are weighted and aggregated using mask-aware mean pooling to obtain the text semantic prior. A global ECG sequence is formed using the 12-lead ECG waveform. The global ECG sequence is smoothed and differentially processed to obtain a trend ECG sequence. The waveform blocks corresponding to the global ECG sequence are randomly masked, while the waveform blocks corresponding to the trend ECG sequence are not masked. The masked autoencoder is used for encoding and reconstruction, and the two types of ECG features are spliced together along the time dimension. The text semantic prior is used as the query vector, and the concatenated ECG features are used as the key vector and value vector. Multimodal fusion features are obtained through multi-head cross attention, and then input into a cosine classifier with a learnable temperature coefficient and L2 norm normalization of the input features and classifier weight vectors. In the first training phase, random sampling is performed according to the natural data distribution of the training set. The masked autoencoder, cross-attention, and cosine classifier are jointly trained using reconstruction loss and multi-label classification loss. In the second training phase, the encoder and cross-attention parameters are frozen. Smoothed and upper-limit truncated sampled class weights are obtained based on the number of samples in each class. Resampling is performed based on the fusion result of the maximum and average values of the sampled class weights contained in the multi-label samples. The cosine classifier is trained using asymmetric loss and ranking margin loss, which imposes a fixed margin constraint on the classification output of positive and negative sample classes, and outputs the multi-label classification result.
[0010] Preferably, the physiological attributes include age, gender, heart rate, PR interval, QT interval, corrected QT interval, and QRS duration; the clinical context template is used to sequentially write the physiological attributes and includes a natural language description of the analysis of 12 consecutive leads of ECG waveforms to form a natural language case text.
[0011] Preferably, the pre-trained medical language model is ClinicalBERT, the input word block sequence length of the case text is 256, and the hidden layer feature dimension is 768; the mask-aware mean pooling refers to: setting the attention mask value corresponding to the real clinical information word block to 1, setting the attention mask value corresponding to the fill word block to 0, weighting the hidden layer features of each word block according to the corresponding attention mask value, and aggregating the mean according to the number of effective word blocks.
[0012] Preferably, the 12-lead ECG waveforms are uniformly truncated or zero-filled to 5000 data points per lead. The 12-lead ECG waveforms correspond to 10 seconds of ECG data at a sampling rate of 500 Hz, and each ECG sample is Z-score standardized in the leading edge time dimension of the input network.
[0013] Preferably, the trend ECG sequence is obtained by sequentially performing mean filtering and difference filtering on the global ECG sequence; a one-dimensional convolution with a kernel size of 32 and a stride of 16 is used to overlap and divide the global ECG sequence and the trend ECG sequence into blocks, and the waveform blocks corresponding to the global ECG sequence are randomly masked at a ratio of 30%, while the waveform blocks corresponding to the trend ECG sequence are not masked.
[0014] Preferably, the unmasked waveform block is added to a one-dimensional positional code and then input into a 4-layer Transformer encoder. The encoding result is concatenated with the mask identifier and then input into a 1-layer decoder for ECG waveform reconstruction. The global ECG features and trend ECG features output by the encoder are concatenated along the time dimension. The text semantic prior is linearly mapped and used as the query vector.
[0015] Preferably, the multimodal fusion features are passed through a transition layer consisting of a linear layer, a batch normalization layer, and a random dropout layer to reduce the dimensions to 128 before being input into the cosine classifier; the cosine classifier does not have a bias term, and the initial value of the learnable temperature coefficient is 15.0.
[0016] Preferably, in the first training phase, random sampling with a natural distribution is used. The reconstruction loss includes a global mask reconstruction loss and a trend reconstruction loss, and a learnable homoscedasticity uncertainty factor is introduced into the global mask reconstruction loss. The multi-label classification loss uses a binary cross-entropy loss, with the reconstruction loss having a weight of 0.05 relative to the binary cross-entropy loss, and the trend reconstruction loss having a weight of 0.5 in the reconstruction loss. In the first training phase, the parameters of the pre-trained medical language model are frozen, and the parameters of the encoder, decoder, cross-attention, and cosine classifier are updated.
[0017] Preferably, for category ,according to Determine the sampling category weights, where, Indicates category Sampling category weights, Indicates category The number of samples, Represents the smoothing factor and , Indicates category index, Indicates category The number of samples, Indicates the upper limit of the sampling category weight and For multi-label samples ,according to Determine the sample-level sampling weights, where, Indicates sample Sample-level sampling weights, Indicates sample The set of categories included This represents the sampling category weight corresponding to each category in the category set; when the sample does not contain a disease label, it will be... Set to 1.0, and Limit to no more than .
[0018] Preferably, the asymmetric loss employs different exponentially decaying focusing weights for positive and negative labels, and follows the... The predicted probability of the negative label is truncated, where, Indicates category index, This indicates that the cosine classifier classifies categories. The output predicted probability, Indicates the cutoff threshold and , Indicates the truncated category The negative label prediction probability.
[0019] Preferably, the ranking margin loss refers to: treating the class with a true label of 1 as the positive sample class and the class with a true label of 0 as the negative sample class in the current ECG sample, and applying a fixed margin constraint between the classification output of the positive sample class and the classification output of the negative sample class; the fixed margin is the output difference that the classification output of the positive sample class should maintain relative to the classification output of the negative sample class; the total loss of the second training phase is obtained by equally weighting the asymmetric loss and the ranking margin loss.
[0020] The above technical solution has the following beneficial effects: This application transforms patient physiological attributes into clinically contextualized case text and utilizes a pre-trained medical language model and mask-aware mean pooling to form a continuous textual semantic prior, enabling discrete information such as age, gender, heart rate, and ECG interval to participate in ECG feature extraction. Global and trend ECG sequences are encoded using a dual-stream approach, with different masking processes applied to each sequence. This helps preserve continuous trend references while learning occluded waveform information. The textual semantic prior serves as query information in the cross-attention fusion of dual-stream ECG features, allowing clinical semantic information to directly influence the selection of ECG features at different time points. A cosine classifier normalizes input features and class weights, reducing the classifier weight magnitude bias caused by differences in the number of class samples. The first training phase primarily focuses on waveform representation and basic classification learning. The second training phase, after freezing the main representation parameters, employs hybrid resampling and loss for long-tail classification for fine-tuning decisions. This reduces the interference of the long-tail correction process on the already formed underlying ECG representation and improves the recognition and ranking capabilities of uncommon and rare categories in multi-label classification results. Attached Figure Description
[0021] The present invention will now be described in detail with reference to specific embodiments and accompanying drawings, wherein: Figure 1 The overall algorithm block diagram of the ECG multi-label classification method for long-tailed distribution provided in the embodiments of this application is shown. Detailed Implementation
[0022] The specific implementation methods are further described below with reference to the technical solutions and accompanying drawings of this application. The following embodiments are used to illustrate the implementation process of the technical solutions of this application, enabling those skilled in the art to implement the methods described in this application. The specific number of network layers, data length, sampling parameters, and training parameters in the embodiments are preferred implementations of the technical solutions of this application, and are not intended to limit the scope of protection of this application without affecting the core technical concept of this application.
[0023] Example 1 like Figure 1 As shown, this embodiment provides a multi-label classification method for electrocardiograms (ECGs) with long-tail distributions. The method mainly includes clinical ECG data preprocessing, medical text semantic prior extraction, global ECG and trend ECG dual-stream construction, asymmetric mask autoencoding, text-guided cross-modal cross-attention fusion, adaptive temperature cosine classification, and two-stage decoupled training. The method can be executed by a computing device with data storage and model training capabilities. The computing device reads ECG waveforms, physiological attributes, and corresponding label data, and calls a pre-stored program to complete model training and classification inference.
[0024] This embodiment first constructs multimodal clinical ECG data for model training. The raw clinical ECG data can be stored in an XML file. When parsing the raw XML file, the recorded ECG waveforms are extracted, and information that can be associated with the patient's identity, such as patient name, ID number, hospital, and diagnosing physician, is removed. For the extracted ECG waveforms, amplitude transformation corresponding to the original baseline and scale information is performed to give the ECG amplitudes of each sample a unified data meaning.
[0025] Each ECG recording was organized into a standard 12-lead ECG waveform. This embodiment uses ECG data collected over 10 seconds at a sampling rate of 500 Hz, with each lead corresponding to 5000 data points. When the original recording length exceeded 5000 data points, it was truncated; when the original recording length was less than 5000 data points, it was padded with zeros. This ensures that each sample has the same duration and number of leads.
[0026] In addition to electrocardiogram (ECG) waveforms, physiological attributes of patients are extracted from the desensitized clinical data. These physiological attributes include age, gender, heart rate, PR interval, QT interval, corrected QT interval, and QRS duration. A sample-level correspondence is maintained between these physiological attributes and their corresponding 12-lead ECG waveforms to facilitate the simultaneous generation of ECG waveform data streams and clinical text data streams.
[0027] This embodiment uses 17 types of ECG tags for multi-tag classification. Sinus rhythm tags within the normal range and other cardiovascular disease tags are excluded. When the original diagnosis only contains sinus rhythm, the corresponding sample is considered normal. When sinus rhythm appears simultaneously with other disease tags, the other disease tags are used as the disease classification information. For cases where multiple disease tags exist for the same ECG recording, their multi-tag correspondence is preserved.
[0028] Based on the number of samples in each category, the data can be divided into common, uncommon, and rare categories. In this embodiment, categories with more than 5000 samples are categorized as common, categories with 500 to 5000 samples are categorized as uncommon, and categories with fewer than 500 samples are categorized as rare. Data for each category is then processed according to... The dataset is divided into a training set and a test set. In this embodiment, the training set contains 142,699 samples, and the test set contains 60,441 samples.
[0029] Before inputting the ECG waveform into the network, each ECG sample is Z-score normalized along the time dimension. The normalization relationship is expressed as follows: .in, This represents the amplitude of a single electrocardiogram signal before standardization. This represents the mean amplitude calculated along the time dimension of the current ECG sample. This represents the standard deviation of the amplitude calculated along the time dimension of the current ECG sample. This indicates a numerically stable term to prevent the denominator from being zero. This represents the standardized electrocardiogram (ECG) signal amplitude. In this embodiment, it can be set... This treatment reduces the impact of differences in baseline position and absolute amplitude between different patients on subsequent feature learning.
[0030] After waveform data processing, case texts with clinical context are dynamically constructed based on the physiological attributes corresponding to the same sample. The clinical context template sequentially includes the patient's age, gender, heart rate, PR interval, QRS duration, QT interval, and corrected QT interval, forming a clinical context for analyzing continuous 12-lead ECG waveforms within the text. This transforms the originally discrete structured physiological parameters into continuous natural language information.
[0031] The case text is input into a pre-trained medical language model. This embodiment uses ClinicalBERT as the pre-trained medical language model. ClinicalBERT performs chunked encoding on the case text and outputs hidden features corresponding to each input chunk. In this embodiment, the length of the input chunk sequence is set to 256, and the dimension of the hidden features corresponding to each chunk is set to 768. During the training process of this embodiment, the parameters of the pre-trained medical language model are kept frozen to utilize its existing medical semantic representation capabilities, while avoiding additional parameter shifts due to the categorical distribution of the long-tailed ECG data.
[0032] To obtain a global medical semantic representation from the entire case text, this embodiment does not use the hidden features of the starting word block alone, but instead employs mask-aware mean pooling. For valid clinical information word blocks in the word block sequence, the corresponding attention mask value is set to 1; for padding word blocks used to supplement the sequence length, the corresponding attention mask value is set to 0.
[0033] Mask-aware mean pooling can be represented as .in, This represents the semantic prior of the text obtained through mask-aware mean pooling. In this embodiment, the length of the word block sequence is indicated. , Indicates the word block position index. Indicates the first The 768-dimensional hidden feature vectors corresponding to each word block Indicates the first Attention mask values corresponding to each word block This represents a numerically stable term used to ensure the denominator is non-zero. By using an attention mask in pooling, the filler word blocks are excluded from the calculation of global clinical semantic features, allowing information such as age, heart rate, and ECG intervals distributed across different locations in the text to collectively enter the text's semantic prior.
[0034] Subsequently, a global ECG sequence and a trend ECG sequence were constructed for waveform representation learning. The global ECG sequence was formed from a standardized 12-lead ECG waveform. The trend ECG sequence was obtained from the global ECG sequence through cascaded filtering. First, mean filtering was performed to obtain a smoother ECG trend, and then difference filtering was performed to highlight the morphological changes between consecutive time positions, thereby forming morphological trend information corresponding to the original global ECG sequence.
[0035] For both global and trend ECG sequences, one-dimensional convolution with a kernel size of 32 and a stride of 16 is used for overlapping block segmentation. Adjacent ECG waveform blocks have overlapping regions, enabling the encoding process to continuously cover local waveform changes.
[0036] Based on this, an asymmetric masking method is used to process dual-stream ECG data. Random masking is applied to the waveform blocks corresponding to the global ECG sequence; in this embodiment, the random masking ratio is 30%. The masked global waveform blocks are not directly fed into the encoder. No random masking is applied to the trend ECG sequence, thus the trend branches can continuously provide complete morphological change information.
[0037] One-dimensional positional encoding is added to the unmasked ECG waveform blocks, and then fed into a Transformer encoder for temporal feature extraction. This embodiment uses a 4-layer Transformer encoder. The encoder forms global high-level ECG temporal features and trend high-level ECG temporal features by performing feature interaction on waveform blocks at different time positions.
[0038] After encoding, the mask identifier used to represent the occluded position is replaced with the corresponding time position and sent to the decoder for reconstruction. This embodiment uses a single-layer Transformer decoder. The decoder reconstructs the corresponding ECG sequence based on the context features extracted by the encoder. In the first training phase, the reconstruction results are used to form a global mask reconstruction loss and a trend reconstruction loss, enabling the encoder to retain its ability to represent the structure of the ECG physiological waveform itself, in addition to classification supervision.
[0039] After encoding, the global ECG features and the trend ECG features are concatenated along the time dimension to obtain a dual-stream ECG fusion sequence. This concatenation preserves the local morphological and rhythmic information carried by the original global waveform, while also retaining the continuous change information provided by the trend branch.
[0040] On the other hand, the aforementioned textual semantic prior is transformed into a feature dimension that matches the cross-attention calculation through linear mapping, and the mapped textual semantic prior is used as the query vector. The concatenated dual-stream ECG fusion sequence is used as the key vector and value vector. Feature interaction between the text modality and the ECG waveform modality is performed through multi-head cross-attention. In each attention head, the conventional scaling dot product attention method can be used to calculate the correlation between the query vector and ECG features at different time locations, and then the results of multiple attention heads are fused.
[0041] Through this data flow relationship, clinical information such as age, gender, heart rate, and ECG intervals are not simply mechanically concatenated with ECG features at the classifier input. Instead, they are first transformed into continuous medical text semantic representations, and then participate in waveform feature selection through the query process. Cross-attention can assign different levels of attention to features at different time positions in a dual-stream ECG sequence based on the clinical semantic information corresponding to the current sample. Under this processing method, the attention weights formed by text guidance can be concentrated on local ECG waveform regions with strong diagnostic information.
[0042] After multi-head cross-attention outputs multimodal fusion features, these fusion features are sequentially fed into a transition layer consisting of a linear layer, a batch normalization layer, and a random dropout layer, reducing the feature dimension to 128. The 128-dimensional features are then fed into an adaptive temperature cosine classifier.
[0043] The cosine classifier does not include the bias term found in traditional linear classifiers. It performs L2 normalization on both the input features and the classifier class weights, then calculates their cosine similarity, and adjusts the scale of the classification logistic values using a learnable temperature coefficient. This calculation relationship can be expressed as follows: .in, This represents the logical values for each category output by the cosine classifier. Indicates the learnable temperature coefficient. This represents the 128-dimensional multimodal fusion features input to the cosine classifier. Represents the class weight matrix of the cosine classifier, with superscript... This represents the matrix transpose. In this embodiment, the temperature coefficient is initialized to... .
[0044] After normalizing the input features and class weights using the L2 norm, the classification result is mainly determined by the similarity between the feature direction and the direction of each class weight, thereby reducing the impact of differences in class weight magnitudes caused by differences in the number of samples from different classes on the classification decision. A learnable temperature coefficient is used to adjust the scale of the normalized classification logistic values and is updated during network training.
[0045] This embodiment employs two training phases to decouple and optimize the aforementioned network.
[0046] The first training phase is used for multimodal representation learning and basic classification learning. This phase involves random sampling based on the natural data distribution of the original training set, without enabling weighted sampling for rare classes. During training, both the ECG signal reconstruction task and the multi-label classification task are optimized simultaneously.
[0047] For a multi-label classification task with 17 classes, the binary cross-entropy loss can be expressed as: .in, This represents the multi-label binary cross-entropy loss. Indicates the number of classification categories, in this embodiment , Indicates category index, Indicates that the current sample is for the first... Real labels for each category The representation model is for the first The predicted probabilities obtained for each category.
[0048] The first training phase also includes global mask reconstruction loss and trend reconstruction loss. The global mask reconstruction loss constrains the decoder to recover the randomly masked global ECG information and introduces a learnable homoscedasticity uncertainty factor into this reconstruction task to adjust the magnitude of the reconstruction error during training. The trend reconstruction loss constrains the reconstruction task corresponding to the trend branch.
[0049] The total loss in the first training phase can be expressed as follows: .in, This represents the total loss during the first training phase. This represents the multi-label binary cross-entropy loss. Indicates the loss during global mask reconstruction. Indicates trend reconstruction loss. This represents the weight of the reconstruction task relative to the basic classification task. This represents the relative weight of the trend reconstruction loss in the reconstruction task. In this embodiment, it is set... ,set up .
[0050] In the first training phase, the ClinicalBERT parameters are frozen, and the encoder, decoder, cross-modal cross-attention, and cosine classifier participate in parameter updates. The model can be trained using the conventional gradient descent method, updating the corresponding trainable parameters in reverse based on the total loss from the first training phase. After training is complete, the model parameters obtained in the first training phase are saved.
[0051] The second training phase is used to further adjust the classification decision boundary under the long-tailed data distribution. The second training phase loads the model parameters obtained in the first training phase, freezes the encoder and cross-modal cross-attention parameters, no longer uses ECG signal reconstruction as the optimization objective of this phase, and performs fine-tuning of the classification decision for the cosine classifier.
[0052] The second training phase no longer uses natural random sampling under the original long-tailed distribution, but instead uses a mixed resampling of smoothed extrema and mean. First, the number of samples for each ECG category in the training set is counted, and the sampled category weights after smoothing and upper limit truncation are obtained based on the number of samples for each category.
[0053] For category Sampling category weights according to Confirmed. Among them, Indicates the current category. Indicates category Sampling category weights, Indicates category The number of samples, Represents the smoothing factor. This represents the category index used to iterate through all categories. Indicates category The number of samples, This represents the upper limit of the sampling category weights. In this embodiment, it is set to... ,set up .
[0054] For samples with multiple disease labels The sampling category weights for each disease category included in the sample are obtained, and the sample-level sampling weights are determined by fusing the maximum and average values. The sample-level sampling weights are represented as follows: .in, Indicates the sample index. Indicates sample Sample-level sampling weights, Indicates sample The set of disease categories included Represents a set of categories The sampling category weights corresponding to each category in the sample. This represents the maximum sampled class weight in the set. This represents the average sampled class weight in the set.
[0055] When a sample does not contain a disease label and is a normal ECG sample, its sample-level sampling weight is set to... The calculated sample-level sampling weights are further subject to an upper limit constraint, so that... No more than The training batch is resampled according to the sample-level sampling weights, thereby increasing the frequency of uncommon and rare class samples in the second training phase. At the same time, the average weight component is used to mitigate the situation where common classes are synchronously over-amplified along with rare classes in multi-label samples.
[0056] The second training phase employs asymmetric loss to address the imbalance between positive and negative labels in multi-label tasks. For easily classifiable negative labels, the predicted probabilities are first truncated, with the truncation relationship being: .in, Indicates category index, The model represents the first The predicted probability of each category output. This represents the threshold for truncating the predicted probability of the negative label. This represents the predicted probability of the truncated negative label. In this embodiment, it is set as follows: .
[0057] Asymmetric loss can be expressed as .in, Indicates asymmetric loss. Indicates the number of ECG classification categories. Indicates category index, Indicates the first Real labels for each category Indicates the first The predicted probabilities of each category, This represents the predicted probability of the negative label after truncation. This indicates the exponentially decaying focus weight corresponding to the positive label. This represents the exponentially decaying focusing weights corresponding to negative labels. By setting separate focusing methods for positive and negative labels, the dominant role of numerous easily negative labels in parameter updates during the second training phase can be reduced.
[0058] In addition to asymmetric loss, the second training phase also employs ranking margin loss. For the current sample, the categories with a true label of 1 form the positive sample category set, and the categories with a true label of 0 form the negative sample category set. The ranking margin loss sets a fixed margin for the classification outputs of the positive and negative sample categories. When the difference between the classification outputs of the positive and negative sample categories is less than the fixed margin, a corresponding penalty is applied to further widen the gap between the positive and negative classification outputs during the classifier's training process.
[0059] The total loss in the second training phase is expressed as: .in, This indicates the total losses in the second training phase. Indicates asymmetric loss. Indicates the sort margin loss. This represents the weighting coefficient between the asymmetric loss and the ranking margin loss. In this embodiment, it is set as follows: .
[0060] In the second training phase, the frequency of different categories of samples in the training batch is changed by the aforementioned smoothed extremum and mean mixed resampling, and the optimization objective of the classification decision-making end is changed by asymmetric loss and ranking margin loss. Since the encoder and cross-modal cross-attention parameters remain frozen, the correction of long-tail categories in the second training phase mainly affects the classification decision part, without continuously changing the underlying ECG representation space formed in the first training phase.
[0061] After model training, the same data processing procedure as in the training phase is applied to the ECG samples to be classified. First, the 12-lead ECG waveforms and corresponding physiological attributes of the samples to be classified are obtained. The ECG waveforms are standardized, and case text is generated based on the physiological attributes. Then, a pre-trained medical language model and mask-aware mean pooling are used to obtain the semantic prior of the text. At the same time, a global ECG sequence and a trend ECG sequence are generated from the ECG waveforms, and dual-stream ECG features are obtained through a trained encoder.
[0062] Using textual semantic priors as query information, multi-head cross-attention fusion is performed on dual-stream ECG features. The fusion result is then passed through the transition layer and cosine classifier to obtain the classification output corresponding to each ECG category, thereby forming a multi-label ECG classification result.
[0063] This embodiment places medical text semantic guidance and dual-stream ECG waveform representation in the first training phase, allowing the model to learn the correlation between ECG morphology, trend information, and clinical physiological attributes using natural data distribution. In the second training phase, while keeping the main representation parameters unchanged, classification decisions are adjusted through hybrid resampling oriented towards multi-label long-tail distributions and classification loss. This separates the underlying ECG representation learning from the long-tail classification boundary adjustment, allowing the two optimization tasks to act on their respective technical aspects.
[0064] Example 2 This embodiment, based on the complete model described in Embodiment 1, performs full-class performance verification on the ECG multi-label classification method for long-tailed distributions. This embodiment uses the training and test sets described in Embodiment 1. The training set contains 142,699 ECG samples, and the test set contains 60,441 ECG samples. The training data includes 17 ECG categories, further divided into common, uncommon, and rare classes according to sample quantity, to examine the model's classification ability for different data distribution levels.
[0065] This embodiment employs the complete technical solution described in Embodiment 1 for training. First, it uses natural data distribution to complete multimodal representation learning and basic classification learning. Then, it freezes the encoder and cross-modal cross-attention parameters, and fine-tunes the classification decision through smoothed extreme value and mean resampling and a hybrid classification loss. After completing the two training phases, the model parameters are kept fixed on the test set. For each test sample, the same data preprocessing, case text construction, text semantic prior extraction, global ECG and trend ECG encoding, cross-modal cross-attention fusion, and cosine classification are performed as in the training phase.
[0066] To evaluate classification performance from different perspectives, this embodiment uses AUROC, sensitivity with specificity greater than or equal to 90%, and Sample Hit@. As evaluation metrics, AUROC is used to evaluate the model's overall ability to rank and distinguish between positive and negative samples. Sensitivity with a specificity greater than or equal to 90% is used to evaluate the model's ability to detect the target class while maintaining a specificity of at least 90%.
[0067] Sample Hit@ Used to evaluate whether the true disease label in the multi-label output is included in the model prediction results. There are several locations. Among them, This indicates the number of model output categories involved in the hit determination. When a test sample has multiple real disease labels, as long as the real label corresponding to the evaluation rule is included in the top... The output of each model can be used to calculate the corresponding hit rate. This metric is used to evaluate whether, in cases of multi-label comorbidity, especially rare disease labels in the tail, can enter the range of candidate classification results with practical reference value.
[0068] For the total test set and Sample Hit@ under different long-tail distribution levels Statistical analysis shows that, combining the test results of 17 specific ECG categories, categories with different sample sizes can all obtain corresponding classification outputs.
[0069] For common types, the AUROC for sinus tachycardia is 0.994, and the sensitivity is 0.993 when the specificity is greater than or equal to 90%; the AUROC for sinus bradycardia is 0.995, and the sensitivity is 0.994 when the specificity is greater than or equal to 90%; the AUROC for complete right bundle branch block is 0.993, and the sensitivity is 0.995 when the specificity is greater than or equal to 90%.
[0070] For uncommon types, the AUROC for ventricular premature beats was 0.953, with a sensitivity of 0.898 when the specificity was ≥90%; the AUROC for first-degree atrioventricular block was 0.986, with a sensitivity of 0.984 when the specificity was ≥90%; the AUROC for atrial fibrillation was 0.992, with a sensitivity of 0.993 when the specificity was ≥90%; the AUROC for atrial flutter was 0.986, with a sensitivity of 0.984 when the specificity was ≥90%; the AUROC for complete left bundle branch block was 0.999, with a sensitivity of 1.000 when the specificity was ≥90%; and the AUROC for paced rhythms was 0.992, with a sensitivity of 0.982 when the specificity was ≥90%.
[0071] For rare classes with fewer than 500 samples, the AUROC for paroxysmal supraventricular tachycardia was 0.998, with a sensitivity of 1.000 at a specificity of ≥90%; the AUROC for junctional escape beats was 0.954, with a sensitivity of 0.875 at a specificity of ≥90%; the AUROC for left anterior fascicular block was 0.889, with a sensitivity of 0.733 at a specificity of ≥90%; the AUROC for ventricular pre-excitation was 0.947, with a sensitivity of 0.885 at a specificity of ≥90%; and the AUROC for myocardial infarction was 0.964, with a sensitivity of 0.897 at a specificity of ≥90%.
[0072] The above results demonstrate that even with a significant long-tail distribution in the training data, the model still possesses the ability to distinguish features for several rare categories. In particular, categories with fewer samples, such as paroxysmal supraventricular tachycardia and myocardial infarction, maintain high AUROC. This result corresponds to the training process in Example 1. In the first training phase, resampling for tail categories is not introduced; instead, representation learning is performed using the original 12-lead ECG, trend ECG reconstruction, and clinical text semantic guidance, ensuring that long-tail correction does not directly affect the initial feature formation process. The classification decision is then adjusted in the second training phase while keeping the main representation parameters unchanged.
[0073] In an output method corresponding to the above test model, multi-label candidate results can be formed according to the sorting results of the output of each category. For sinus rhythm, which represents a normal physiological state, when it is ranked first in the model output results, this result can be used as a reference for normal ECG screening. In this embodiment, the Sample Hit@1 of sinus rhythm is 0.963, that is, only the first result of the classification output is considered.
[0074] For samples where sinus rhythm is not ranked first in the model output, multiple top-ranked abnormality categories can be output as multi-label candidate results for subsequent interpretation. This output method does not require the model to output only a single disease label, thus preserving classification information corresponding to multiple concurrent abnormalities. For rare diseases in long-tailed data, even if their classification output is not ranked first, as long as they enter a higher candidate range through resampling and ranking constraints in the second training phase, they can still be retained in the multi-label output.
[0075] The classification results described in this embodiment reflect the model's prediction of the category of the ECG sample to be analyzed. In practical use, the classification outputs and ranking results corresponding to each category can be provided to ECG data analysts. The model output is used to assist in the classification and screening of ECG data without changing the aforementioned model training and inference process.
[0076] Example 3 This embodiment verifies the relationship between different technical modules and classification performance in Embodiment 1 through ablation. The complete solution adopts the medical text semantic guidance, two-stream asymmetric mask autoencoder, two-stage decoupled training, cosine classifier, smoothed extremum and mean mixed resampling, and mixed classification loss described in Embodiment 1.
[0077] While maintaining the same test data and evaluation methods, comparative models were constructed to remove text attribute guidance, two-stage decoupled training, cosine classifier, mixed resampling, and mixed loss. Each comparative model only removed the corresponding module to be evaluated; the rest were standardized to match the corresponding complete scheme, in order to compare the impact of different modules on feature representation and long-tail classification decisions.
[0078] The AUROC results of the complete scheme and various ablation comparisons on the entire test set, common classes, uncommon classes, and rare classes show that, except for removing text attribute-guided comparisons, the overall AUROC remains at a high and relatively close level after removing classification optimization modules such as decoupled training, cosine classifier, or resampling.
[0079] This result corresponds to the two-stage training relationship of this application. The main task of the first training stage is to establish a low-level multimodal feature space through ECG signal reconstruction, basic multi-label classification, and clinical text semantic guidance. Hybrid resampling and corresponding training measures for correcting tail-level classification decisions are mainly deployed in the second training stage. Therefore, when a portion of the second-stage classification optimization module is removed, the basic ECG representation formed in the first training stage is still retained, so that the overall AUROC does not show the same degree of change as the tail-level decision index.
[0080] After removing text attribute guidance, the model not only showed a decline in multi-label hits for rare categories, but also a significant decrease in overall AUROC. This result indicates that clinical text information in this embodiment is not only used for adjusting the classification threshold in the second stage, but also directly participates in the formation of multimodal representations in the first training stage.
[0081] In the complete scheme, patient age, gender, heart rate, PR interval, QT interval, corrected QT interval, and QRS duration are first converted into case text with clinical context. This case text is then encoded using ClinicalBERT and subjected to mask-aware mean pooling to form a semantic prior, which is then used as a query vector in the cross-attention calculation of dual-stream ECG features. Therefore, removing text attribute guidance alters the ECG waveform feature formation process itself, not just the input dimension of the final classifier.
[0082] Complete protocol and sample Hit@ for each ablation comparison under different long-tail distribution levels Performance changes indicate that after removing the hybrid resampling, cosine classifier, or hybrid classification loss, the Sample Hit@ for common classes... The changes were relatively small, while the indicators for uncommon and rare classes showed a more significant decline. Among them, This indicates the number of the top few classification results that participated in the hit evaluation.
[0083] This experimental phenomenon corresponds to the function of the second training phase. Smoothing extreme values and mean-mixed resampling are used to increase the frequency of uncommon and rare class samples in the training batch. At the same time, by fusing the maximum class weight and the average class weight, it is avoided that a sample with both common and rare disease labels is amplified entirely according to the maximum class weight.
[0084] The cosine classifier normalizes the input features and class weights using the L2 norm, limiting the impact of the number of class samples on the magnitude of the class weights. Asymmetric loss reduces the influence of numerous easily negative labels during the optimization process. The ranking margin loss further constrains the classification output relationship between positive and negative sample classes. These processes work together in the classification decision-making process of the second training phase.
[0085] The changes in different metrics in the ablation experiments above show that representation learning in the first training phase and classification decision fine-tuning in the second training phase have different roles. The first training phase primarily affects the discriminability of different categories in the feature space, while the second training phase further influences the relative ranking of each category in the multi-label output under long-tail conditions. Separating the two training phases allows for the preservation of the already formed encoded features and cross-modal fusion relationships when adjusting tail-level classification decisions.
[0086] Example 4 This example illustrates a specific application of smoothed extremum and mean-based mixed resampling in real-world long-tail training data. The training set contains a total of 142,699 samples. There are significant differences in the number of samples among different ECG categories.
[0087] Sinus rhythm has 90,296 training samples with a corresponding sampling class weight of 1.00; sinus bradycardia has 13,966 training samples with a corresponding sampling class weight of 1.75; sinus tachycardia has 10,994 training samples with a corresponding sampling class weight of 1.88; and sinus arrhythmia has 7,700 training samples with a corresponding sampling class weight of 2.09.
[0088] The training samples for atrial premature beats (APBs) are 4986, with a corresponding category weight of 2.38; for complete right bundle branch block (MBB), there are 4840 training samples, with a corresponding category weight of 2.41; for ventricular premature beats (PVCs), there are 3244 training samples, with a corresponding category weight of 2.71; for atrial fibrillation, there are 2636 training samples, with a corresponding category weight of 2.89; for first-degree atrioventricular block, there are 1609 training samples, with a corresponding category weight of 3.35; for atrial flutter, there are 750 training samples, with a corresponding category weight of 4.21; for complete left bundle branch block, there are 564 training samples, with a corresponding category weight of 4.58; and for paced rhythms, there are 543 training samples, with a corresponding category weight of 4.64.
[0089] Among the rare categories, ventricular pre-excitation had 182 training samples with a corresponding sampling category weight of 6.44; junctional escape beats had 175 training samples with a corresponding sampling category weight of 6.51; myocardial infarction had 85 training samples with a corresponding sampling category weight of 8.09; left anterior fascicular block had 70 training samples with a corresponding sampling category weight of 8.57; and paroxysmal supraventricular tachycardia had 59 training samples with a corresponding sampling category weight of 9.02.
[0090] The aforementioned category weights are obtained using the smoothing and upper limit truncation methods described in Example 1. As the number of category samples decreases, the overall sampled category weights increase. However, through the smoothing factor and the limitation of the maximum sampled category weight, the sampled weights of low-frequency categories do not increase indefinitely as the number of samples decreases.
[0091] For a sample with only one disease label, its sample-level sampling weight is determined by the sampling category weight corresponding to that category. For a sample with multiple disease labels, the largest sampling category weight is not directly used as the final sample weight; instead, the maximum and average of the included category weights are combined. Therefore, when rare and common categories appear in the same sample, the sample receives a higher sampling opportunity than common category samples, without excessively amplifying the common category by simply applying the maximum weight of the rare category.
[0092] In the second training phase, training batches are formed based on the sample-level sampling weights obtained in the above manner. This resampling process is only used in the classifier fine-tuning phase. The first training phase still involves random sampling according to the natural distribution of the training data. By configuring the two sampling strategies in different training phases, the underlying ECG feature learning and class distribution correction are completed separately.
[0093] Example 5 This embodiment further illustrates the correspondence between text semantic guidance and electrocardiogram waveform features. Taking any 12-lead electrocardiogram sample to be processed as an example, the age, gender, heart rate, PR interval, QT interval, corrected QT interval, and QRS duration corresponding to the sample are first obtained. The above physiological attributes are then organized into natural language case text according to the clinical context template described in Embodiment 1.
[0094] After the case text is encoded using ClinicalBERT, a 768-dimensional semantic prior is obtained through mask-aware mean pooling. This semantic prior includes multiple clinical and physiological parameters corresponding to the current sample, rather than directly outputting a disease diagnosis text.
[0095] The semantic prior text is linearly mapped and used as the query vector for multi-head cross-attention. Global and trend ECG features are concatenated along the time dimension to serve as key and value vectors, respectively. Cross-attention generates fused features based on the correlation between the query vector and ECG features at different time points.
[0096] When using this processing method, the one-dimensional ECG timing waveform in lead II can be correlated with the cross-modal attention weight distribution at the corresponding time positions. The time regions with higher attention weights correspond to some obvious cardiac structures in the original ECG waveform, including QRS complex regions with strong morphological features.
[0097] These results demonstrate that structured physiological attributes, after being semantically encoded in text, can be directly used in ECG waveform feature selection. ClinicalBERT is used as a medical text feature extractor in this method, and its output hidden semantic features are pooled before being used in subsequent deterministic feature computation. The final disease classification result is generated jointly by ECG encoding, cross-modal fusion, and a cosine classifier, rather than by a pre-trained medical language model generating diagnostic text.
[0098] Examples 2 to 5 further illustrate the specific implementation of the complete scheme described in Example 1 in terms of full-category performance verification, core module ablation verification, long-tail resampling, and text semantic guidance. The terminology and data flow relationships used in each example for ECG waveform processing, text semantic extraction, dual-stream coding, cross-modal fusion, cosine classification, and two-stage training are consistent with those in Example 1.
[0099] The above embodiments illustrate the specific implementation process of a multi-label electrocardiogram (ECG) classification method for long-tailed distributions according to this application. Embodiment 1 provides a complete implementation process consisting of clinical ECG data preprocessing, medical text semantic prior extraction, global and trend ECG dual-stream construction, asymmetric mask autoencoding, text-guided cross-modal cross-attention fusion, adaptive temperature cosine classification, and two-stage decoupled training. Embodiments 2 to 5 further illustrate the corresponding technical content from aspects such as full-class performance verification, core module ablation verification, smoothed extreme value and mean mixed resampling, and text semantic guidance.
[0100] In the technical solution described in this application, the various processing steps are interconnected according to data processing relationships. Structured physiological attributes, after being constructed from clinical context and processed by a pre-trained medical language model, form a textual semantic prior. This textual semantic prior is used to guide the cross-modal fusion of global and trend ECG features. The first training phase involves ECG representation learning and basic classification learning under a natural data distribution. The second training phase, while keeping the encoder and cross-modal cross-attention parameters frozen, fine-tunes the cosine classifier using smoothed extremum and mean mixed resampling, asymmetric loss, and ranking margin loss. These technical steps together constitute the technical implementation process of the ECG multi-label classification method for long-tailed distributions described in this application.
[0101] It should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit the scope of protection of this application. Within the scope of the technical content disclosed in this application, those skilled in the art can select the specific implementation parameters according to the actual data conditions and model training conditions. As long as the corresponding processing method does not depart from the technical concept of this application, it can be used as a specific implementation form of the technical solution of this application.
[0102] The preferred parameters explicitly given in the embodiments of this application, such as ECG data sampling rate, number of data points, mask ratio, number of encoder layers, number of decoder layers, smoothing factor, upper limit of sampling category weight, initial value of temperature coefficient, and weights of each loss, are used to describe a specific configuration that can implement the technical solution of this application. Within the scope of the technical content disclosed in this application, the specific implementation parameters can be selected accordingly based on actual data conditions and model training conditions.
Claims
1. A multi-label classification method for electrocardiograms oriented towards long-tailed distributions, characterized in that, include: The 12-lead ECG waveform and physiological attributes are obtained. The physiological attributes are converted into case text according to the clinical context template. The text is encoded by a pre-trained medical language model. The hidden features of effective clinical information blocks are weighted and aggregated using mask-aware mean pooling to obtain the text semantic prior. A global ECG sequence is formed using the 12-lead ECG waveform. The global ECG sequence is smoothed and differentially processed to obtain a trend ECG sequence. The waveform blocks corresponding to the global ECG sequence are randomly masked, while the waveform blocks corresponding to the trend ECG sequence are not masked. The masked autoencoder is used for encoding and reconstruction, and the two types of ECG features are spliced together along the time dimension. The text semantic prior is used as the query vector, and the concatenated ECG features are used as the key vector and value vector. Multimodal fusion features are obtained through multi-head cross attention, and then input into a cosine classifier with a learnable temperature coefficient and L2 norm normalization of the input features and classifier weight vectors. In the first training phase, random sampling is performed according to the natural data distribution of the training set to jointly train the mask autoencoder, cross attention, and cosine classifier using reconstruction loss and multi-label classification loss. In the second training phase, the encoder and cross-attention parameters are frozen. The sampled class weights, which are smoothed and truncated by the upper limit, are obtained according to the number of samples in each class. Resampling is performed based on the fusion result of the maximum and average values of the sampled class weights contained in the multi-label samples. The cosine classifier is trained using asymmetric loss and ranking margin loss, which imposes a fixed margin constraint on the classification output of positive and negative sample classes, and outputs the multi-label classification results.
2. The ECG multi-label classification method for long-tailed distribution according to claim 1, characterized in that, The physiological attributes include age, gender, heart rate, PR interval, QT interval, corrected QT interval, and QRS duration; the clinical context template is used to sequentially write the physiological attributes and includes a natural language description of the analysis of 12 consecutive ECG waveforms to form a natural language case text.
3. The ECG multi-label classification method for long-tailed distribution according to claim 2, characterized in that, The pre-trained medical language model is ClinicalBERT, with the input word block sequence length of the case text being 256 and the hidden layer feature dimension being 768. The mask-aware mean pooling refers to setting the attention mask value corresponding to the real clinical information word block to 1, setting the attention mask value corresponding to the fill word block to 0, weighting the hidden layer features of each word block according to the corresponding attention mask value, and aggregating the mean according to the number of effective word blocks.
4. The ECG multi-label classification method for long-tailed distribution according to claim 1, characterized in that, The 12-lead ECG waveforms are uniformly truncated or zero-filled to 5000 data points per lead. The 12-lead ECG waveforms correspond to 10 seconds of ECG data at a sampling rate of 500Hz. Z-score standardization is performed on each ECG sample in the leading edge time dimension of the input network.
5. The ECG multi-label classification method for long-tailed distribution according to claim 4, characterized in that, The trend ECG sequence is obtained by sequentially applying mean filtering and difference filtering to the global ECG sequence. A one-dimensional convolution with a kernel size of 32 and a stride of 16 is used to overlap and divide the global ECG sequence and the trend ECG sequence into blocks. The waveform blocks corresponding to the global ECG sequence are randomly masked at a ratio of 30%, while the waveform blocks corresponding to the trend ECG sequence are not masked.
6. The ECG multi-label classification method for long-tailed distribution according to claim 5, characterized in that, The unmasked waveform block is added to a one-dimensional positional code and then input into a 4-layer Transformer encoder. The encoding result is concatenated with the mask identifier and then input into a 1-layer decoder for ECG waveform reconstruction. The global ECG features and trend ECG features output by the encoder are concatenated along the time dimension. The text semantic prior is linearly mapped and used as the query vector.
7. The ECG multi-label classification method for long-tailed distribution according to claim 1, characterized in that, The multimodal fusion features are sequentially passed through a transition layer consisting of a linear layer, a batch normalization layer, and a random dropout layer to reduce the dimensions to 128 before being input into the cosine classifier; the cosine classifier has no bias term set, and the initial value of the learnable temperature coefficient is 15.
0.
8. The ECG multi-label classification method for long-tailed distribution according to claim 1, characterized in that, In the first training phase, random sampling with a natural distribution is used. The reconstruction loss includes a global mask reconstruction loss and a trend reconstruction loss, and a learnable homoscedasticity uncertainty factor is introduced into the global mask reconstruction loss. The multi-label classification loss uses a binary cross-entropy loss, with the reconstruction loss having a weight of 0.05 relative to the binary cross-entropy loss, and the trend reconstruction loss having a weight of 0.5 in the reconstruction loss. In the first training phase, the parameters of the pre-trained medical language model are frozen, and the parameters of the encoder, decoder, cross-attention, and cosine classifier are updated.
9. The ECG multi-label classification method for long-tailed distribution according to claim 1, characterized in that, For category ,according to Determine the sampling category weights, where, Indicate category Sampling category weights, Indicate category The number of samples, Represents the smoothing factor and , Indicates category index, Indicate category The number of samples, Indicates the upper limit of the sampling category weight and For multi-label samples ,according to Determine the sample-level sampling weights, where, Indicates sample Sample-level sampling weights, Indicates sample The set of categories included This represents the sampling category weight corresponding to each category in the category set; when the sample does not contain a disease label, it will be... Set to 1.0, and Limit to no more than .
10. The ECG multi-label classification method for long-tailed distribution according to claim 9, characterized in that, The asymmetric loss employs different exponentially decaying focusing weights for positive and negative labels, and follows... The predicted probability of the negative label is truncated, where, Indicates category index, This indicates that the cosine classifier classifies categories. The output predicted probability, Indicates the cutoff threshold and , Indicates the truncated category The negative label prediction probability.
