Soft contrast learning-based classification method applied to biological sensing signal classification problem
By employing adaptive soft contrastive learning and relational soft contrastive learning methods, the problems of time-consuming data labeling and 'class collision' in biosensor signal classification are solved, achieving efficient classification under unsupervised conditions and improving the model's recognition accuracy and generalization ability.
Patent Information
- Application Number
- CN202411170157.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2026-03-03
AI Technical Summary
Existing methods for classifying biosensor signals suffer from time-consuming and costly data annotation, limited data volume, and the tendency for traditional contrastive learning to encounter 'class collision' problems, making it difficult to effectively identify human behavior and emotions.
Adaptive soft contrastive learning and relational soft contrastive learning methods are adopted. Pseudo-labels are generated by calculating the similarity distribution between instances, and KL divergence is used to measure the relational distribution of different views. Adaptive pseudo-labels and soft contrastive loss functions are constructed to avoid 'class collision' and improve the model's generalization ability.
Effective classification of biosensor signals under unsupervised conditions improves the model's recognition accuracy and generalization ability, especially in human behavior and emotion recognition.
Smart Images

Figure FT_1 
Figure FT_2
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of pattern recognition and digital signal processing, and in particular relates to a comparative learning method for emotion recognition using non-invasive EEG devices. Background Technology
[0002] The classification of biosignals is crucial for a deeper understanding of the health of humans and other organisms. For example, medical experts can use electroencephalography (EEG) data to monitor conditions such as epilepsy or depression; and can identify functional characteristics of the brain during exercise fatigue by analyzing EEG; similarly, electrocardiography (ECG) can reveal not only the health of the heart but also an individual's stress level; and can also classify motor imagery based on EEG generated from the brain's imagined movement processes. These biosignal time series can be obtained through non-invasive and continuous measurement methods. However, there are two major challenges in constructing biosignal data: first, the data annotation process is not only time-consuming, but also requires specialized knowledge for annotation of data in certain specific fields; second, because it needs to be collected on an individual basis, the data volume is usually small, and the number of individuals is limited.
[0003] To date, tasks based on biosensor signals, whether classification or disease prediction, typically employ supervised learning for training, with limited exploration of self-supervised learning. Furthermore, most methods rely on data transformation to construct contrastive learning models, which still struggle to achieve satisfactory recognition results. Similarly, transfer learning often fails to achieve satisfactory performance. Self-supervised learning, capable of learning data representations even in the absence of labeled data, offers a promising solution to these problems.
[0004] The core of this task lies in understanding the inherent structure and characteristics of data by comparing positive and negative sample pairs, thereby obtaining a representation that captures the essential attributes of the data. Because this method does not rely on explicit label information, it is particularly suitable for situations where labels are scarce or expensive to obtain. These methods typically employ a contrastive learning framework, the basic idea of which is to define the augmented view of a specific instance as a positive sample, while considering different views of other instances as negative samples. The goal of learning is to reduce the distance between the instance and its positive samples, while increasing the distance with its negative samples.
[0005] Current mainstream research on contrastive learning mainly focuses on constructing positive examples, while negative examples are all other samples in the same batch of training data. This leads to the learning process pushing away similar samples that the algorithm considers to belong to different classes, which is an inherent problem of contrastive learning: "class collision".
[0006] This paper proposes a pseudo-label construction method based on similarity distribution and a correlation-based contrastive learning method. By calculating the similarity distribution between instances, pseudo-labels are generated for each instance. These pseudo-labels not only provide additional supervision signals for the model, but also allow for dynamic adjustment of label weights as training progresses, thereby improving the model's generalization ability. Secondly, in addition to constructing the similarity distribution between instances, we also calculate the relationships between different views. In multi-view learning, data can be observed from multiple perspectives or feature spaces, and each view may contain different information about the data. By constructing the similarity distribution between views, we can better model the relationships between instances. Thus, when one view of the same sample is similar or dissimilar to other samples, another view can also maintain this relationship. Summary of the Invention
[0007] The purpose of this invention is to address the "class collision" problem in contrastive learning by providing a soft contrastive learning algorithm based on biosensor signals for classifying human behavior, emotions, diseases, etc. This method proposes adaptive soft contrastive learning and relational soft contrastive learning to jointly learn patterns in the representation space, effectively avoiding the "class collision" problem in contrastive learning. It has achieved good results in problems such as human behavior, emotion recognition, and epilepsy recognition. This invention is a portable plug-in method, meaning its content can be adapted to similar contrastive learning algorithms.
[0008] To better illustrate the content of this invention, a brief description of the contrastive learning method is provided here: Existing contrastive learning is mainly based on instance discrimination tasks, treating instances as separate semantic units for learning. Given... Sample Through two different data enhancement transformations Get two different views Then use the encoder Extract information from these samples (Sometimes a non-linear projection head is used after the encoder to project the information) Projected into a deeper embedded space to obtain Here we only use the information obtained from the encoder. ), assuming express Two different views are mapped to representations in the representation space by the encoder. The loss function for contrastive learning, representing different instances, can be expressed as formula (1):
[0009] (1).
[0010] The similarity function express The similarity between normalized vectors can be expressed as: , This represents a temperature parameter used to adjust the sharpness of the probability distribution.
[0011] The content of this invention is based on the basic idea expressed by formula (1).
[0012] This invention proposes an adaptive soft label construction method, which generates an adaptively adjustable pseudo-label method by calculating the representation distribution of a certain view of the data in the representation space. The adaptive soft label construction method assigns labels to selected representations in the representation space, enabling the model to learn representations of the data under unsupervised information conditions.
[0013] This invention also proposes a soft contrast method based on the relationship between different views, which performs representation learning by constructing the distribution of representations of different views and calculating the relationship between the distributions.
[0014] The beneficial effects of this invention are as follows: 1. Current methods for comparative learning in fields such as classification and recognition based on biosensor signals are simple and do not consider the data perspective. This paper makes two improvements in this regard. 2. An adaptive pseudo-label construction method is proposed, which enables comparative learning to generate pseudo-labels for representation learning in an unsupervised environment. 3. By constructing distributions of representations from different views of the data, KL divergence is used to measure the relationship between the two view distributions, which is more conducive to comparative learning in the representation space. Attached Figure Description
[0015] Figure 1 This is a flowchart of a contrastive learning-based classification method framework applied to the classification of biological sensor signals.
[0016] Figure 2 This is a graph of the encoder model used in the proposed contrastive learning method. Detailed Implementation
[0017] Example: Figure 1 This paper presents a contrastive learning-based classification method for biosensor signal classification. It includes data augmentation methods, an encoder, two soft contrastive learning methods for representation spaces, and specific downstream tasks such as classification and prediction. First, the encoder parameters are trained using contrastive learning. During downstream tasks, the encoder parameters are fixed, and different "projection heads" are selected based on the specific task.
[0018] The encoder structure used in this invention is as follows: Figure 2As shown, the encoder in this paper contains three one-dimensional convolutional modules, each including a one-dimensional convolutional layer, a regularization layer, and a pooling layer; one linear layer; one multi-attention layer; and one multilayer perceptron (MLP) layer. Downstream tasks are implemented using the representation output by the MLP. The encoder structure in this invention can also be replaced with other structures, and the encoder can be specifically selected according to different dataset types or sizes.
[0019] Adaptive Soft Contrast Learning: Classic instance discrimination tasks separate different instances and expect identical instances to have the same features. This constraint limits the role of similar instances in the model. In this paper, we do not use explicit negative instances (those to be pushed away) for each instance; instead, we learn the relationships between instances by constructing adaptive soft labels from representations in the memory bank. Different instances do not always need to be pushed away from each other; and augmented views of the same instance only need to share similar but not identical features.
[0020] Contrastive learning treats all other representations as negative examples, causing similar samples to be pushed apart in the sample space. Soft contrastive learning mitigates some of this problem by constructing pseudo-labels from the representations in memory. Compared with other representations in the memory library spliced together Now we can calculate The obtained representation is then passed through SoftMax to form the predicted probability vector.
[0021] (2).
[0022] Early work projected the contrastive learning process as a binary classification problem, using pseudo-labels constructed by assigning values to the front views of samples to perform representation learning.
[0023] (3).
[0024] While this simple construction of pseudo-labels can provide some reference for the model during unsupervised training, it ignores the potential similarity between different samples, which can also lead to false negatives. To address this issue, we propose modifying pseudo-labels based on the similarity between instances in the feature space, adaptively adjusting label weights by constructing a similarity distribution. The similarity between different augmented view representations of samples is calculated using cosine similarity, and after softmax, a similarity distribution is obtained, where... Compared with the above This represents the temperature parameter.
[0025] (4).
[0026] Adaptive pseudo-labels: This paper quantifies the sample similarity distribution and uses it as a confidence metric to adaptively construct pseudo-labels.
[0027] (5).
[0028] (6).
[0029] in express The rich entropy of aroma, using Will Transform to the [0,1] interval. This indicates how many neighboring samples are selected for soft-label weighted assignment. Using this method will not affect the front view of the sample itself, because even having the most similar sample with the highest confidence level will not make it more valuable than the original sample. The confidence level is high. Finally, the predicted probability vector is used. Obtaining pseudo-labels Calculate the cross-entropy loss.
[0030] (7).
[0031] Relationship soft contrast learning: In addition to using adaptive soft contrast learning, we also consider the relationship between different views of the sample. By comparing the similarity distribution of samples from different views, we learn to avoid the model from pushing some similar samples away. The sample similarity distribution of one view has been given in formula (4). The similarity distribution of the other view is calculated in a similar way to formula 4.
[0032] (8).
[0033] in It is another temperature parameter, which we propose to minimize The KL divergence between them drives the consistency of their relationship.
[0034] (9).
[0035] The overall self-supervised loss is a combination of adaptive soft contrast loss and relational soft contrast loss, as shown below.
[0036] (10).
[0037] in, For fixed scalar hyperparameters, represent the relative weight of each loss.
[0038] The specific implementation of this invention is as follows.
[0039] Input a batch of samples , , indicating two different enhancement functions. This indicates the encoder.
[0040] When the network converges.
[0041] Calculate for each sample i.
[0042] 1. Obtain from the current batch .
[0043] 2. Calculate the representation distribution using formulas (4) and (8); calculate the soft label assignment using formula (6).
[0044] 3. Calculate the soft contrast learning loss using formulas (7) and (9), and calculate the total loss using formula (10).
[0045] 4. Update network parameters.
[0046] Finish.
[0047] Output the trained model.
Claims
1. A pseudo-label construction method based on similarity distribution and a correlation-based contrastive learning method are proposed. First, by calculating the similarity distribution between instances, pseudo-labels are generated for each instance. These pseudo-labels not only provide additional supervision signals for the model, but also allow for dynamic adjustment of label weights as training progresses, thereby improving the model's generalization ability. Second, in addition to constructing the similarity distribution between instances, the interrelationships between different views are also calculated. In multi-view learning, data can be observed from multiple angles or feature spaces, and each view may contain different information about the data. By constructing the similarity distribution between views, the relationships between instances can be better modeled. Thus, when one view of the same sample is similar or dissimilar to other samples, another view can also maintain this relationship.
2. The contrastive learning-based classification method for classifying biological sensor signals according to claim 1, characterized in that: The required learning model is built from the data itself, requiring less supervised data.
3. The contrastive learning-based classification method for classifying biological sensor signals according to claim 1, characterized in that: The adaptive soft contrastive learning method constructs labels by building a representation of a certain view of the data in the representation space.
4. The contrastive learning-based classification method for classifying biological sensor signals according to claim 1, characterized in that: The relational soft contrastive learning algorithm described above learns data patterns by comparing the representation distributions of two views in the representation space.
5. The contrastive learning-based classification method for classifying biological sensor signals according to claim 1, characterized in that: The encoder in the method can also be adjusted according to the characteristics of the dataset and can be ported to research in different fields.